7e06f2145e
Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections.
29 lines
883 B
Diff
29 lines
883 B
Diff
From 604dc8e444593ab84281c94ca4eb334164c96ea8 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
|
|
|
|
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..63cdcdb8 100644
|
|
--- a/src/main/java/org/bukkit/World.java
|
|
+++ b/src/main/java/org/bukkit/World.java
|
|
@@ -24,6 +24,13 @@ import org.bukkit.util.Vector;
|
|
*/
|
|
public interface World extends PluginMessageRecipient, Metadatable {
|
|
|
|
+ // Paper start
|
|
+ int getEntityCount();
|
|
+ int getTileEntityCount();
|
|
+ int getTickableTileEntityCount();
|
|
+ int getChunkCount();
|
|
+ // Paper end
|
|
+
|
|
/**
|
|
* Gets the {@link Block} at the given coordinates
|
|
*
|
|
--
|
|
2.11.0
|
|
|