Add World.getPlayerCount

This commit is contained in:
Michael Himing 2017-01-13 23:00:33 +11:00
parent e3070b32a7
commit 9606774ee6
3 changed files with 21 additions and 13 deletions

View file

@ -1,4 +1,4 @@
From 20f93fadc1651fc03cbd926370d79d191a3fe1f1 Mon Sep 17 00:00:00 2001
From 47bfe6afa93cf0a7068911d1789256f8f7159f5c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 7 Jan 2017 15:23:03 -0500
Subject: [PATCH] Provide E/TE/Chunk count stat methods
@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 56f50296..2b6136fd 100644
index 56f5029..12146dd 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -24,6 +24,28 @@ import org.bukkit.util.Vector;
@@ -24,6 +24,33 @@ import org.bukkit.util.Vector;
*/
public interface World extends PluginMessageRecipient, Metadatable {
@ -34,11 +34,16 @@ index 56f50296..2b6136fd 100644
+ * @return The amount of Chunks in this world
+ */
+ int getChunkCount();
+
+ /**
+ * @return The amount of Players in this world
+ */
+ int getPlayerCount();
+ // Paper end
+
/**
* Gets the {@link Block} at the given coordinates
*
--
2.11.0
2.9.2.windows.1