Skip to content

Commit

Permalink
Fix passing null as direction
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldexun committed Apr 30, 2022
1 parent ab26011 commit e35fcf7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit e35fcf7

Please sign in to comment.