I am currently working on an Update for a Mod for Java-Edition Version 1.12 (.2). The old Version was for 1.10.
Most other Blocks are working now (they have a Texture,..), but there seems to be a Problem with Leaves. This is the first time I am working on a Mod, so I am not so experienced with everything. Also it is a little bit irritating because there are different Variants to do everything (as it seems).
I already have all the necessary json-Files (as far as I know). The Blocks already work in the Inventory, but not in the world. There it shows this purple-black "missing-texture" - Texture.
Actually could you post all the asset files for a specific leaf type?
It looks like the block model is not being loaded properly, which is why I thought there might be a problem with the blockstate json.
The one you posted looks identical to the minecraft leaves json blockstate file, so I don't think there is a problem there.
Although it may be that there is some specific code which deals with the variants for vanilla leaves (and doesn't work for modded leaves), so the way to fix it may be to add in lines for each of the blockstates, which would look like this:
[15:48:16] [main/ERROR] [FML]: Exception loading model for variant biodiversity:leaves_cherry#check_decay=false,decayable=true for blockstate "biodiversity:leaves_cherry[check_decay=false,decayable=true]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model biodiversity:leaves_cherry#check_decay=false,decayable=true with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:161) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:235) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:223) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:25) [start/:?]
I'm a bit confused. The issue here was that it was looking for the model variants check_decay=true,decayable=true, etc. So as long as you give it models for all the variants it should work. With crops these presumably would be stage=0, etc.
I am currently working on an Update for a Mod for Java-Edition Version 1.12 (.2). The old Version was for 1.10.
Most other Blocks are working now (they have a Texture,..), but there seems to be a Problem with Leaves. This is the first time I am working on a Mod, so I am not so experienced with everything. Also it is a little bit irritating because there are different Variants to do everything (as it seems).
I already have all the necessary json-Files (as far as I know). The Blocks already work in the Inventory, but not in the world. There it shows this purple-black "missing-texture" - Texture.
If required I can provide extra Information.
The Mod is called Biodiversity.
What does the blockstate json look like?
Uncrafting Table (1.15.2): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table
Ruins of Humanity (mod, no longer being developed): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2898701-1-12-2-wip-early-alpha-ruins-of-humanity
As an Example here is the Blockstates-File for the Cherrytree, the other files look similar.
Actually could you post all the asset files for a specific leaf type?
It looks like the block model is not being loaded properly, which is why I thought there might be a problem with the blockstate json.
The one you posted looks identical to the minecraft leaves json blockstate file, so I don't think there is a problem there.
Although it may be that there is some specific code which deals with the variants for vanilla leaves (and doesn't work for modded leaves), so the way to fix it may be to add in lines for each of the blockstates, which would look like this:
Although I might have the order of check_decay and decayable backwards.
Uncrafting Table (1.15.2): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table
Ruins of Humanity (mod, no longer being developed): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2898701-1-12-2-wip-early-alpha-ruins-of-humanity
This is the Model-json for leaves_cherry:
This is the Item-json for leaves_cherry:
I did a little change to my Leaves-Source and used the following Blockstate:
The following Error occurred:
I don't know how to react to this Stacktrace.
try swapping the order of check_decay and decayable in the blockstate json
Uncrafting Table (1.15.2): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table
Ruins of Humanity (mod, no longer being developed): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2898701-1-12-2-wip-early-alpha-ruins-of-humanity
It works, thank you. (Hurray!)
Do you think this does also work for other plants?
I'm a bit confused. The issue here was that it was looking for the model variants check_decay=true,decayable=true, etc. So as long as you give it models for all the variants it should work. With crops these presumably would be stage=0, etc.
Uncrafting Table (1.15.2): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table
Ruins of Humanity (mod, no longer being developed): https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/2898701-1-12-2-wip-early-alpha-ruins-of-humanity