Add API for managing mob spawn limits per-world. Fixes BUKKIT-1565
This commit is contained in:
parent
1fd825cb7b
commit
78f7c8038d
@ -353,4 +353,16 @@ public final class Bukkit {
|
|||||||
public static HelpMap getHelpMap() {
|
public static HelpMap getHelpMap() {
|
||||||
return server.getHelpMap();
|
return server.getHelpMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getMonsterSpawnLimit() {
|
||||||
|
return server.getMonsterSpawnLimit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getAnimalSpawnLimit() {
|
||||||
|
return server.getAnimalSpawnLimit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getWaterAnimalSpawnLimit() {
|
||||||
|
return server.getWaterAnimalSpawnLimit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -621,4 +621,22 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
* @throws IllegalArgumentException If the size is not a multiple of 9.
|
* @throws IllegalArgumentException If the size is not a multiple of 9.
|
||||||
*/
|
*/
|
||||||
Inventory createInventory(InventoryHolder owner, int size, String title);
|
Inventory createInventory(InventoryHolder owner, int size, String title);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets user-specified limit for number of monsters that can spawn in a chunk
|
||||||
|
* @returns The monster spawn limit
|
||||||
|
*/
|
||||||
|
int getMonsterSpawnLimit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets user-specified limit for number of animals that can spawn in a chunk
|
||||||
|
* @returns The animal spawn limit
|
||||||
|
*/
|
||||||
|
int getAnimalSpawnLimit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets user-specified limit for number of water animals that can spawn in a chunk
|
||||||
|
* @returns The water animal spawn limit
|
||||||
|
*/
|
||||||
|
int getWaterAnimalSpawnLimit();
|
||||||
}
|
}
|
@ -895,6 +895,48 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
|||||||
*/
|
*/
|
||||||
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns);
|
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets limit for number of monsters that can spawn in a chunk in this world
|
||||||
|
* @returns The monster spawn limit
|
||||||
|
*/
|
||||||
|
int getMonsterSpawnLimit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the limit for number of monsters 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 setMonsterSpawnLimit(int limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the limit for number of animals that can spawn in a chunk in this world
|
||||||
|
* @returns The animal spawn limit
|
||||||
|
*/
|
||||||
|
int getAnimalSpawnLimit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the limit for number of animals 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 setAnimalSpawnLimit(int limit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the limit for number of water animals that can spawn in a chunk in this world
|
||||||
|
* @returns The water animal spawn limit
|
||||||
|
*/
|
||||||
|
int getWaterAnimalSpawnLimit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the limit for number of water animals 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 setWaterAnimalSpawnLimit(int limit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents various map environment types that a world may be
|
* Represents various map environment types that a world may be
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user