2020-07-16 02:38:53 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
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
|
2020-09-10 23:47:58 +00:00
|
|
|
index eb461d328349689a7ae1a905ff3e891830f28b47..2ac264d0b4946d22877f002a86b39e11593c8c90 100644
|
2020-07-16 02:38:53 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-08-31 11:12:14 +00:00
|
|
|
@@ -1428,15 +1428,19 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2020-07-16 02:38:53 +00:00
|
|
|
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()) {
|
2020-08-25 02:22:08 +00:00
|
|
|
if (this.teleportPos == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
|
2020-07-16 02:38:53 +00:00
|
|
|
// 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);
|