Fix ridden boat missing when joining 1.18+ Spigot server

This commit is contained in:
Jonas Herzig
2023-03-26 18:59:14 +02:00
parent 78bd060249
commit 8037a9ad30

View File

@@ -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;