Paper/Spigot-Server-Patches/0289-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch

36 Zeilen
1.3 KiB
Diff

2019-05-05 04:23:25 +02:00
From 2c4cd6098df36181141f3e499fa650ce14057272 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
2019-05-05 04:23:25 +02:00
index b4fcf25d4..fa078eb0e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
2019-05-05 04:23:25 +02:00
@@ -111,7 +111,12 @@ public class CraftChunk implements Chunk {
return entities;
}
+ // Paper start
public BlockState[] getTileEntities() {
+ return getTileEntities(true);
+ }
+ public BlockState[] getTileEntities(boolean useSnapshot) {
+ // Paper end
int index = 0;
net.minecraft.server.Chunk chunk = getHandle();
2019-05-05 04:23:25 +02:00
@@ -123,7 +128,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;
--
2.21.0