Use WorldServer#entitesById for entity iteration

WorldServer#globalEntityList is not the actual list of entities in a world
This commit is contained in:
Spottedleaf
2019-05-07 18:49:41 -07:00
parent 54388d8715
commit c0f92870ab
4 changed files with 11 additions and 24 deletions

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
new file mode 100644
index 0000000000..841edd010f
index 0000000000..b5f318c00d
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
@@ -0,0 +0,0 @@
@@ -185,7 +185,7 @@ index 0000000000..841edd010f
+ }
+ WorldServer world = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle();
+
+ List<Entity> entities = world.globalEntityList;
+ Collection<Entity> entities = world.entitiesById.values();
+ entities.forEach(e -> {
+ MinecraftKey key = new MinecraftKey(""); // TODO: update in next patch
+