Fix half-despawned player entities (see #93) when the entity is moved greater distances

This commit is contained in:
Jonas Herzig
2017-10-16 11:29:04 +02:00
parent adfe6a2bfc
commit 5fb1cf34e2

View File

@@ -829,7 +829,11 @@ public class ReplaySender extends ChannelDuplexHandler {
for (Entity entity : entitiesInChunk) { for (Entity entity : entitiesInChunk) {
// Skip interpolation of position updates coming from server // Skip interpolation of position updates coming from server
// (See: newX in EntityLivingBase or otherPlayerMPX in EntityOtherPlayerMP) // (See: newX in EntityLivingBase or otherPlayerMPX in EntityOtherPlayerMP)
entity.onUpdate(); // Needs to be called at least 4 times thanks to
// EntityOtherPlayerMP#otherPlayerMPPosRotationIncrements (max vanilla value is 3)
for (int i = 0; i < 4; i++) {
entity.onUpdate();
}
// Check whether the entity has left the chunk // Check whether the entity has left the chunk
int chunkX = MathHelper.floor_double(entity.posX / 16); int chunkX = MathHelper.floor_double(entity.posX / 16);