[1.13] Check canSustainPlant for valid ground in BlockBush (#5362)

This commit is contained in:
Adubbz 2019-01-26 08:12:34 +11:00 committed by LexManos
parent 7a651b8c1f
commit 2c8ab76240

View file

@ -9,7 +9,16 @@
protected BlockBush(Block.Builder p_i48437_1_) {
super(p_i48437_1_);
}
@@ -44,4 +44,11 @@
@@ -26,6 +26,8 @@
public boolean func_196260_a(IBlockState p_196260_1_, IWorldReaderBase p_196260_2_, BlockPos p_196260_3_) {
BlockPos blockpos = p_196260_3_.func_177977_b();
+ if (p_196260_1_.func_177230_c() == this) //Forge: This function is called during world gen and placement, before this block is set, so if we are not 'here' then assume it's the pre-check.
+ return p_196260_2_.func_180495_p(blockpos).canSustainPlant(p_196260_2_, blockpos, EnumFacing.UP, this);
return this.func_200014_a_(p_196260_2_.func_180495_p(blockpos), p_196260_2_, blockpos);
}
@@ -44,4 +46,11 @@
public int func_200011_d(IBlockState p_200011_1_, IBlockReader p_200011_2_, BlockPos p_200011_3_) {
return 0;
}