FastLeafDecay icon indicating copy to clipboard operation
FastLeafDecay copied to clipboard

[1.15.1] Crash when leaves decays suddenly.

Open Gbergz opened this issue 6 years ago • 4 comments

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

Gbergz avatar Jan 28 '20 12:01 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/

Quarris avatar Feb 29 '20 10:02 Quarris

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. :)

Olafski avatar Apr 06 '20 19:04 Olafski

Update: I updated my development environment to the latest Forge MDK and the randomTick method is back. :) Was that what you meant, @Quarris ?

Olafski avatar Apr 06 '20 20:04 Olafski

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.

Quarris avatar Apr 06 '20 21:04 Quarris