2019-01-01 04:15:55 +01:00
|
|
|
From ab4cd2964cc5a3c0306769a25d35d0310859ba1a Mon Sep 17 00:00:00 2001
|
2018-08-15 07:20:40 +02:00
|
|
|
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-01-01 04:15:55 +01:00
|
|
|
index e65768499..9ba2fa5de 100644
|
2018-08-15 07:20:40 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
|
2018-08-28 23:49:36 +02:00
|
|
|
@@ -99,7 +99,12 @@ public class CraftChunk implements Chunk {
|
2018-08-15 07:20:40 +02:00
|
|
|
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();
|
|
|
|
|
2018-08-28 23:49:36 +02:00
|
|
|
@@ -111,7 +116,7 @@ public class CraftChunk implements Chunk {
|
2018-08-15 07:20:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
--
|
2019-01-01 04:15:55 +01:00
|
|
|
2.20.1
|
2018-08-15 07:20:40 +02:00
|
|
|
|