Fixed crash when updating pineapple plants

This commit is contained in:
Sollace 2023-09-10 18:03:18 +01:00
parent 785a9ca820
commit 741318b307
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -66,7 +66,9 @@ public class PineappleCropBlock extends CropBlock {
if (state.get(HALF) == BlockHalf.BOTTOM) {
super.randomTick(state, world, pos, random);
if (!isMature(state) && isMature(world.getBlockState(pos)) && world.isAir(pos.up())) {
BlockState newState = world.getBlockState(pos);
if (newState.isOf(this) && !isMature(state) && isMature(newState) && world.isAir(pos.up())) {
world.setBlockState(pos.up(), getDefaultState().with(HALF, BlockHalf.TOP));
}
} else {