From e35fcf7a5359072541b8111c59ecba72d2a7765c Mon Sep 17 00:00:00 2001 From: Meldexun <27779321+Meldexun@users.noreply.github.com> Date: Sat, 30 Apr 2022 10:56:01 +0200 Subject: [PATCH] Fix passing null as direction --- .../java/meldexun/reachfix/mixin/client/MixinGameRenderer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/meldexun/reachfix/mixin/client/MixinGameRenderer.java b/src/main/java/meldexun/reachfix/mixin/client/MixinGameRenderer.java index b37dd93..06791d7 100644 --- a/src/main/java/meldexun/reachfix/mixin/client/MixinGameRenderer.java +++ b/src/main/java/meldexun/reachfix/mixin/client/MixinGameRenderer.java @@ -15,6 +15,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.entity.Entity; +import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; @@ -60,7 +61,7 @@ public void onPick(float partialTicks, CallbackInfo info) { Vector3d dir = viewEntity.getViewVector(partialTicks).scale(reach); Vector3d start = viewEntity.getEyePosition(partialTicks); Vector3d end = start.add(dir); - mc.hitResult = BlockRayTraceResult.miss(end, null, new BlockPos(end)); + mc.hitResult = BlockRayTraceResult.miss(end, Direction.getNearest(dir.x(), dir.y(), dir.z()), new BlockPos(end)); } mc.getProfiler().pop();