ItemStack must be for default leaves when harvesting leaves with silk touch
DBotThePony opened this issue · 23 comments
Forestry version: 1.12.2 5.8.2.374
java.lang.IllegalArgumentException: ItemStack must be for default leaves.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at forestry.arboriculture.models.ModelDefaultLeaves.getInventoryKey(ModelDefaultLeaves.java:76)
at forestry.arboriculture.models.ModelDefaultLeaves.getInventoryKey(ModelDefaultLeaves.java:40)
at forestry.core.models.ModelBlockCached.getModel(ModelBlockCached.java:56)
at forestry.core.models.ModelBlockDefault$DefaultItemOverrideList.handleItemState(ModelBlockDefault.java:171)
at net.minecraft.client.renderer.RenderItem.getItemModelWithOverrides(RenderItem.java:248)
at codechicken.lib.render.item.CCRenderItem.getItemModelWithOverrides(CCRenderItem.java:393)
at codechicken.lib.render.item.CCRenderItem.renderItemAndEffectIntoGUI(CCRenderItem.java:334)
at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:265)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:98)
at v0id.vsb.client.gui.GuiBackpack.drawScreen(GuiBackpack.java:269)
at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:396)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1124)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1119)
at net.minecraft.client.Minecraft.run(Minecraft.java:3942)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)
java.lang.IllegalArgumentException: ItemStack must be for default leaves.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at forestry.arboriculture.models.ModelDefaultLeaves.getInventoryKey(ModelDefaultLeaves.java:76)
at forestry.arboriculture.models.ModelDefaultLeaves.getInventoryKey(ModelDefaultLeaves.java:40)
at forestry.core.models.ModelBlockCached.getModel(ModelBlockCached.java:56)
at forestry.core.models.ModelBlockDefault$DefaultItemOverrideList.handleItemState(ModelBlockDefault.java:171)
at net.minecraft.client.renderer.RenderItem.getItemModelWithOverrides(RenderItem.java:248)
at codechicken.lib.render.item.CCRenderItem.getItemModelWithOverrides(CCRenderItem.java:393)
at com.creativemd.itemphysic.physics.ClientPhysic.doRender(ClientPhysic.java:73)
at net.minecraft.client.renderer.entity.RenderEntityItem.doRender(RenderEntityItem.java)
at vazkii.quark.client.render.RenderItemFlashing.doRender(RenderItemFlashing.java:22)
at vazkii.quark.client.render.RenderItemFlashing.doRender(RenderItemFlashing.java:10)
at codechicken.lib.render.item.entity.WrappedEntityItemRenderer.doRender(WrappedEntityItemRenderer.java:33)
at codechicken.lib.render.item.entity.WrappedEntityItemRenderer.doRender(WrappedEntityItemRenderer.java:16)
at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:384)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:368)
at net.minecraft.client.renderer.RenderGlobal.redirect$renderEntityStatic$zbf000(RenderGlobal.java:2637)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:628)
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1347)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1259)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1062)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1119)
at net.minecraft.client.Minecraft.run(Minecraft.java:3942)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
at org.multimc.EntryPoint.listen(EntryPoint.java:143)
at org.multimc.EntryPoint.main(EntryPoint.java:34)
With Code Chicken Lib recovery enabled, itemstack of leaves looks like so
Hit this same issue when I tried to veinmine some Hill Cherry leaves with my pickaxe.
java.lang.IllegalArgumentException: ItemStack must be for default leaves.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at forestry.arboriculture.models.ModelDefaultLeaves.getInventoryKey(ModelDefaultLeaves.java:76)
at forestry.arboriculture.models.ModelDefaultLeaves.getInventoryKey(ModelDefaultLeaves.java:40)
at forestry.core.models.ModelBlockCached.getModel(ModelBlockCached.java:56)
at forestry.core.models.ModelBlockDefault$DefaultItemOverrideList.handleItemState(ModelBlockDefault.java:171)
at net.minecraft.client.renderer.RenderItem.func_184393_a(RenderItem.java:248)
at net.minecraft.client.renderer.entity.RenderEntityItem.func_76986_a(RenderEntityItem.java:105)
at vazkii.quark.client.render.RenderItemFlashing.func_76986_a(RenderItemFlashing.java:22)
at vazkii.quark.client.render.RenderItemFlashing.func_76986_a(RenderItemFlashing.java:10)
at codechicken.lib.render.item.entity.WrappedEntityItemRenderer.func_76986_a(WrappedEntityItemRenderer.java:33)
at codechicken.lib.render.item.entity.WrappedEntityItemRenderer.func_76986_a(WrappedEntityItemRenderer.java:16)
at morph.avaritia.client.render.entity.WrappedEntityItemRenderer.func_76986_a(WrappedEntityItemRenderer.java:33)
at morph.avaritia.client.render.entity.WrappedEntityItemRenderer.func_76986_a(WrappedEntityItemRenderer.java:16)
at net.minecraft.client.renderer.entity.RenderManager.func_188391_a(RenderManager.java:384)
at net.minecraft.client.renderer.entity.RenderManager.func_188388_a(RenderManager.java:368)
at net.minecraft.client.renderer.RenderGlobal.func_180446_a(RenderGlobal.java:628)
at net.minecraft.client.renderer.EntityRenderer.func_175068_a(EntityRenderer.java:1347)
at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1259)
at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1062)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1119)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)
at net.minecraft.client.main.Main.main(SourceFile:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Forestry forestry_1.12.2-5.8.2.380.jar
, modpack is Enigmatica 2 Expert 1.51
this is clearly forestry issue, since itemstack item id is definitely wrong for this leaves type. (it should be something like leaves.decoration when player harvest it)
I have a user who has run into the same issue: He veinmined the Hill Cherry Leaves with a Tinkers' Construct Mattock, which is both a Hoe and Axe. This was also in Enigmatica 2: Expert.
Version
- forestry_1.12.2-5.8.2.382
I just tested this with a super small build consisting of the following mods:
forestry_1.12.2-5.8.2.387.jar
Hwyla-1.8.26-B41_1.12.2.jar
jei_1.12.2-4.15.0.269.jar
journeymap-1.12.2-5.5.4.jar
NaturesCompass-1.12.2-1.5.1.jar
on Forge build 14.23.5.2815
Using shears on any forestry leaves returns the proper item stack with no issues, but if you use silk touch on an axe for instance the crash happens.
Tested this in a SSP world, the crash is client side, it does not affect a server but it will affect a player.
client crash report: https://pastebin.com/xb6w3gCe
Further testing by tracking back through the Beta builds shows that issue appeared right after the Release build 322. For my pack I'm going back to the release build as it properly invalidates all the bad blocks and allows players to resume play again.
I will update to new beta if one comes out that fixes the issue.
Just had the same in forestry_1.12.2-5.8.2.387 too. Silktouched Cherry with Thaumcraft gauntlet. Now crash every time I open inventory with the error as above.
Hmm. I can't reproduce the crash with:
forge: 14.23.5.2815
forestry: 5.8.2.387
journeymap: 1.12.2-5.5.4
jei: 4.15.0.269
nature's compass: 1.12.2-1.5.1
hwyla: 1.8.26
However, the harvesting behaviour is definitely weird and I get leaves called trees.grammar.leaves.type
. So something strange is definitely going on.
Are the harvested leaves from a worldgen/bred tree and was it planted on an older version of forestry? Also, which language do you use (maybe that's part of the issue?)
Thanks for the detailed reproduction @kreezxil. I will look into this today.
There were some changes to leaves in 367 which I thought might cause this. I can't see any obvious changes in the first beta that would cause this, so I'm a bit stuck as to why this occurs.
I'll do a binary test of the betas this weekend to find the one that actually works. I thought for sure I tested the very first beta, it's possible I tested one or two much earlier than build 374.
I just encountered this problem on our little server when harvesting a plum tree's leaves with Silk Touch.
I have seen the leaves named 'trees.grammar.leaves.type' and they went into the Thermal Expansion satchel.
Now I can't get into the game anymore. as it crashes on login everytime :( I already enabled auto recovery in chickenlib config and updated to forestry 387, but it still freezes at login and then crashes.
Crash log is here: https://pastebin.com/gRV5ZM7q
Forestry: 383
Forge: 2824
I played a bit with NBT Explorer, and have come to this result:
Having the faulty item in the inventory alone does not make the client crash, but having in in the hotbar, or dropping it to ground does.
I had put some of those leaves into a chest, leading to the impossibility to come close to that chest without crashing the client. Somehow I managed to get to the chest anyway after a lot of tires and salvaged the leaves from that chest.
Maybe this helps: I have captured a screenshot on how the items looks in NTBExplorer:
Thank you for the hint!
I administer the server, so I can change anything.
But aren't there features lost, when downgrading from 383 to 322?
Btw, as we now know that the problem didn't exist in 322: then upgrading and testing from 322 upwards step by step should lead to the patch that produced this bug, thus making a fix way easier for the devs, shouldn't it?
Maybe I could find some time for checking this..
I tried finding with version started the bug, but then occured what first made me use forestry 383+
We are using other mods that don't allow the server to even start with forestry version below about 380 :(
That's why I am not using the combination of latest recommended versions of forge, thermal expansion and such in general it just did not work for us :(
Ok, I'm super confused. I had time and I tested again and suddenly the mod is working with forge build 2815+.
This is so weird, I'm having no luck reproducing the error but when i tested it, everything was very reliable at reproducing it.
It's almost as if something involving the true time of the year has an effect on the tree leaves when silk touched.
If possible for the purposes of placating when the issue arises, have a config option that disables silk touching the leaves.
I'd mark this as closed, up to you. The data no longer confirms anything.
I've submitted a fix: #2431