Add World.getPlayerCount
This commit is contained in:
@@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
|
||||
which creates copy of the collections.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 5a44a9f38..1c4040760 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ public class CraftWorld implements World {
|
||||
@@ -32,6 +32,9 @@ index 5a44a9f38..1c4040760 100644
|
||||
+ public int getChunkCount() {
|
||||
+ return world.getChunkProviderServer().chunks.size();
|
||||
+ }
|
||||
+ public int getPlayerCount() {
|
||||
+ return world.players.size();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
private static final Random rand = new Random();
|
||||
|
||||
Reference in New Issue
Block a user