2018-08-17 00:11:35 +02:00
|
|
|
From ee27ea20d00895926b5fe61aad162123283de3e4 Mon Sep 17 00:00:00 2001
|
2018-08-16 23:46:38 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Thu, 16 Aug 2018 17:36:41 -0400
|
|
|
|
Subject: [PATCH] Ensure chunks are always loaded on hard position sets
|
|
|
|
|
|
|
|
Player Movement, Entity Creation and Teleportation move
|
|
|
|
entities with a very "You are here, no debate" change, making
|
|
|
|
the server register them as there, regardless if that chunk was
|
|
|
|
loaded or not.
|
|
|
|
|
|
|
|
It appears possible that with hack clients and lag, a player
|
|
|
|
may be able to move fast enough to move into an unloaded
|
|
|
|
chunk and get into a buggy state.
|
|
|
|
|
|
|
|
To prevent this, we will ensure a chunk is always loaded,
|
|
|
|
guaranteeing that the entity will be properly registered
|
|
|
|
into its new home comfortably.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
2018-08-17 00:11:35 +02:00
|
|
|
index ce33cd5b83..41a951d580 100644
|
2018-08-16 23:46:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
2018-08-17 00:11:35 +02:00
|
|
|
@@ -1367,6 +1367,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
2018-08-16 23:46:38 +02:00
|
|
|
this.lastYaw -= 360.0F;
|
|
|
|
}
|
|
|
|
|
2018-08-16 23:52:24 +02:00
|
|
|
+ world.getChunkAt((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4); // Paper - ensure chunk is always loaded
|
2018-08-16 23:46:38 +02:00
|
|
|
this.setPosition(this.locX, this.locY, this.locZ);
|
|
|
|
this.setYawPitch(f, f1);
|
|
|
|
}
|
|
|
|
--
|
|
|
|
2.18.0
|
|
|
|
|