我如何在Minecraft Forge 1.14.4中使块具有obj作为模型

时间:2019-10-17 21:48:14

标签: java eclipse minecraft-forge .obj

我想使用自定义.obj作为块的模型,但到目前为止我仍然一无所获。

我已经搜索了几个小时,只找到了一些旧版本的教程,并且它们具有包和类(例如ClientProxy)和用于该块本身的整个类,我不知道如何实现。

所以基本上我想知道如何使用单独的类来实现块,并使用这些类将.obj用作模型

这就是我实现块的方式:

package me.ketrab2004.modName.lists;

import net.minecraft.block.Block;

public class BlockList
{
    public static Block copper_ore;

    public static Block copper_statue; //block for which i want to use a obj
}

和所述方块的项目:

package me.ketrab2004.modName.lists;

import net.minecraft.item.Item;

public class ItemList
{
    public static Item copper_ore;

    public static Item copper_statue;
}

在主类中:

@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents
    {
        @SubscribeEvent
        public static void registerItems(final RegistryEvent.Register<Item> event)
        {
            event.getRegistry().registerAll
            (
                    //block items
                    ItemList.copper_ore = new BlockItem(BlockList.copper_ore, new Item.Properties()
                            .group(ItemGroup.MATERIALS))
                            .setRegistryName(BlockList.copper_ore.getRegistryName()),
                    ItemList.copper_statue = new BlockItem(BlockList.copper_statue, new Item.Properties()
                            .group(ItemGroup.MISC))
                            .setRegistryName(BlockList.copper_statue.getRegistryName()),
            );

            logger.info("Items Registered");
        }

        @SubscribeEvent
        public static void registerBlocks(final RegistryEvent.Register<Block> event)
        {
            event.getRegistry().registerAll
            (
                    BlockList.copper_ore = new Block(Block.Properties.create(Material.ROCK)
                            .harvestLevel(3)
                            .harvestTool(ToolType.PICKAXE)
                            .hardnessAndResistance(5.0f, 25.0f)
                            .sound(SoundType.STONE))
                            .setRegistryName(location("copper_ore")),

                    BlockList.copper_statue = new Block(Block.Properties.create(Material.ANVIL)
                            .harvestLevel(2)
                            .harvestTool(ToolType.PICKAXE)
                            .hardnessAndResistance(10.0f, 2000.0f)
                            .sound(SoundType.ANVIL))
                            .setRegistryName(location("copper_statue"))
            );

            logger.info("Blocks Registered");
        }
    }

我发现的教程:

我完全迷路了,不胜感激 (Eclipse btw)

0 个答案:

没有答案