From 33e121b3dbf762b3b4dcbe384fca423e288464a3 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 5 Feb 2019 11:01:26 +0200 Subject: [PATCH] Fixed alfalfa causing a crash when attempting to grown into another block above it --- .../com/minelittlepony/unicopia/block/BlockAlfalfa.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/block/BlockAlfalfa.java b/src/main/java/com/minelittlepony/unicopia/block/BlockAlfalfa.java index b9bda4cb..8a37d32c 100644 --- a/src/main/java/com/minelittlepony/unicopia/block/BlockAlfalfa.java +++ b/src/main/java/com/minelittlepony/unicopia/block/BlockAlfalfa.java @@ -106,9 +106,11 @@ public class BlockAlfalfa extends BlockCrops { boolean hasTrunk = world.getBlockState(pos.down(2)).getBlock() == this; boolean hasRoot = world.getBlockState(pos.down(3)).getBlock() == this; - if (state.getBlock().isAir(state, world, pos)) { - if (!(hasDown && hasTrunk && hasRoot)) { - world.setBlockState(pos, withAge(increase).withProperty(HALF, Half.TOP)); + if (state.getBlock() != this) { + if (state.getBlock().isAir(state, world, pos)) { + if (!(hasDown && hasTrunk && hasRoot)) { + world.setBlockState(pos, withAge(increase).withProperty(HALF, Half.TOP)); + } } return; }