aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2023-09-12 09:56:24 +1000
committerNassim Jahnke <[email protected]>2023-09-12 09:56:24 +1000
commit517f8fbbac2467fb24fa87d6bd56ce5c1b9bc972 (patch)
tree0c68c368ac26ececf2766bbbcfa476a7b1cb3de6
parentfb06829845db10be0405966f874a16f135f73229 (diff)
downloadPaper-517f8fbbac2467fb24fa87d6bd56ce5c1b9bc972.tar.gz
Paper-517f8fbbac2467fb24fa87d6bd56ce5c1b9bc972.zip
Fix line of sight distance check
-rw-r--r--patches/server/0626-Line-Of-Sight-Changes.patch4
1 files changed, 2 insertions, 2 deletions
diff --git a/patches/server/0626-Line-Of-Sight-Changes.patch b/patches/server/0626-Line-Of-Sight-Changes.patch
index 9af116d84f..fd31360781 100644
--- a/patches/server/0626-Line-Of-Sight-Changes.patch
+++ b/patches/server/0626-Line-Of-Sight-Changes.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Line Of Sight Changes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index c0c864bcad6ba6466d7a6453ce920a3603f6066a..ad613b0d6c430a52ee706064c8638a643c2c5ffa 100644
+index c0c864bcad6ba6466d7a6453ce920a3603f6066a..4246122a794018b526e1619dcd066c2c88f4786c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3548,7 +3548,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -14,7 +14,7 @@ index c0c864bcad6ba6466d7a6453ce920a3603f6066a..ad613b0d6c430a52ee706064c8638a64
- return vec3d1.distanceTo(vec3d) > 128.0D ? false : this.level().clipDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == HitResult.Type.MISS; // Paper
+ // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
-+ return vec3d1.distanceToSqr(vec3d) > 128.0D ? false : this.level().clipDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == HitResult.Type.MISS; // Paper
++ return vec3d1.distanceToSqr(vec3d) > 128.0D * 128.0D ? false : this.level().clipDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == HitResult.Type.MISS; // Paper
}
}