2020-08-27 13:37:25 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Ivan Pekov <ivan@mrivanplays.com>
|
|
|
|
Date: Wed, 26 Aug 2020 21:01:33 +0300
|
|
|
|
Subject: [PATCH] Load also the chunk that you're teleporting to
|
|
|
|
|
|
|
|
Fixes Tuinity-178
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2020-10-08 13:04:22 +02:00
|
|
|
index 97db7999968bceb2f069eb449c64e7da874d787f..fc8d97262f39db62e1ea2cdd1d9c1df092175c63 100644
|
2020-08-27 13:37:25 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
2020-10-08 13:04:22 +02:00
|
|
|
@@ -232,7 +232,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
2020-08-27 13:37:25 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
- public final void loadChunksForMoveAsync(AxisAlignedBB axisalignedbb, double toX, double toZ,
|
|
|
|
+ public final void loadChunksForMoveAsync(AxisAlignedBB axisalignedbb, int toX, int toZ, // Yatopia
|
|
|
|
java.util.function.Consumer<List<IChunkAccess>> onLoad) {
|
|
|
|
if (Thread.currentThread() != this.serverThread) {
|
|
|
|
this.getChunkProvider().serverThreadQueue.execute(() -> {
|
2020-10-08 13:04:22 +02:00
|
|
|
@@ -289,6 +289,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
2020-08-27 13:37:25 +02:00
|
|
|
chunkProvider.getChunkAtAsynchronously(cx, cz, ChunkStatus.FULL, true, false, consumer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ chunkProvider.getChunkAtAsynchronously(toX >> 4, toZ >> 4, ChunkStatus.FULL, true, false, consumer); // Yatopia
|
|
|
|
}
|
|
|
|
// Tuinity end
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2020-10-04 11:00:34 +02:00
|
|
|
index 704d0000011668ecd9d048f35298658f2978d0f3..67e98634885a917f93c0c1accf2378f8efb608b6 100644
|
2020-08-27 13:37:25 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
@@ -545,7 +545,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|
|
|
net.minecraft.server.WorldServer world = ((CraftWorld)locationClone.getWorld()).getHandle();
|
|
|
|
java.util.concurrent.CompletableFuture<Boolean> ret = new java.util.concurrent.CompletableFuture<>();
|
|
|
|
|
|
|
|
- world.loadChunksForMoveAsync(getHandle().getBoundingBoxAt(locationClone.getX(), locationClone.getY(), locationClone.getZ()), location.getX(), location.getZ(), (list) -> {
|
|
|
|
+ world.loadChunksForMoveAsync(getHandle().getBoundingBoxAt(locationClone.getX(), locationClone.getY(), locationClone.getZ()), location.getBlockX(), location.getBlockZ(), (list) -> { // Yatopia
|
|
|
|
net.minecraft.server.ChunkProviderServer chunkProviderServer = world.getChunkProvider();
|
|
|
|
for (net.minecraft.server.IChunkAccess chunk : list) {
|
|
|
|
chunkProviderServer.addTicketAtLevel(net.minecraft.server.TicketType.POST_TELEPORT, chunk.getPos(), 33, CraftEntity.this.getEntityId());
|