Posted May 13, 201213 yr Cannot make a static reference to the non-static method registerOre(String, ItemStack) from the type IOreHandler Line of declaration (did import): IOreHandler.registerOre("ingotRefinedIron", ingotSteelStack); ingotSteelStack Declaration: ItemStack ingotSteelStack = new ItemStack(ingotSteel); ingotSteel Declaration (Don't bug me for using default Modloader sprites, gonna fix): public final Item ingotSteel = new itemSteel(144).setIconIndex(ModLoader.addOverride("/gui/items.png", "/physicraft/items/ingotSteel.png")).setItemName("ingotSteel"); itemSteel Class: package net.minecraft.src; public class itemSteel extends Item { public itemSteel(int i) { super(i); } }
May 13, 201213 yr Author BTW, I was trying to implement the Dictionary without asking(I'm a beginner in Java), but I ended up posting anyways (*facepalm*).
May 24, 201213 yr IOreHandler.registerOre("ingotRefinedIron", ingotSteelStack); You are calling an abstract static method that does not exist. IOreHandler (hence the I on the front for Interface) means that 'you' need to implement it. This is how you handle callbacks. Actually, here is an idea, look at the IronChest mods source code (https://github.com/cpw/ironchest/), it uses the IOreHandler callback to set up recipes for mod added copper/tin/etc... You also need to register your ores, there should be a method for that on the MinecraftForge class or ForgeHooks or something.
June 4, 201213 yr if you are using MForge you should consider making a sprite sheet like what minecraft has, a 256x256 png file add this line to your load() method MinecraftForgeClient.preloadTexture("Directory Here"); also have the item code look something like this public final Item ingotSteel = new itemSteel(144).setIconIndex(0).setItemName("ingotSteel"); 0 is the first 16x16 section on the sprite sheet
June 4, 201213 yr Author I know how to use infinite sprite indexing, but i'm sticking to modloader sprites because many tuts use them (for like furnaces and such) and eventually i will convert all of them.
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.