summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2012-02-10 10:23:21 -0500
committerEvilSeph <evilseph@gmail.com>2012-02-10 12:52:41 -0500
commitec01da91bbba8d4a1d928df6273389923491e75e (patch)
treea3c1c5e814eb1428b790d1a82c7965c285d6f6f0
parent5c7edcf4393ba0acdeb295f169e362fb1f7b2652 (diff)
downloadbukkit-ec01da91bbba8d4a1d928df6273389923491e75e.tar
bukkit-ec01da91bbba8d4a1d928df6273389923491e75e.tar.gz
bukkit-ec01da91bbba8d4a1d928df6273389923491e75e.tar.lz
bukkit-ec01da91bbba8d4a1d928df6273389923491e75e.tar.xz
bukkit-ec01da91bbba8d4a1d928df6273389923491e75e.zip
Added configurable animal and monster ticks per spawn setting.
-rw-r--r--src/main/java/org/bukkit/Server.java38
-rw-r--r--src/main/java/org/bukkit/World.java84
2 files changed, 122 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 0eca908e..f271e00e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -182,6 +182,44 @@ public interface Server extends PluginMessageRecipient {
public File getUpdateFolderFile();
/**
+ * Gets default ticks per animal spawns value
+ * <p />
+ * <b>Example Usage:</b>
+ * <ul>
+ * <li>A value of 1 will mean the server will attempt to spawn monsters every tick.
+ * <li>A value of 400 will mean the server will attempt to spawn monsters every 400th tick.
+ * <li>A value below 0 will be reset back to Minecraft's default.
+ * </ul>
+ * <p />
+ * <b>Note:</b>
+ * If set to 0, animal spawning will be disabled. We recommend using spawn-animals to control this instead.
+ * <p />
+ * Minecraft default: 400.
+ *
+ * @return The default ticks per animal spawns value
+ */
+ public int getTicksPerAnimalSpawns();
+
+ /**
+ * Gets the default ticks per monster spawns value
+ * <p />
+ * <b>Example Usage:</b>
+ * <ul>
+ * <li>A value of 1 will mean the server will attempt to spawn monsters every tick.
+ * <li>A value of 400 will mean the server will attempt to spawn monsters every 400th tick.
+ * <li>A value below 0 will be reset back to Minecraft's default.
+ * </ul>
+ * <p />
+ * <b>Note:</b>
+ * If set to 0, monsters spawning will be disabled. We recommend using spawn-monsters to control this instead.
+ * <p />
+ * Minecraft default: 1.
+ *
+ * @return The default ticks per monsters spawn value
+ */
+ public int getTicksPerMonsterSpawns();
+
+ /**
* Gets a player object by the given username
* <p />
* This method may not return objects for offline players
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 368a5e4f..d4acd762 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -769,6 +769,90 @@ public interface World extends PluginMessageRecipient {
public boolean canGenerateStructures();
/**
+ * Gets the world's ticks per animal spawns value
+ * <p />
+ * This value determines how many ticks there are between attempts to spawn animals.
+ * <p />
+ * <b>Example Usage:</b>
+ * <ul>
+ * <li>A value of 1 will mean the server will attempt to spawn animals in this world every tick.
+ * <li>A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick.
+ * <li>A value below 0 will be reset back to Minecraft's default.
+ * </ul>
+ * <p />
+ * <b>Note:</b>
+ * If set to 0, animal spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead.
+ * <p />
+ * Minecraft default: 400.
+ *
+ * @return The world's ticks per animal spawns value
+ */
+ public long getTicksPerAnimalSpawns();
+
+ /**
+ * Sets the world's ticks per animal spawns value
+ * <p />
+ * This value determines how many ticks there are between attempts to spawn animals.
+ * <p />
+ * <b>Example Usage:</b>
+ * <ul>
+ * <li>A value of 1 will mean the server will attempt to spawn animals in this world every tick.
+ * <li>A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick.
+ * <li>A value below 0 will be reset back to Minecraft's default.
+ * </ul>
+ * <p />
+ * <b>Note:</b>
+ * If set to 0, animal spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead.
+ * <p />
+ * Minecraft default: 400.
+ *
+ * @param ticksPerAnimalSpawns the ticks per animal spawns value you want to set the world to
+ */
+ public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns);
+
+ /**
+ * Gets the world's ticks per monster spawns value
+ * <p />
+ * This value determines how many ticks there are between attempts to spawn monsters.
+ * <p />
+ * <b>Example Usage:</b>
+ * <ul>
+ * <li>A value of 1 will mean the server will attempt to spawn monsters in this world every tick.
+ * <li>A value of 400 will mean the server will attempt to spawn monsters in this world every 400th tick.
+ * <li>A value below 0 will be reset back to Minecraft's default.
+ * </ul>
+ * <p />
+ * <b>Note:</b>
+ * If set to 0, monsters spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead.
+ * <p />
+ * Minecraft default: 1.
+ *
+ * @return The world's ticks per monster spawns value
+ */
+ public long getTicksPerMonsterSpawns();
+
+ /**
+ * Sets the world's ticks per monster spawns value
+ * <p />
+ * This value determines how many ticks there are between attempts to spawn monsters.
+ * <p />
+ * <b>Example Usage:</b>
+ * <ul>
+ * <li>A value of 1 will mean the server will attempt to spawn monsters in this world on every tick.
+ * <li>A value of 400 will mean the server will attempt to spawn monsters in this world every 400th tick.
+ * <li>A value below 0 will be reset back to Minecraft's default.
+ * </ul>
+ * <p />
+ * <b>Note:</b>
+ * If set to 0, monsters spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead.
+ * <p />
+ * Minecraft default: 1.
+ *
+ * @param ticksPerMonsterSpawns the ticks per monster spawns value you want to set the world to
+ */
+ public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns);
+
+ /**
* Represents various map environment types that a world may be
*/
public enum Environment {