mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Ensure shulker bounding box is updated (#6010)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
parent
08e9f148f9
commit
fc1a197de2
2 changed files with 25 additions and 11 deletions
|
@ -9,10 +9,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
}
|
||||||
|
|
||||||
public void setPos(double x, double y, double z) {
|
public void setPos(double x, double y, double z) {
|
||||||
this.setPosRaw(x, y, z);
|
- this.setPosRaw(x, y, z);
|
||||||
- this.setBoundingBox(this.makeBoundingBox());
|
- this.setBoundingBox(this.makeBoundingBox());
|
||||||
|
+ this.setPosRaw(x, y, z, true); // Paper - force bounding box update
|
||||||
+ // this.setBoundingBox(this.makeBoundingBox()); // Paper - move into setPositionRaw
|
+ // this.setBoundingBox(this.makeBoundingBox()); // Paper - move into setPositionRaw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,12 +23,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setPosRaw(double x, double y, double z) {
|
public final void setPosRaw(double x, double y, double z) {
|
||||||
+ // Paper start - never allow AABB to become desynced from position
|
+ // Paper start
|
||||||
+ // hanging has its own special logic
|
+ this.setPosRaw(x, y, z, false);
|
||||||
+ 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));
|
+ public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
|
||||||
+ }
|
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||||
this.position = new Vec3(x, y, z);
|
this.position = new Vec3(x, y, z);
|
||||||
int i = Mth.floor(x);
|
int i = Mth.floor(x);
|
||||||
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // 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) && (forceBoundingBoxUpdate || this.position.x != x || this.position.y != y || this.position.z != z)) {
|
||||||
|
+ this.setBoundingBox(this.makeBoundingBox());
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkDespawn() {}
|
||||||
|
|
|
@ -46,8 +46,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
|
||||||
}
|
}
|
||||||
|
public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
|
||||||
public final void setPosRaw(double x, double y, double z) {
|
// Paper end
|
||||||
+ // Paper start - fix MC-4
|
+ // Paper start - fix MC-4
|
||||||
+ if (this instanceof ItemEntity) {
|
+ if (this instanceof ItemEntity) {
|
||||||
+ if (com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) {
|
+ if (com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) {
|
||||||
|
@ -58,6 +58,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - fix MC-4
|
+ // Paper end - fix MC-4
|
||||||
// Paper start - never allow AABB to become desynced from position
|
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||||
// hanging has its own special logic
|
this.position = new Vec3(x, y, z);
|
||||||
if (!(this instanceof net.minecraft.world.entity.decoration.HangingEntity) && (this.position.x != x || this.position.y != y || this.position.z != z)) {
|
int i = Mth.floor(x);
|
||||||
|
|
Loading…
Reference in a new issue