From de55778fc55c1aed487337af31479e0208b640de Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Wed, 13 Jan 2021 15:49:55 +0100 Subject: [PATCH] Extendo clip - Fixed extendo grips able to attack entities behind blocks --- .../create/content/curiosities/tools/ExtendoGripItem.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java index 5a72085bc..a74a092a0 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/ExtendoGripItem.java @@ -21,6 +21,7 @@ import net.minecraft.item.Item; import net.minecraft.item.Rarity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.EntityRayTraceResult; import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.util.math.Vec3d; @@ -116,6 +117,8 @@ public class ExtendoGripItem extends Item { return; if (!isHoldingExtendoGrip(player)) return; + if (mc.objectMouseOver instanceof BlockRayTraceResult && mc.objectMouseOver.getType() != Type.MISS) + return; // Modified version of GameRenderer#getMouseOver double d0 = player.getAttribute(PlayerEntity.REACH_DISTANCE)