aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch')
-rw-r--r--Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch b/Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch
new file mode 100644
index 0000000000..1eec5e895f
--- /dev/null
+++ b/Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Wed, 15 Jul 2020 19:34:11 -0700
+Subject: [PATCH] Move range check for block placing up
+
+
+diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
+index 8c02493bcdb6271870f8f1d558858ee3fb260014..6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab 100644
+--- a/src/main/java/net/minecraft/server/PlayerConnection.java
++++ b/src/main/java/net/minecraft/server/PlayerConnection.java
+@@ -1433,15 +1433,19 @@ public class PlayerConnection implements PacketListenerPlayIn {
+ BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
+ EnumDirection enumdirection = movingobjectpositionblock.getDirection();
+
++ // Paper start - move check up
++ Location eyeLoc = this.getPlayer().getEyeLocation();
++ double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ());
++ if (reachDistance > (this.getPlayer().getGameMode() == org.bukkit.GameMode.CREATIVE ? CREATIVE_PLACE_DISTANCE_SQUARED : SURVIVAL_PLACE_DISTANCE_SQUARED)) {
++ return;
++ }
++ // Paper end - move check up
++
+ this.player.resetIdleTimer();
+ if (blockposition.getY() < this.minecraftServer.getMaxBuildHeight()) {
+ if (this.teleportPos == null && this.player.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
+ // CraftBukkit start - Check if we can actually do something over this large a distance
+- Location eyeLoc = this.getPlayer().getEyeLocation();
+- double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ());
+- if (reachDistance > (this.getPlayer().getGameMode() == org.bukkit.GameMode.CREATIVE ? CREATIVE_PLACE_DISTANCE_SQUARED : SURVIVAL_PLACE_DISTANCE_SQUARED)) {
+- return;
+- }
++ // Paper - move check up
+ this.player.clearActiveItem(); // SPIGOT-4706
+ // CraftBukkit end
+ EnumInteractionResult enuminteractionresult = this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);