mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fixed crash when updating pineapple plants
This commit is contained in:
parent
785a9ca820
commit
741318b307
1 changed files with 3 additions and 1 deletions
|
@ -66,7 +66,9 @@ public class PineappleCropBlock extends CropBlock {
|
||||||
if (state.get(HALF) == BlockHalf.BOTTOM) {
|
if (state.get(HALF) == BlockHalf.BOTTOM) {
|
||||||
super.randomTick(state, world, pos, random);
|
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));
|
world.setBlockState(pos.up(), getDefaultState().with(HALF, BlockHalf.TOP));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue