3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 23:00:08 +01:00
Paper/nms-patches/PlayerChunk.patch

42 Zeilen
1.6 KiB
Diff

2016-02-29 22:32:46 +01:00
--- a/net/minecraft/server/PlayerChunk.java
+++ b/net/minecraft/server/PlayerChunk.java
2018-07-15 02:00:00 +02:00
@@ -7,21 +7,36 @@
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
2016-02-29 22:32:46 +01:00
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
2016-05-10 13:47:39 +02:00
+// CraftBukkit Start
2016-02-29 22:32:46 +01:00
+import org.bukkit.craftbukkit.chunkio.ChunkIOExecutor;
2016-05-10 13:47:39 +02:00
+// CraftBukkit end
2016-02-29 22:32:46 +01:00
public class PlayerChunk {
private static final Logger a = LogManager.getLogger();
private final PlayerChunkMap playerChunkMap;
- private final List<EntityPlayer> c = Lists.newArrayList();
+ public final List<EntityPlayer> c = Lists.newArrayList(); // CraftBukkit - public
private final ChunkCoordIntPair location;
private final short[] dirtyBlocks = new short[64];
2016-05-10 13:47:39 +02:00
@Nullable
- private Chunk chunk;
+ public Chunk chunk; // CraftBukkit - public
private int dirtyCount;
private int h;
2016-02-29 22:32:46 +01:00
private long i;
private boolean done;
+ // CraftBukkit start - add fields
2018-07-15 02:00:00 +02:00
+ // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse
+ // All may seem good at first, but there's deeper issues if you play for a bit
+ private boolean loadInProgress = false;
2016-02-29 22:32:46 +01:00
+ private Runnable loadedRunnable = new Runnable() {
+ public void run() {
+ loadInProgress = false;
2018-08-26 04:00:00 +02:00
+ PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true);
2016-02-29 22:32:46 +01:00
+ }
+ };
+ // CraftBukkit end
+
public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) {
this.playerChunkMap = playerchunkmap;
this.location = new ChunkCoordIntPair(i, j);