SPIGOT-5484: Add more spawn tick settings

By: Phoenix616 <mail@moep.tv>
This commit is contained in:
Bukkit/Spigot 2020-03-07 18:17:30 +01:00
parent 5fee1ac76f
commit b35aa20f22
3 changed files with 182 additions and 0 deletions

View file

@ -353,6 +353,50 @@ public final class Bukkit {
return server.getTicksPerMonsterSpawns();
}
/**
* Gets the default ticks per water mob spawns value.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn water mobs
* every tick.
* <li>A value of 400 will mean the server will attempt to spawn water mobs
* 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, water mobs spawning will be disabled.
* <p>
* Minecraft default: 1.
*
* @return the default ticks per water mobs spawn value
*/
public static int getTicksPerWaterSpawns() {
return server.getTicksPerWaterSpawns();
}
/**
* Gets the default ticks per ambient mob spawns value.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn ambient mobs
* every tick.
* <li>A value of 400 will mean the server will attempt to spawn ambient mobs
* 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, ambient mobs spawning will be disabled.
* <p>
* Minecraft default: 1.
*
* @return the default ticks per ambient mobs spawn value
*/
public static int getTicksPerAmbientSpawns() {
return server.getTicksPerAmbientSpawns();
}
/**
* Gets a player object by the given username.
* <p>

View file

@ -294,6 +294,46 @@ public interface Server extends PluginMessageRecipient {
*/
public int getTicksPerMonsterSpawns();
/**
* Gets the default ticks per water mob spawns value.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn water mobs
* every tick.
* <li>A value of 400 will mean the server will attempt to spawn water mobs
* 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, water mobs spawning will be disabled.
* <p>
* Minecraft default: 1.
*
* @return the default ticks per water mobs spawn value
*/
public int getTicksPerWaterSpawns();
/**
* Gets the default ticks per ambient mob spawns value.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn ambient mobs
* every tick.
* <li>A value of 400 will mean the server will attempt to spawn ambient mobs
* 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, ambient mobs spawning will be disabled.
* <p>
* Minecraft default: 1.
*
* @return the default ticks per ambient mobs spawn value
*/
public int getTicksPerAmbientSpawns();
/**
* Gets a player object by the given username.
* <p>

View file

@ -1636,6 +1636,104 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns);
/**
* Gets the world's ticks per water mob spawns value
* <p>
* This value determines how many ticks there are between attempts to
* spawn water mobs.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn water mobs in
* this world every tick.
* <li>A value of 400 will mean the server will attempt to spawn water mobs
* 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, water mobs spawning will be disabled for this world.
* <p>
* Minecraft default: 1.
*
* @return The world's ticks per water mob spawns value
*/
public long getTicksPerWaterSpawns();
/**
* Sets the world's ticks per water mob spawns value
* <p>
* This value determines how many ticks there are between attempts to
* spawn water mobs.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn water mobs in
* this world on every tick.
* <li>A value of 400 will mean the server will attempt to spawn water mobs
* 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, water mobs spawning will be disabled for this world.
* <p>
* Minecraft default: 1.
*
* @param ticksPerWaterSpawns the ticks per water mob spawns value you
* want to set the world to
*/
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns);
/**
* Gets the world's ticks per ambient mob spawns value
* <p>
* This value determines how many ticks there are between attempts to
* spawn ambient mobs.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn ambient mobs in
* this world every tick.
* <li>A value of 400 will mean the server will attempt to spawn ambient mobs
* 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, ambient mobs spawning will be disabled for this world.
* <p>
* Minecraft default: 1.
*
* @return The world's ticks per ambient mob spawns value
*/
public long getTicksPerAmbientSpawns();
/**
* Sets the world's ticks per ambient mob spawns value
* <p>
* This value determines how many ticks there are between attempts to
* spawn ambient mobs.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn ambient mobs in
* this world on every tick.
* <li>A value of 400 will mean the server will attempt to spawn ambient mobs
* 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, ambient mobs spawning will be disabled for this world.
* <p>
* Minecraft default: 1.
*
* @param ticksPerAmbientSpawns the ticks per ambient mob spawns value you
* want to set the world to
*/
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns);
/**
* Gets limit for number of monsters that can spawn in a chunk in this
* world