mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Fixed alfalfa causing a crash when attempting to grown into another block above it
This commit is contained in:
parent
7cb52ecdf5
commit
33e121b3db
1 changed files with 5 additions and 3 deletions
|
@ -106,10 +106,12 @@ public class BlockAlfalfa extends BlockCrops {
|
||||||
boolean hasTrunk = world.getBlockState(pos.down(2)).getBlock() == this;
|
boolean hasTrunk = world.getBlockState(pos.down(2)).getBlock() == this;
|
||||||
boolean hasRoot = world.getBlockState(pos.down(3)).getBlock() == this;
|
boolean hasRoot = world.getBlockState(pos.down(3)).getBlock() == this;
|
||||||
|
|
||||||
|
if (state.getBlock() != this) {
|
||||||
if (state.getBlock().isAir(state, world, pos)) {
|
if (state.getBlock().isAir(state, world, pos)) {
|
||||||
if (!(hasDown && hasTrunk && hasRoot)) {
|
if (!(hasDown && hasTrunk && hasRoot)) {
|
||||||
world.setBlockState(pos, withAge(increase).withProperty(HALF, Half.TOP));
|
world.setBlockState(pos, withAge(increase).withProperty(HALF, Half.TOP));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue