AlloycraftBlocks.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:Alloycraft 作者:
public static void initBlocks() {

    GameRegistry.register(forgeoff, new ResourceLocation(AlloycraftMain.modid, "forgeoff"));
    GameRegistry.register(new ItemBlock(forgeoff), new ResourceLocation(AlloycraftMain.modid, "forgeoff"));
    GameRegistry.registerTileEntity(ForgeTileEntity.class, "forgefurnace");
    if (Loader.isModLoaded("Tesla")) {
        GameRegistry.register(forgeteslaoff, new ResourceLocation(AlloycraftMain.modid, "forgeteslaoff"));
        GameRegistry.register(new ItemBlock(forgeteslaoff), new ResourceLocation(AlloycraftMain.modid, "forgeteslaoff"));
        GameRegistry.registerTileEntity(ForgeTeslaTileEntity.class, "forgeteslafurnace");
    }
    if(FMLCommonHandler.instance().getSide() == Side.CLIENT) {
        ItemModelMesher itemRender = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
        itemRender.register(Item.getItemFromBlock(AlloycraftBlocks.forgeoff), 0, new ModelResourceLocation(AlloycraftMain.modid + ":" + "forgeoff", "inventory"));
        if (Loader.isModLoaded("Tesla")) {
            itemRender.register(Item.getItemFromBlock(AlloycraftBlocks.forgeteslaoff), 0, new ModelResourceLocation(AlloycraftMain.modid + ":" + "forgeoff", "inventory"));
        }   
    }
    GameRegistry.addRecipe(new ItemStack(forgeoff, 1), new Object[]{
            "AAA",
            "ABA",
            "DCD",
            'A', Items.IRON_INGOT, 'B', Blocks.IRON_BLOCK, 'C', Blocks.REDSTONE_BLOCK, 'D', Blocks.FURNACE
        });
    GameRegistry.addRecipe(new ItemStack(forgeteslaoff, 1), new Object[]{
            "AAA",
            "ACA",
            "DBD",
            'A', Items.IRON_INGOT, 'B', Blocks.IRON_BLOCK, 'C', Blocks.REDSTONE_BLOCK, 'D', Blocks.FURNACE
        });

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号