[1.15.1] Crash when leaves decays suddenly.
Title^
Minecraft: 1.15.1 Forge: 30.0.42 Mod Version: FastLeafDecay-v20
Crash-Report: https://gist.github.com/Gbergz/5a08c7c12e32a8f7191814f8290b93ec
Part of the logs: https://gist.github.com/Gbergz/a9d36dff11081e980ccc46d829580569
Crash-Message in Launcher:
"The game crashed whilst exception in server tick loop
Error: java.lang.ClassCastException: enemeez.simplefarming.blocks.growable.FruitLeavesBlock cannot be cast to net.minecraft.block.LeavesBlock"
Any ideas? ~ Gbergz
Same thing happens with Nature's Aura (https://github.com/Ellpeck/NaturesAura/issues/78).
If you want to check for leaves blocks and then cast, should do an instance of check instead, and then cast it.
I wanted to check excatly what you are doing the cast for, but I couldn't find the 1.15 repo. I'd think possibly to somehow decay the leave, but that (I think) can be done with properties, which wouldn't require the cast. Anyways, hope you can fix it \o/
This should be fixed with v21, available on CurseForge.
@Quarris I'm not quite sure what you mean with doing it with properties. If you could explain that to me, I'd be happy to change it. I used to just schedule a block tick with Minecraft 1.14, but I can't find an equivalent method for 1.15 so I just call the "decay" method (func_225542_b_) directly. For that I need to cast to LeavesBlock. If there's a better way to do it, or if there actually is a method to schedule block ticks that I couldn't find, I'm all ears. :)
Update: I updated my development environment to the latest Forge MDK and the randomTick method is back. :) Was that what you meant, @Quarris ?
No, thinking about it now the property thing I mentioned doesnt make any sense. Its nice that its fixed, Ellpeck's been getting quite annoyed with the amount of reports on his github from this.