Force update attributes

See https://github.com/PaperMC/Paper/pull/12241/
This commit is contained in:
0x22
2025-03-07 17:57:18 -08:00
committed by Spottedleaf
parent e5d988df85
commit 743346a5da
3 changed files with 61 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Optimise collision checking in player move packet handling
Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index addeb449904ec9a2ef59b99022787bee689b83cf..27718a20666a3edc0b036e4cdeda5d7901f814ce 100644
index 12c83cb084563a4e3f7f357d8b600941544ef2b0..90e582ca30851857add5e2d830e9876667fd1807 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -563,7 +563,7 @@ public class ServerGamePacketListenerImpl
@@ -88,7 +88,7 @@ index addeb449904ec9a2ef59b99022787bee689b83cf..27718a20666a3edc0b036e4cdeda5d79
}
@Override
@@ -1370,7 +1402,7 @@ public class ServerGamePacketListenerImpl
@@ -1371,7 +1403,7 @@ public class ServerGamePacketListenerImpl
}
}
@@ -97,7 +97,7 @@ index addeb449904ec9a2ef59b99022787bee689b83cf..27718a20666a3edc0b036e4cdeda5d79
d3 = d - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
d4 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
d5 = d2 - this.lastGoodZ; // Paper - diff on change, used for checking large move vectors above
@@ -1409,6 +1441,7 @@ public class ServerGamePacketListenerImpl
@@ -1410,6 +1442,7 @@ public class ServerGamePacketListenerImpl
boolean flag1 = this.player.verticalCollisionBelow;
this.player.move(MoverType.PLAYER, new Vec3(d3, d4, d5));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
@@ -105,7 +105,7 @@ index addeb449904ec9a2ef59b99022787bee689b83cf..27718a20666a3edc0b036e4cdeda5d79
// Paper start - prevent position desync
if (this.awaitingPositionFromClient != null) {
return; // ... thanks Mojang for letting move calls teleport across dimensions.
@@ -1441,7 +1474,17 @@ public class ServerGamePacketListenerImpl
@@ -1442,7 +1475,17 @@ public class ServerGamePacketListenerImpl
}
// Paper start - Add fail move event
@@ -124,7 +124,7 @@ index addeb449904ec9a2ef59b99022787bee689b83cf..27718a20666a3edc0b036e4cdeda5d79
if (teleportBack) {
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.CLIPPED_INTO_BLOCK,
toX, toY, toZ, toYaw, toPitch, false);
@@ -1577,7 +1620,7 @@ public class ServerGamePacketListenerImpl
@@ -1578,7 +1621,7 @@ public class ServerGamePacketListenerImpl
private boolean updateAwaitingTeleport() {
if (this.awaitingPositionFromClient != null) {
@@ -133,7 +133,7 @@ index addeb449904ec9a2ef59b99022787bee689b83cf..27718a20666a3edc0b036e4cdeda5d79
this.awaitingTeleportTime = this.tickCount;
this.teleport(
this.awaitingPositionFromClient.x,
@@ -1596,6 +1639,33 @@ public class ServerGamePacketListenerImpl
@@ -1597,6 +1640,33 @@ public class ServerGamePacketListenerImpl
}
}

View File

@@ -11,7 +11,7 @@ a portal in spectator mode and then later switching to creative mode
would portal the player.
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 27718a20666a3edc0b036e4cdeda5d7901f814ce..727792ca1a2c9044abb1d404fbf8420652e1507c 100644
index 90e582ca30851857add5e2d830e9876667fd1807..c569cdfa4cba4f65892ffd4045c611837049f440 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -659,7 +659,7 @@ public class ServerGamePacketListenerImpl
@@ -23,7 +23,7 @@ index 27718a20666a3edc0b036e4cdeda5d7901f814ce..727792ca1a2c9044abb1d404fbf84206
Vec3 vec3 = new Vec3(rootVehicle.getX() - x, rootVehicle.getY() - y, rootVehicle.getZ() - z);
this.handlePlayerKnownMovement(vec3);
rootVehicle.setOnGroundWithMovement(packet.onGround(), vec3);
@@ -1576,7 +1576,7 @@ public class ServerGamePacketListenerImpl
@@ -1577,7 +1577,7 @@ public class ServerGamePacketListenerImpl
Vec3 vec3 = new Vec3(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
this.player.setOnGroundWithMovement(packet.isOnGround(), packet.horizontalCollision(), vec3);
this.player.doCheckFallDamage(vec3.x, vec3.y, vec3.z, packet.isOnGround());