Skip to content

Commit

Permalink
Fix block placement not checking for player collision
Browse files Browse the repository at this point in the history
  • Loading branch information
tterrag1098 committed Mar 21, 2019
1 parent af4fcd7 commit 3870951
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions patches/minecraft/net/minecraft/world/World.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -899,14 +899,16 @@
}
}

@@ -2948,6 +3168,7 @@
@@ -2948,7 +3168,8 @@
IBlockState iblockstate1 = this.func_180495_p(p_190527_2_);
AxisAlignedBB axisalignedbb = p_190527_3_ ? null : p_190527_1_.func_176223_P().func_185890_d(this, p_190527_2_);

- if (axisalignedbb != Block.field_185506_k && !this.func_72917_a(axisalignedbb.func_186670_a(p_190527_2_), p_190527_5_))
+ if (!((p_190527_5_ instanceof EntityPlayer) || !net.minecraftforge.event.ForgeEventFactory.onBlockPlace(p_190527_5_, new net.minecraftforge.common.util.BlockSnapshot(this, p_190527_2_, p_190527_1_.func_176223_P()), p_190527_4_).isCanceled())) return false;
if (axisalignedbb != Block.field_185506_k && !this.func_72917_a(axisalignedbb.func_186670_a(p_190527_2_), p_190527_5_))
+ if (axisalignedbb != Block.field_185506_k && !this.func_72855_b(axisalignedbb.func_186670_a(p_190527_2_))) // Forge: Remove second parameter, we patch placer to be non-null, passing it here skips collision checks for the placer
{
return false;
}
@@ -2958,7 +3179,7 @@
}
else
Expand Down

0 comments on commit 3870951

Please sign in to comment.