mirror of https://github.com/YatopiaMC/Yatopia.git
37 lines
1.9 KiB
Diff
37 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <spottedleaf@spottedleaf.dev>
|
|
Date: Tue, 9 Jun 2020 14:02:06 -0700
|
|
Subject: [PATCH] Revert getChunkAt(Async) retaining chunks for long periods of
|
|
time
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index 4356d30353cc856c53731e9f10885d74a62027d2..01821015a0737dd770524bf77c8cb46d0ff6562e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -423,14 +423,7 @@ public class CraftWorld implements World {
|
|
|
|
@Override
|
|
public Chunk getChunkAt(int x, int z) {
|
|
- // Paper start - add ticket to hold chunk for a little while longer if plugin accesses it
|
|
- net.minecraft.world.level.chunk.Chunk chunk = world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z);
|
|
- if (chunk == null) {
|
|
- addTicket(x, z);
|
|
- chunk = this.world.getChunkProvider().getChunkAt(x, z, true);
|
|
- }
|
|
- return chunk.bukkitChunk;
|
|
- // Paper end
|
|
+ return this.world.getChunkProvider().getChunkAt(x, z, true).bukkitChunk; // Tuinity - revert paper diff
|
|
}
|
|
|
|
// Paper start
|
|
@@ -2596,7 +2589,7 @@ public class CraftWorld implements World {
|
|
}
|
|
return this.world.getChunkProvider().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> {
|
|
net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null);
|
|
- if (chunk != null) addTicket(x, z); // Paper
|
|
+ if (false && chunk != null) addTicket(x, z); // Paper // Tuinity - revert
|
|
return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk());
|
|
}, net.minecraft.server.MinecraftServer.getServer());
|
|
}
|