Diet (Fabric/Forge/Quilt)

Diet (Fabric/Forge/Quilt)

6M Downloads

[Bug]: Incompatibility with LittleTiles

CreativeMD opened this issue ยท 2 comments

commented

Hey there,
I'm the author of LittleTiles and it appears like there is an incompatibility between your mods. There is a call to Block.getCloneItemStack() which is a client side method (at least within vanilla) and causes a crash with LittleTiles. The result of this method varies depending on where the player looks at. Therefore I do a lookup to the client player, which works fine on client side. The method is not designed with a server callback in mind. My question is why is this call there in the first place and if there is a way to get around it?
https://github.com/illusivesoulworks/diet/blob/1.20.x/common/src/main/java/com/illusivesoulworks/diet/mixin/DietMixinServerPlayerGameMode.java#L53

commented

My question is why is this call there in the first place and if there is a way to get around it?

It's there to get an accurate ItemStack representation of a given blockstate. There could certainly be an alternative, I'm not really sure. If you're aware of a better solution to accomplish the same task, I'd be happy to change it.

commented

Actually ... I forgot that I have the level available. I will just check if this call is on server side and return an empty itemstack in that case. That should fix the incompatibility. Sorry for the trouble and thanks for the fast response. Have a good day!