From 379422ee03964ffad970fba33c222093f1e2b890 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Tue, 29 Mar 2022 04:42:46 -0400 Subject: [PATCH] Fix entity position desync for hanging entities (#7659) --- patches/server/Fix-Entity-Position-Desync.patch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/patches/server/Fix-Entity-Position-Desync.patch b/patches/server/Fix-Entity-Position-Desync.patch index 1a82c91f9a..822e43c9ed 100644 --- a/patches/server/Fix-Entity-Position-Desync.patch +++ b/patches/server/Fix-Entity-Position-Desync.patch @@ -5,7 +5,10 @@ Subject: [PATCH] Fix Entity Position Desync If entities were teleported in the first tick it would not be send to the client. -This also fixes desync caused be relatively teleporting paintings. +This excludes hanging entities, as this fix caused problematic behavior due to them having their own +position field. + +This also fixes desync caused be relatively teleporting paintings. (https://bugs.mojang.com/browse/MC-249169) This is caused by the fact that setPacketCoordinates isn't called on paintings when they are spawned (unlike every other entity, like XP orbs) on the client for some reason. This causes it to be relatively teleported to the world origin (0,0,0). @@ -18,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end - if (this.tickCount > 0 || this.entity instanceof AbstractArrow) { -+ if (true || this.tickCount > 0 || this.entity instanceof AbstractArrow) { // Paper - Always update position ++ if (!(this.entity instanceof net.minecraft.world.entity.decoration.HangingEntity) || this.tickCount > 0 || this.entity instanceof AbstractArrow) { // Paper - Always update position // Paper start - remove allocation of Vec3D here long k = ClientboundMoveEntityPacket.entityToPacket(vec3d_dx); long l = ClientboundMoveEntityPacket.entityToPacket(vec3d_dy);