Posted August 16, 201510 yr hi everybody, Sorry for my bad English. I started programming a days before and try to learn it with online tutorials, and now i have a problem. i am trying to make a Crop like it is shown in this Tutorial(it is German) https://www.youtube.com/watch?v=L8_JeR7BR6A, but i tried to do it with proxys . The seeds working fine, and i can plant the Crop with the seed, but it doesn't load the texture... I think i have set the .json files right, but i would be happy if someone could look for the mistake i made. Console shows me this and for all the different states 0,1,2....7: [08:28:00] [Client thread/WARN]: Unable to load definition planttech:diamondoreplant#age=0 java.lang.RuntimeException: Encountered an exception when loading model definition of 'planttech:diamondoreplant#age=0' from: 'planttech:blockstates/diamondoreplant.json' in resourcepack: 'FMLFileResourcePack:Plant-Tech' at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:167) ~[ModelBakery.class:?] at net.minecraft.client.resources.model.ModelBakery.loadVariants(ModelBakery.java:118) [ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:134) [ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:95) [ModelLoader.class:?] at net.minecraft.client.resources.model.ModelManager.onResourceManagerReload(ModelManager.java:29) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:143) [simpleReloadableResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:121) [simpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:774) [Minecraft.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:331) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:528) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_51] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] Caused by: com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 11 column 2 at com.google.gson.Gson.fromJson(Gson.java:813) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?] at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:55) ~[blockStateLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:35) ~[ModelBlockDefinition.class:?] at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:162) ~[ModelBakery.class:?] ... 19 more Caused by: java.io.EOFException: End of input at line 11 column 2 at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1377) ~[JsonReader.class:?] at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:471) ~[JsonReader.class:?] at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:403) ~[JsonReader.class:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:166) ~[ReflectiveTypeAdapterFactory$Adapter.class:?] at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:768) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:717) ~[Gson.class:?] at com.google.gson.Gson.fromJson(Gson.java:689) ~[Gson.class:?] at net.minecraftforge.client.model.BlockStateLoader.load(BlockStateLoader.java:55) ~[blockStateLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBlockDefinition.parseFromReader(ModelBlockDefinition.java:35) ~[ModelBlockDefinition.class:?] at net.minecraft.client.resources.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:162) ~[ModelBakery.class:?] ... 19 more Here are the important code passages: Diamondoreplant.java(extends crops import net.kaneka.planttech.Main; import net.kaneka.planttech.items.Moditems; import net.minecraft.block.BlockCrops; import net.minecraft.client.Minecraft; import net.minecraft.init.Items; import net.minecraft.item.Item; public class Diamondoreplant extends BlockCrops { @Override protected Item getSeed() { return null; } @Override protected Item getCrop() { return Items.diamond; } } Modblocks.java (register blocks) import net.kaneka.planttech.Main; import net.kaneka.planttech.blocks.plants.Diamondoreplant; import net.kaneka.planttech.blocks.plants.Oreplant; import net.minecraft.block.Block; import net.minecraft.block.BlockCrops; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class Modblocks { ... public static BlockCrops diamondoreplant; public static void CreateB() { ... GameRegistry.registerBlock(diamondoreplant = new Diamondoreplant(), "diamondoreplant"); } } CommonProxy.java (register blocks) package net.kaneka.planttech; import net.kaneka.planttech.blocks.Modblocks; import net.kaneka.planttech.items.Moditems; import net.minecraft.client.resources.model.ModelBakery; import net.minecraft.item.Item; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class CommonProxy { public void preInit(FMLPreInitializationEvent e) { Modblocks.CreateB(); Moditems.CreateI(); } BlockRenderRegister.java (register Blockrender) package net.kaneka.planttech.client.render.blocks; import net.kaneka.planttech.Main; import net.kaneka.planttech.blocks.Modblocks; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public final class BlockRenderRegister { public static String modid = Main.MODID; public static void renderBRegister() { ... register(Modblocks.diamondoreplant); } public static void register(Block block) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(modid + ":" + block.getUnlocalizedName().substring(5), "inventory")); } } ClientProxy.java [code] package net.kaneka.planttech; import net.kaneka.planttech.blocks.Modblocks; import net.kaneka.planttech.client.render.blocks.BlockRenderRegister; import net.kaneka.planttech.client.render.items.ItemRenderRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; public class ClientProxy extends CommonProxy{ @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @Override public void init(FMLInitializationEvent e) { super.init(e); ItemRenderRegister.registerIRenderer(); BlockRenderRegister.renderBRegister(); } Now the .json files: assets/planttech/blockstats/diamondoreplant.json { "variants": { "age=0": { "model": "planttech:diamondoreplant_0" }, "age=1": { "model": "planttech:diamondoreplant_1" }, "age=2": { "model": "planttech:diamondoreplant_2" }, "age=3": { "model": "planttech:diamondoreplant_3" }, "age=4": { "model": "planttech:diamondoreplant_4" }, "age=5": { "model": "planttech:diamondoreplant_5" }, "age=6": { "model": "planttech:diamondoreplant_6" }, "age=7": { "model": "planttech:diamondoreplant_7" } } At least one from the other .json files, they are all the same with different numbers. assets/planttech/models/block/diamondoreplant_0.json { "parent": "block/crop", "textures": { "crop": "planttech:blocks/diamondoreplant_0" } } and so on with diamondoreplant 1,2,3...7 I have also add the .json file diamondoreplant to models/item. Thanks for reading and i am hopping somebody can help me. Kaneka
August 16, 201510 yr You're missing the } symbol from the end of your JSON to close the variants code block. To learn to find these things yourself, first look a the error. It says that the GSON package (which processes JSON) has found an EOF (end of file) before it expected it at line 11 of your JSON (which is the end). JSON are a bit tricky because your IDE can't warn you about mistakes. But you can validate the format of your JSON with online validator tools like at: http://jsonlint.com/ When I put your JSON code into the validator, it highlights the last line and says: Parse error on line 27: ...t_7" } } ---------------------^ Expecting '}', ',', ']'" So it tells you your JSON isn't correct and that you need one of those symbols. (Note it says line 27 instead of 11 because the validator also re-formats your code nicely). It is a good idea to run all your JSON through a validator tool. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
August 16, 201510 yr Author Thanks thanks thanks! i feel so silly right now.... i will use it in the future
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.