mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 04:31:58 +01:00
1cfd363d32
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: fc460d1b PR-735: Add Villager#zombify c8c8331e PR-690: Add method to read ItemStack input 62845f2f SPIGOT-6829: Add per-player world border API CraftBukkit Changes: a459f4d4 PR-1033: Add Villager#zombify d65d1430 PR-975: Add method to read ItemStack input b5559f8c SPIGOT-6990: Fix setRepairCost(0) in Anvil 6c308e1b SPIGOT-6829: Add per-player world border API Spigot Changes: 42b61526 SPIGOT-7000: Generation and /locate issues when using custom structure seeds
34 lines
2.6 KiB
Diff
34 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
|
Date: Thu, 23 Dec 2021 23:59:12 -0500
|
|
Subject: [PATCH] Fix Entity Position Desync
|
|
|
|
If entities were teleported in the first tick it would not be send to the client.
|
|
|
|
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).
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
|
index fe29bf349b987d633b185b9d44d221053fa2cc83..f91e1a876ad4c46a7c92cead18947a941b4d9e68 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
|
@@ -164,13 +164,14 @@ public class ServerEntity {
|
|
}
|
|
// CraftBukkit end
|
|
|
|
- if (this.tickCount > 0 || this.entity instanceof AbstractArrow) {
|
|
+ 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);
|
|
long i1 = ClientboundMoveEntityPacket.entityToPacket(vec3d_dz);
|
|
// Paper end - remove allocation of Vec3D here
|
|
boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
|
|
+ if (this.entity instanceof net.minecraft.world.entity.decoration.Painting) {flag4 = true;} // Paper - Always send exact position for paintings
|
|
|
|
if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(com.destroystokyo.paper.PaperConfig.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
|
|
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
|