Fix interaction pos in range check (#6654)

This commit is contained in:
Gaider10 2021-09-24 11:02:14 +03:00 committed by GitHub
parent 397349e0aa
commit d0a2193d4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 36a69fb0a9cd81ceb0f9cbe6549fc89bd643c77c..7bf9f2b85c51424b53c08166b6ba3943f1abe0fe 100644 index 36a69fb0a9cd81ceb0f9cbe6549fc89bd643c77c..51303e89ec160f3715e538903ae98be993d59150 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1661,6 +1661,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1661,6 +1661,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@ -29,7 +29,7 @@ index 36a69fb0a9cd81ceb0f9cbe6549fc89bd643c77c..7bf9f2b85c51424b53c08166b6ba3943
+ // Paper start - move check up and check actual location as well + // Paper start - move check up and check actual location as well
+ final Vec3 clickedLocation = movingobjectpositionblock.getLocation(); + final Vec3 clickedLocation = movingobjectpositionblock.getLocation();
+ if (isOutsideOfReach(blockposition.getX(), blockposition.getY(), blockposition.getZ()) + if (isOutsideOfReach(blockposition.getX() + 0.5D, blockposition.getY() + 0.5D, blockposition.getZ() + 0.5D)
+ || !Double.isFinite(clickedLocation.x) || !Double.isFinite(clickedLocation.y) || !Double.isFinite(clickedLocation.z) + || !Double.isFinite(clickedLocation.x) || !Double.isFinite(clickedLocation.y) || !Double.isFinite(clickedLocation.z)
+ || isOutsideOfReach(clickedLocation.x, clickedLocation.y, clickedLocation.z)) { + || isOutsideOfReach(clickedLocation.x, clickedLocation.y, clickedLocation.z)) {
+ return; + return;