geforkt von Mirrors/Paper
Add World.getPlayerCount
Dieser Commit ist enthalten in:
Ursprung
fe2f82587d
Commit
726b291d90
@ -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/World.java b/src/main/java/org/bukkit/World.java
|
||||
index 56f50296..2b6136fd 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.util.Vector;
|
||||
@ -34,6 +34,11 @@ 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
|
||||
+
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main
|
||||
the same way we handle async chunk loads.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 1c4040760..c678718b7 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 {
|
||||
|
@ -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();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren