From 8037a9ad30c5eac101c11fc70ce5dcc2b10fd3be Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Sun, 26 Mar 2023 18:59:14 +0200 Subject: [PATCH] Fix ridden boat missing when joining 1.18+ Spigot server --- .../replay/mixin/Mixin_FixEntityNotTracking.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/versions/1.18.1/src/main/java/com/replaymod/replay/mixin/Mixin_FixEntityNotTracking.java b/versions/1.18.1/src/main/java/com/replaymod/replay/mixin/Mixin_FixEntityNotTracking.java index 1d95dd1b..1c497b25 100644 --- a/versions/1.18.1/src/main/java/com/replaymod/replay/mixin/Mixin_FixEntityNotTracking.java +++ b/versions/1.18.1/src/main/java/com/replaymod/replay/mixin/Mixin_FixEntityNotTracking.java @@ -20,6 +20,14 @@ public class Mixin_FixEntityNotTracking { private void updatePositionIfNotTracked(Entity entity) { if (entity != null && entity.world instanceof ClientWorldAccessor world) { if (!world.getEntityList().has(entity)) { + // This only applies to entities that are server-controlled. + // You wouldn't think this check is necessary but for some stupid reason Spigot sends entities before + // chunks, so we must not update the entity if it is being ridden by the client player because those + // will fall into the void and die (client-side only ofc). + if (entity.isLogicalSideForUpdatingMovement()) { + return; + } + // Skip interpolation of position updates coming from server // (See: newX in EntityLivingBase or otherPlayerMPX in EntityOtherPlayerMP) int ticks = 0;