thepowdertoy Posted August 24, 2012 Posted August 24, 2012 I'm still a noob coder, and currently I'm following this guide for adding infinite terrain and item indexes: http://www.minecraftforge.net/wiki/How_to_use_infinite_terrain_and_sprite_indexes but it uses the ITextureProvider, which in the current Forge version doesn't exist. So, after searching in the forum, nearly everything say use this to replace ITextureProvider: public String getTextureFile(){ return "[Terrain File]"; } but I don't know where to put the code. Here is my mod_tutorial: package net.minecraft.src; import net.minecraftforge.client.MinecraftForgeClient; public class mod_tutorial extends BaseMod { public static Item TutorialIngot; public static final Block TutorialBlock ; static { TutorialBlock = (new BlockTutorialBlock(255, ModLoader.addOverride("/terrain.png", "/mods/tes1.png"))).setHardness(3F).setResistance(5F).setStepSound(Block.soundWoodFootstep).setBlockName("First Block"); TutorialIngot = (new Item(1000)).setIconIndex(0).setItemName("TutorialIngot"). } public void load() { } public mod_tutorial() { MinecraftForgeClient.preloadTexture("/mods/items.png"); ModLoader.addName(TutorialIngot, "Tutorial Ingot"); ModLoader.registerBlock(TutorialBlock); ModLoader.addName(TutorialBlock, "Tutorial Block Ore"); ModLoader.addSmelting(Block.planks.blockID, new ItemStack(TutorialBlock ,1)); ModLoader.addSmelting(TutorialBlock.blockID, new ItemStack(TutorialIngot ,1)); } public String getVersion() { return "1.0.0"; } } And here is my TutorialIngot: package net.minecraft.src; public class TutorialIngot extends Item { public TutorialIngot(int i) { super(i); } public String getTextureFile(){ return "/mods/item.png"; } } But when I run Minecraft, what should the tutorial ingot look like an ingot, it instead look like a leather helmet. Here is the picture: Quote
LexManos Posted August 24, 2012 Posted August 24, 2012 Just use getTextureFile if you're not doing anything extra -.- Also dont know what version of forge you're using but you should always update to the latest build. Also, make sure you're setting the index properly with your texture sheet, you didnt show what your sheet should look like. Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
thepowdertoy Posted August 24, 2012 Author Posted August 24, 2012 Here is my sprite sheet: And I'm using the current version of Forge, which is Forge 4.0.0 Minecraft 1.3.2 And how do you set up the index? Quote
Thorrean Posted August 24, 2012 Posted August 24, 2012 Try the .setIconIndex() method of your item. Quote
LexManos Posted August 24, 2012 Posted August 24, 2012 -.- 4.0.0 tells me NOTHING about the version you are using you can be using build 172 or build 224, build numbers are freaking important. So I say again UPDATE YOUR FORGE Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
0xC6607Eo1 Posted August 24, 2012 Posted August 24, 2012 build #400 now its included in Item.java or Block.java. the only problem, is your using 'return "/mods/item.png";' your returning only the ingot. you need a terrain like 'terrain.png' in minecraft.jar, and then add the item overthere. look up the iconIndex (start counting from zero to 256) untill you hit the item, and the number is your iconIndex. I hope I helped you Quote
Viper283 Posted August 24, 2012 Posted August 24, 2012 build #400 what is the last number in the forge zip you downloaded, I.E, 4.0.0.217 thats the version i'm using untill later Quote
Viper283 Posted August 24, 2012 Posted August 24, 2012 1 word, update also in your mod_ file you preload the items.png but in your item file you use item.png you either missed the 's' in the item or you added an 's' when you preloaded it Quote
thepowdertoy Posted August 24, 2012 Author Posted August 24, 2012 build #400 now its included in Item.java or Block.java. the only problem, is your using 'return "/mods/item.png";' your returning only the ingot. you need a terrain like 'terrain.png' in minecraft.jar, and then add the item overthere. look up the iconIndex (start counting from zero to 256) untill you hit the item, and the number is your iconIndex. I hope I helped you terrain like terrain.png............. Do you mean this: or this: ? And I already try this too: but the ingot is invisible, and I'm using iconIndex 102, which is the place of the ingot Quote
Viper283 Posted August 25, 2012 Posted August 25, 2012 build #400 now its included in Item.java or Block.java. the only problem, is your using 'return "/mods/item.png";' your returning only the ingot. you need a terrain like 'terrain.png' in minecraft.jar, and then add the item overthere. look up the iconIndex (start counting from zero to 256) untill you hit the item, and the number is your iconIndex. I hope I helped you terrain like terrain.png............. Do you mean this: or this: ? And I already try this too: but the ingot is invisible, and I'm using iconIndex 102, which is the place of the ingot instaed of setIconIndex use setIconCoord(7, 6) for the above items.png Quote
Recommended Posts
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.