Extendo clip

- Fixed extendo grips able to attack entities behind blocks
This commit is contained in:
simibubi 2021-01-13 15:49:55 +01:00
parent f47d1e87c1
commit de55778fc5

View file

@ -21,6 +21,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.Rarity; import net.minecraft.item.Rarity;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.EntityRayTraceResult; import net.minecraft.util.math.EntityRayTraceResult;
import net.minecraft.util.math.RayTraceResult.Type; import net.minecraft.util.math.RayTraceResult.Type;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@ -116,6 +117,8 @@ public class ExtendoGripItem extends Item {
return; return;
if (!isHoldingExtendoGrip(player)) if (!isHoldingExtendoGrip(player))
return; return;
if (mc.objectMouseOver instanceof BlockRayTraceResult && mc.objectMouseOver.getType() != Type.MISS)
return;
// Modified version of GameRenderer#getMouseOver // Modified version of GameRenderer#getMouseOver
double d0 = player.getAttribute(PlayerEntity.REACH_DISTANCE) double d0 = player.getAttribute(PlayerEntity.REACH_DISTANCE)