Posted June 20, 201510 yr When I was trying to make a new ore for the mod and eclipse and minecraft don't like it when it is almost the same exact code as the other blocks but I may have messed up somewhere. yes I did extended the block and did the constructer here is the code for the stuff that is causing me problems. Package: package pixelpacker.testmod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "tm", name = "Test Mod", version = "1.0") public class TestMod { public static Item itemTable; public static Block blockTable; public static Block blockTest; public static Block blockPixinite; @EventHandler public void preInit(FMLPreInitializationEvent event){ blockPixinite = new BlockPixinite().setUnlocalizedName("BlockPixinite").setTextureName("tm:PixiniteOre").setCreativeTab(tabTestMod); itemTable = new ItemTable().setUnlocalizedName("ItemTable").setTextureName("tm:itemtable").setCreativeTab(tabTestMod); GameRegistry.registerItem(itemTable, itemTable.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(blockPixinite, blockPixinite.getUnlocalizedName().substring(5)); } @EventHandler public void init(FMLInitializationEvent event) { GameRegistry.addRecipe(new ItemStack(itemTable, 10), new Object[]{"WWW", " W ", " W ", 'W', Blocks.planks}); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public static CreativeTabs tabTestMod = new CreativeTabs("tabTestMod"){ @Override public Item getTabIconItem(){ return new ItemStack(blockTest).getItem(); } }; } The line of code in question: blockPixinite = new BlockPixinite().setUnlocalizedName("BlockPixinite").setTextureName("tm:PixiniteOre").setCreativeTab(tabTestMod); Pixinite code: package pixelpacker.testmod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; public class BlockPixinite extends Block { protected BlockPixinite(Material material) { super(material); // TODO Auto-generated constructor stub } }
June 20, 201510 yr Please - learn Java before modding. 1. Constructor can't be protected - make it public to be able to use it outside inheriting classes. 2. Constructor takes Material as argument, you can't construct it without it. Material.class (lookup vanilla). 1.7.10 is no longer supported by forge, you are on your own.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.