Posted July 24, 201411 yr Hello Forgerers i'm trying to add a crop to my mod (A tomato) which grows the same way a Melon/Pumpkin does (stem, block next to it etc) I've tried everything and it simply won't work. I've looked everywhere for tutorials and whatnot, and I can't find anything. I've spent at least 3 hours looking at the vanilla code and copying it over, modifying where necessary, and it's still not working. If anyone could point me in the right direction, that would be splendid
July 24, 201411 yr what exactly isnt working? you cant plant your seed? your seed wont grow? or the stem wont spawn the tomato next to it? I am the author of Draconic Evolution
July 24, 201411 yr Author what exactly isnt working? you cant plant your seed? your seed wont grow? or the stem wont spawn the tomato next to it? The game won't load. It's saying NullPointerException. I'll post the source code for everything related, and the error stuff now (Should probably have done that first)
July 24, 201411 yr yes that will help Edit: the crash log will also help. I am the author of Draconic Evolution
July 24, 201411 yr Author BetterCraft.java (Main Mod Class) http://pastebin.com/Uf5rYnFt ItemSeed.java http://pastebin.com/c6rYrdbT BlockStem.java http://pastebin.com/XJ5MJb8f BlockTomato.java http://pastebin.com/Xg8LFLtv Console Log http://pastebin.com/Szkj0Hzm
July 24, 201411 yr Sorry but i didnt start modding until 1.7.2 so you will have to wait for someone who has had experience with 1.6 to help you. But from what i can tell from your crash log it looks like the problem is in this line public static Item tomatoseeds = new ItemSeed (27547, BetterCraft.tomatostem.blockID, Block.tilledField.blockID).setUnlocalizedName("tomatoseeds").setTextureName("bettercraft:tomatoseeds"); I am the author of Draconic Evolution
July 24, 201411 yr Author Sorry but i didnt start modding until 1.7.2 so you will have to wait for someone who has had experience with 1.6 to help you. But from what i can tell from your crash log it looks like the problem is in this line public static Item tomatoseeds = new ItemSeed (27547, BetterCraft.tomatostem.blockID, Block.tilledField.blockID).setUnlocalizedName("tomatoseeds").setTextureName("bettercraft:tomatoseeds"); yeah, I know it's that line, but it's the exact same as the vanilla, well, not exact same obviously. I don't know what I've done wrong, it's bugging me
July 24, 201411 yr Darn you just beat me... It took me a while to find the problem because Then: your class is a mess. Everything thrown into one class, that's ugly and you just can't read it, especially with no syntax highlighting. I am the author of Draconic Evolution
July 24, 201411 yr Author First of all: don't make a mod for 1.6.4. It's ages old. Then: your class is a mess. Everything thrown into one class, that's ugly and you just can't read it, especially with no syntax highlighting. The issue is that you use the "tomatostem" field before you create it's value, so the value is still null. I know 1.6.4 is old, but I've been working on this mod at a slow rate, since 1.6.4 basically came out I also know my class is a mess, but I know where everything is, I wanted to get everything working them start tidying it up. And I don't follow, if you could identify where I create the value so I can move it, I get confused with the Java ordering... (sorry for dorky understanding)
July 24, 201411 yr Its simple tomatostem = new BlockStem(845, tomatoblock).setUnlocalizedName("tomatostem").setHardness(0.0F).setResistance(0.5F); needs to be called before public static Item tomatoseeds = new ItemSeed (27547, BetterCraft.tomatostem.blockID, Block.tilledField.blockID).setUnlocalizedName("tomatoseeds").setTextureName("bettercraft:tomatoseeds"); I am the author of Draconic Evolution
July 24, 201411 yr Author Its simple tomatostem = new BlockStem(845, tomatoblock).setUnlocalizedName("tomatostem").setHardness(0.0F).setResistance(0.5F); needs to be called before public static Item tomatoseeds = new ItemSeed (27547, BetterCraft.tomatostem.blockID, Block.tilledField.blockID).setUnlocalizedName("tomatoseeds").setTextureName("bettercraft:tomatoseeds"); OH, YES I UNDERSTAND NOW I've always grouped the registering of blocks and the creation (i think them terms are correct) because of a tutorial I watched waaaay back. Gonna fix now and report back. Thanks so much guys
July 24, 201411 yr Author Well I give up now. The client launched, but the tomato block doesn't exist. I tried to plant the tomato seeds, but the game crashed. I'm going to start afresh, on 1.7.2, and slowly build my mod back up. If you know of any tutorials that could help me with the block creation (as I believe that there is a crop api for crops and stuff idk) but that would be great Thanks guys
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.