mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 12:11:47 +01:00
Fix line of sight distance check
This commit is contained in:
parent
fb06829845
commit
517f8fbbac
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue