Paper/Spigot-Server-Patches/0266-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch
Mariell Hoversholm 654b792caf Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
a339310c #755: Fix NPE when calling getInventory() for virtual EnderChests
2577f9bf Increase outdated build delay
1dabfdc8 #754: Fix pre-1.16 serialized SkullMeta being broken on 1.16+, losing textures
2020-09-27 11:04:51 -04:00

37 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 15 Aug 2018 01:16:34 -0400
Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index eaa60f89bf57f348a6be287b2478b33ca2320d07..3d18a95c9ce9e2fbe142b522d41045992002f715 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -129,9 +129,16 @@ public class CraftChunk implements Chunk {
@Override
public BlockState[] getTileEntities() {
+ // Paper start
+ return getTileEntities(true);
+ }
+
+ @Override
+ public BlockState[] getTileEntities(boolean useSnapshot) {
if (!isLoaded()) {
getWorld().getChunkAt(x, z); // Transient load for this tick
}
+ // Paper end
int index = 0;
net.minecraft.server.Chunk chunk = getHandle();
@@ -143,7 +150,7 @@ public class CraftChunk implements Chunk {
}
BlockPosition position = (BlockPosition) obj;
- entities[index++] = worldServer.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState();
+ entities[index++] = worldServer.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState(useSnapshot); // Paper
}
return entities;