aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0710-More-Teleport-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0710-More-Teleport-API.patch')
-rw-r--r--patches/server/0710-More-Teleport-API.patch8
1 files changed, 6 insertions, 2 deletions
diff --git a/patches/server/0710-More-Teleport-API.patch b/patches/server/0710-More-Teleport-API.patch
index 567bd06573..8aa4c173f9 100644
--- a/patches/server/0710-More-Teleport-API.patch
+++ b/patches/server/0710-More-Teleport-API.patch
@@ -30,7 +30,7 @@ index 864ab4d3de50ee9ce9ff2b0538aa46df43985a84..90eedcb1013226cd4dbbbaf4ff9332a8
positionmoverotation = new PositionMoveRotation(CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch());
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
-index 10fb64df10820974d11f142c102a11a5bd0f317c..2335a3501399ea37d2fab2e5267712d7d174041b 100644
+index 10fb64df10820974d11f142c102a11a5bd0f317c..ea62e2725152008e87961cedd837fa0d03787d03 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -222,15 +222,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -72,7 +72,7 @@ index 10fb64df10820974d11f142c102a11a5bd0f317c..2335a3501399ea37d2fab2e5267712d7
// Let the server handle cross world teleports
if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) {
-@@ -971,6 +992,35 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+@@ -971,6 +992,39 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return CraftEntity.perm;
}
@@ -89,6 +89,10 @@ index 10fb64df10820974d11f142c102a11a5bd0f317c..2335a3501399ea37d2fab2e5267712d7
+ world.loadChunksForMoveAsync(getHandle().getBoundingBoxAt(locationClone.getX(), locationClone.getY(), locationClone.getZ()),
+ this instanceof CraftPlayer ? ca.spottedleaf.concurrentutil.util.Priority.HIGHER : ca.spottedleaf.concurrentutil.util.Priority.NORMAL, (list) -> {
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
++ final net.minecraft.server.level.ServerChunkCache chunkCache = world.getChunkSource();
++ for (final net.minecraft.world.level.chunk.ChunkAccess chunk : list) {
++ chunkCache.addTicketAtLevel(net.minecraft.server.level.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId());
++ }
+ try {
+ ret.complete(CraftEntity.this.teleport(locationClone, cause, teleportFlags) ? Boolean.TRUE : Boolean.FALSE);
+ } catch (Throwable throwable) {