From 3870951a3738389bea521bd13b2b08efba542f77 Mon Sep 17 00:00:00 2001 From: tterrag Date: Wed, 20 Mar 2019 23:18:26 -0400 Subject: [PATCH] Fix block placement not checking for player collision --- patches/minecraft/net/minecraft/world/World.java.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/World.java.patch b/patches/minecraft/net/minecraft/world/World.java.patch index 062bbbc08d..11d925d5e0 100644 --- a/patches/minecraft/net/minecraft/world/World.java.patch +++ b/patches/minecraft/net/minecraft/world/World.java.patch @@ -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