summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-10-31 11:18:06 -0500
committerEvilSeph <evilseph@gmail.com>2012-10-31 13:01:29 -0400
commiteca0b6524fd78aa8ad6c40b9521c55eb5cecfca1 (patch)
tree705d7d12a535e18a336e7467d6ff42d5a9c10c05 /src/main/java
parenta764c850c121950587726112b026c58bac75bf79 (diff)
downloadbukkit-eca0b6524fd78aa8ad6c40b9521c55eb5cecfca1.tar
bukkit-eca0b6524fd78aa8ad6c40b9521c55eb5cecfca1.tar.gz
bukkit-eca0b6524fd78aa8ad6c40b9521c55eb5cecfca1.tar.lz
bukkit-eca0b6524fd78aa8ad6c40b9521c55eb5cecfca1.tar.xz
bukkit-eca0b6524fd78aa8ad6c40b9521c55eb5cecfca1.zip
Add API for ambient mob spawn limit. Adds BUKKIT-2765
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/Bukkit.java4
-rw-r--r--src/main/java/org/bukkit/Server.java8
-rw-r--r--src/main/java/org/bukkit/World.java14
3 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 56f091aa..7e8478ae 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -371,6 +371,10 @@ public final class Bukkit {
return server.getWaterAnimalSpawnLimit();
}
+ public static int getAmbientSpawnLimit() {
+ return server.getAmbientSpawnLimit();
+ }
+
public static boolean isPrimaryThread() {
return server.isPrimaryThread();
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 54cb1d94..881d47f1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -649,6 +649,12 @@ public interface Server extends PluginMessageRecipient {
int getWaterAnimalSpawnLimit();
/**
+ * Gets user-specified limit for number of ambient mobs that can spawn in a chunk
+ * @returns The ambient spawn limit
+ */
+ int getAmbientSpawnLimit();
+
+ /**
* Returns true if the current {@link Thread} is the server's primary thread
*/
boolean isPrimaryThread();
@@ -666,4 +672,4 @@ public interface Server extends PluginMessageRecipient {
* @return The configured WarningState
*/
public WarningState getWarningState();
-} \ No newline at end of file
+}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index de49f4d7..ad6623e9 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -984,6 +984,20 @@ public interface World extends PluginMessageRecipient, Metadatable {
void setWaterAnimalSpawnLimit(int limit);
/**
+ * Gets the limit for number of ambient mobs that can spawn in a chunk in this world
+ * @returns The ambient spawn limit
+ */
+ int getAmbientSpawnLimit();
+
+ /**
+ * Sets the limit for number of ambient mobs that can spawn in a chunk in this world
+ * <p />
+ * <b>Note:</b>
+ * If set to a negative number the world will use the server-wide spawn limit instead.
+ */
+ void setAmbientSpawnLimit(int limit);
+
+ /**
* Play a Sound at the provided Location in the World
* <p />
* This function will fail silently if Location or Sound are null.