2021-06-14 10:37:14 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sun, 10 May 2020 22:12:46 -0400
|
|
|
|
Subject: [PATCH] Ensure Entity AABB's are never invalid
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-06-16 13:07:43 +02:00
|
|
|
index 1afb2cf4fd5938346ab035fab2af960049b5d7d3..5db6b853e61e62e40e55034d5738717664cb9245 100644
|
2021-06-14 10:37:14 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2021-06-16 07:36:02 +02:00
|
|
|
@@ -560,7 +560,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
2021-06-14 10:37:14 +02:00
|
|
|
|
|
|
|
public void setPos(double x, double y, double z) {
|
|
|
|
this.setPosRaw(x, y, z);
|
|
|
|
- this.setBoundingBox(this.makeBoundingBox());
|
|
|
|
+ // this.setBoundingBox(this.makeBoundingBox()); // Paper - move into setPositionRaw
|
|
|
|
}
|
|
|
|
|
|
|
|
protected AABB makeBoundingBox() {
|
2021-06-16 07:36:02 +02:00
|
|
|
@@ -3738,6 +3738,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
2021-06-14 10:37:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public final void setPosRaw(double x, double y, double z) {
|
|
|
|
+ // Paper start - never allow AABB to become desynced from position
|
|
|
|
+ // hanging has its own special logic
|
|
|
|
+ if (!(this instanceof net.minecraft.world.entity.decoration.HangingEntity) && (this.position.x != x || this.position.y != y || this.position.z != z)) {
|
|
|
|
+ this.setBoundingBox(this.dimensions.makeBoundingBox(x, y, z));
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
|
|
|
this.position = new Vec3(x, y, z);
|
|
|
|
int i = Mth.floor(x);
|