mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-29 19:51:30 +01:00
SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
7c667b37d9
commit
dd8840cd02
@ -27,6 +27,7 @@ import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.SpawnCategory;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
@ -412,7 +413,9 @@ public final class Bukkit {
|
||||
* Minecraft default: 400.
|
||||
*
|
||||
* @return the default ticks per animal spawns value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getTicksPerAnimalSpawns() {
|
||||
return server.getTicksPerAnimalSpawns();
|
||||
}
|
||||
@ -435,7 +438,9 @@ public final class Bukkit {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per monsters spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getTicksPerMonsterSpawns() {
|
||||
return server.getTicksPerMonsterSpawns();
|
||||
}
|
||||
@ -457,7 +462,9 @@ public final class Bukkit {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getTicksPerWaterSpawns() {
|
||||
return server.getTicksPerWaterSpawns();
|
||||
}
|
||||
@ -479,7 +486,9 @@ public final class Bukkit {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per ambient mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getTicksPerAmbientSpawns() {
|
||||
return server.getTicksPerAmbientSpawns();
|
||||
}
|
||||
@ -501,10 +510,13 @@ public final class Bukkit {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water ambient mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getTicksPerWaterAmbientSpawns() {
|
||||
return server.getTicksPerAmbientSpawns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default ticks per water underground creature spawns value.
|
||||
* <p>
|
||||
@ -522,11 +534,38 @@ public final class Bukkit {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water underground creature spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getTicksPerWaterUndergroundCreatureSpawns() {
|
||||
return server.getTicksPerWaterUndergroundCreatureSpawns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default ticks per {@link SpawnCategory} spawns value.
|
||||
* <p>
|
||||
* <b>Example Usage:</b>
|
||||
* <ul>
|
||||
* <li>A value of 1 will mean the server will attempt to spawn {@link SpawnCategory} mobs
|
||||
* every tick.
|
||||
* <li>A value of 400 will mean the server will attempt to spawn {@link SpawnCategory} 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, {@link SpawnCategory} mobs spawning will be disabled.
|
||||
* <p>
|
||||
* Minecraft default: 1.
|
||||
* <br>
|
||||
* <b>Note: </b> the {@link SpawnCategory#MISC} are not consider.
|
||||
*
|
||||
* @param spawnCategory the category of spawn
|
||||
* @return the default ticks per {@link SpawnCategory} mobs spawn value
|
||||
*/
|
||||
public static int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory) {
|
||||
return server.getTicksPerSpawns(spawnCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a player object by the given username.
|
||||
* <p>
|
||||
@ -1322,7 +1361,9 @@ public final class Bukkit {
|
||||
* chunk.
|
||||
*
|
||||
* @return the monster spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getMonsterSpawnLimit() {
|
||||
return server.getMonsterSpawnLimit();
|
||||
}
|
||||
@ -1332,7 +1373,9 @@ public final class Bukkit {
|
||||
* chunk.
|
||||
*
|
||||
* @return the animal spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getAnimalSpawnLimit() {
|
||||
return server.getAnimalSpawnLimit();
|
||||
}
|
||||
@ -1342,7 +1385,9 @@ public final class Bukkit {
|
||||
* a chunk.
|
||||
*
|
||||
* @return the water animal spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getWaterAnimalSpawnLimit() {
|
||||
return server.getWaterAnimalSpawnLimit();
|
||||
}
|
||||
@ -1352,7 +1397,9 @@ public final class Bukkit {
|
||||
* in a chunk.
|
||||
*
|
||||
* @return the water ambient spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getWaterAmbientSpawnLimit() {
|
||||
return server.getAmbientSpawnLimit();
|
||||
}
|
||||
@ -1360,8 +1407,11 @@ public final class Bukkit {
|
||||
/**
|
||||
* Get user-specified limit for number of water creature underground that can spawn
|
||||
* in a chunk.
|
||||
*
|
||||
* @return the water underground creature limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getWaterUndergroundCreatureSpawnLimit() {
|
||||
return server.getWaterUndergroundCreatureSpawnLimit();
|
||||
}
|
||||
@ -1371,11 +1421,26 @@ public final class Bukkit {
|
||||
* a chunk.
|
||||
*
|
||||
* @return the ambient spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getAmbientSpawnLimit() {
|
||||
return server.getAmbientSpawnLimit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets user-specified limit for number of {@link SpawnCategory} mobs that can spawn in
|
||||
* a chunk.
|
||||
*
|
||||
* <b>Note: the {@link SpawnCategory#MISC} are not consider.</b>
|
||||
*
|
||||
* @param spawnCategory the category spawn
|
||||
* @return the {@link SpawnCategory} spawn limit
|
||||
*/
|
||||
public static int getSpawnLimit(@NotNull SpawnCategory spawnCategory) {
|
||||
return server.getSpawnLimit(spawnCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the current thread against the expected primary thread for the
|
||||
* server.
|
||||
|
@ -27,6 +27,7 @@ import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.SpawnCategory;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.server.ServerListPingEvent;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
@ -341,7 +342,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Minecraft default: 400.
|
||||
*
|
||||
* @return the default ticks per animal spawns value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getTicksPerAnimalSpawns();
|
||||
|
||||
/**
|
||||
@ -362,7 +365,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per monsters spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getTicksPerMonsterSpawns();
|
||||
|
||||
/**
|
||||
@ -382,7 +387,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getTicksPerWaterSpawns();
|
||||
|
||||
/**
|
||||
@ -402,7 +409,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water ambient mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getTicksPerWaterAmbientSpawns();
|
||||
|
||||
/**
|
||||
@ -422,7 +431,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water underground creature spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getTicksPerWaterUndergroundCreatureSpawns();
|
||||
|
||||
/**
|
||||
@ -442,9 +453,34 @@ public interface Server extends PluginMessageRecipient {
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per ambient mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public int getTicksPerAmbientSpawns();
|
||||
|
||||
/**
|
||||
* Gets the default ticks per {@link SpawnCategory} spawns value.
|
||||
* <p>
|
||||
* <b>Example Usage:</b>
|
||||
* <ul>
|
||||
* <li>A value of 1 will mean the server will attempt to spawn {@link SpawnCategory} mobs
|
||||
* every tick.
|
||||
* <li>A value of 400 will mean the server will attempt to spawn {@link SpawnCategory} 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, {@link SpawnCategory} mobs spawning will be disabled.
|
||||
* <p>
|
||||
* Minecraft default: 1.
|
||||
* <br>
|
||||
* <b>Note: </b> the {@link SpawnCategory#MISC} are not consider.
|
||||
*
|
||||
* @param spawnCategory the category of spawn
|
||||
* @return the default ticks per {@link SpawnCategory} mobs spawn value
|
||||
*/
|
||||
public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory);
|
||||
|
||||
/**
|
||||
* Gets a player object by the given username.
|
||||
* <p>
|
||||
@ -1112,7 +1148,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* chunk.
|
||||
*
|
||||
* @return the monster spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getMonsterSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1120,7 +1158,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* chunk.
|
||||
*
|
||||
* @return the animal spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getAnimalSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1128,7 +1168,9 @@ public interface Server extends PluginMessageRecipient {
|
||||
* a chunk.
|
||||
*
|
||||
* @return the water animal spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getWaterAnimalSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1136,14 +1178,18 @@ public interface Server extends PluginMessageRecipient {
|
||||
* in a chunk.
|
||||
*
|
||||
* @return the water ambient spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getWaterAmbientSpawnLimit();
|
||||
|
||||
/**
|
||||
* Get user-specified limit for number of water creature underground that can spawn
|
||||
* in a chunk.
|
||||
* @return the water underground creature limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getWaterUndergroundCreatureSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1151,9 +1197,22 @@ public interface Server extends PluginMessageRecipient {
|
||||
* a chunk.
|
||||
*
|
||||
* @return the ambient spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getAmbientSpawnLimit();
|
||||
|
||||
/**
|
||||
* Gets user-specified limit for number of {@link SpawnCategory} mobs that can spawn in
|
||||
* a chunk.
|
||||
*
|
||||
* <b>Note: the {@link SpawnCategory#MISC} are not consider.</b>
|
||||
*
|
||||
* @param spawnCategory the category spawn
|
||||
* @return the {@link SpawnCategory} spawn limit
|
||||
*/
|
||||
int getSpawnLimit(@NotNull SpawnCategory spawnCategory);
|
||||
|
||||
/**
|
||||
* Checks the current thread against the expected primary thread for the
|
||||
* server.
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LightningStrike;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.SpawnCategory;
|
||||
import org.bukkit.generator.BiomeProvider;
|
||||
import org.bukkit.generator.BlockPopulator;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
@ -1628,7 +1629,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* Minecraft default: 400.
|
||||
*
|
||||
* @return The world's ticks per animal spawns value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTicksPerAnimalSpawns();
|
||||
|
||||
/**
|
||||
@ -1655,7 +1658,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param ticksPerAnimalSpawns the ticks per animal spawns value you want
|
||||
* to set the world to
|
||||
* @deprecated Deprecated in favor of {@link #setTicksPerSpawns(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns);
|
||||
|
||||
/**
|
||||
@ -1681,7 +1686,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return The world's ticks per monster spawns value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTicksPerMonsterSpawns();
|
||||
|
||||
/**
|
||||
@ -1708,7 +1715,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param ticksPerMonsterSpawns the ticks per monster spawns value you
|
||||
* want to set the world to
|
||||
* @deprecated Deprecated in favor of {@link #setTicksPerSpawns(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns);
|
||||
|
||||
/**
|
||||
@ -1732,7 +1741,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return The world's ticks per water mob spawns value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTicksPerWaterSpawns();
|
||||
|
||||
/**
|
||||
@ -1757,7 +1768,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param ticksPerWaterSpawns the ticks per water mob spawns value you
|
||||
* want to set the world to
|
||||
* @deprecated Deprecated in favor of {@link #setTicksPerSpawns(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns);
|
||||
|
||||
/**
|
||||
@ -1777,7 +1790,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water ambient mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTicksPerWaterAmbientSpawns();
|
||||
|
||||
/**
|
||||
@ -1802,7 +1817,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param ticksPerAmbientSpawns the ticks per water ambient mob spawns value you
|
||||
* want to set the world to
|
||||
* @deprecated Deprecated in favor of {@link #setTicksPerSpawns(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns);
|
||||
|
||||
/**
|
||||
@ -1822,7 +1839,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return the default ticks per water underground creature spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTicksPerWaterUndergroundCreatureSpawns();
|
||||
|
||||
/**
|
||||
@ -1847,7 +1866,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param ticksPerWaterUndergroundCreatureSpawns the ticks per water underground creature spawns value you
|
||||
* want to set the world to
|
||||
* @deprecated Deprecated in favor of {@link #setTicksPerSpawns(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns);
|
||||
|
||||
/**
|
||||
@ -1870,8 +1891,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* <p>
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @return The world's ticks per ambient mob spawns value
|
||||
* @return the default ticks per ambient mobs spawn value
|
||||
* @deprecated Deprecated in favor of {@link #getTicksPerSpawns(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
public long getTicksPerAmbientSpawns();
|
||||
|
||||
/**
|
||||
@ -1896,15 +1919,70 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
*
|
||||
* @param ticksPerAmbientSpawns the ticks per ambient mob spawns value you
|
||||
* want to set the world to
|
||||
* @deprecated Deprecated in favor of {@link #setTicksPerSpawns(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns);
|
||||
|
||||
/**
|
||||
* Gets the world's ticks per {@link SpawnCategory} mob spawns value
|
||||
* <p>
|
||||
* This value determines how many ticks there are between attempts to
|
||||
* spawn {@link SpawnCategory} mobs.
|
||||
* <p>
|
||||
* <b>Example Usage:</b>
|
||||
* <ul>
|
||||
* <li>A value of 1 will mean the server will attempt to spawn {@link SpawnCategory} mobs in
|
||||
* this world every tick.
|
||||
* <li>A value of 400 will mean the server will attempt to spawn {@link SpawnCategory} 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, {@link SpawnCategory} mobs spawning will be disabled for this world.
|
||||
* <p>
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @param spawnCategory the category spawn
|
||||
* @return The world's ticks per {@link SpawnCategory} mob spawns value
|
||||
*/
|
||||
public long getTicksPerSpawns(@NotNull SpawnCategory spawnCategory);
|
||||
|
||||
/**
|
||||
* Sets the world's ticks per {@link SpawnCategory} mob spawns value
|
||||
* <p>
|
||||
* This value determines how many ticks there are between attempts to
|
||||
* spawn {@link SpawnCategory} mobs.
|
||||
* <p>
|
||||
* <b>Example Usage:</b>
|
||||
* <ul>
|
||||
* <li>A value of 1 will mean the server will attempt to spawn {@link SpawnCategory} mobs in
|
||||
* this world on every tick.
|
||||
* <li>A value of 400 will mean the server will attempt to spawn {@link SpawnCategory} 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, {@link SpawnCategory} mobs spawning will be disabled for this world.
|
||||
* <p>
|
||||
* Minecraft default: 1.
|
||||
*
|
||||
* @param spawnCategory the category spawn
|
||||
* @param ticksPerCategorySpawn the ticks per {@link SpawnCategory} mob spawns value you
|
||||
* want to set the world to
|
||||
*/
|
||||
public void setTicksPerSpawns(@NotNull SpawnCategory spawnCategory, int ticksPerCategorySpawn);
|
||||
|
||||
/**
|
||||
* Gets limit for number of monsters that can spawn in a chunk in this
|
||||
* world
|
||||
*
|
||||
* @return The monster spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getMonsterSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1915,7 +1993,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* server-wide spawn limit instead.
|
||||
*
|
||||
* @param limit the new mob limit
|
||||
* @deprecated Deprecated in favor of {@link #setSpawnLimit(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setMonsterSpawnLimit(int limit);
|
||||
|
||||
/**
|
||||
@ -1923,7 +2003,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* world
|
||||
*
|
||||
* @return The animal spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getAnimalSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1934,7 +2016,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* server-wide spawn limit instead.
|
||||
*
|
||||
* @param limit the new mob limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setAnimalSpawnLimit(int limit);
|
||||
|
||||
/**
|
||||
@ -1942,7 +2026,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* this world
|
||||
*
|
||||
* @return The water animal spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getWaterAnimalSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1953,7 +2039,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* server-wide spawn limit instead.
|
||||
*
|
||||
* @param limit the new mob limit
|
||||
* @deprecated Deprecated in favor of {@link #setSpawnLimit(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setWaterAnimalSpawnLimit(int limit);
|
||||
|
||||
/**
|
||||
@ -1961,7 +2049,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* this world
|
||||
*
|
||||
* @return The water underground creature spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getWaterUndergroundCreatureSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1972,7 +2062,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* server-wide spawn limit instead.
|
||||
*
|
||||
* @param limit the new mob limit
|
||||
* @deprecated Deprecated in favor of {@link #setSpawnLimit(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setWaterUndergroundCreatureSpawnLimit(int limit);
|
||||
|
||||
/**
|
||||
@ -1980,7 +2072,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* in a chunk.
|
||||
*
|
||||
* @return the water ambient spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getWaterAmbientSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -1991,7 +2085,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* server-wide spawn limit instead.
|
||||
*
|
||||
* @param limit the new mob limit
|
||||
* @deprecated Deprecated in favor of {@link #setSpawnLimit(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setWaterAmbientSpawnLimit(int limit);
|
||||
|
||||
/**
|
||||
@ -1999,7 +2095,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* this world
|
||||
*
|
||||
* @return The ambient spawn limit
|
||||
* @deprecated Deprecated in favor of {@link #getSpawnLimit(SpawnCategory)}
|
||||
*/
|
||||
@Deprecated
|
||||
int getAmbientSpawnLimit();
|
||||
|
||||
/**
|
||||
@ -2010,9 +2108,32 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
* server-wide spawn limit instead.
|
||||
*
|
||||
* @param limit the new mob limit
|
||||
* @deprecated Deprecated in favor of {@link #setSpawnLimit(SpawnCategory, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
void setAmbientSpawnLimit(int limit);
|
||||
|
||||
/**
|
||||
* Gets the limit for number of {@link SpawnCategory} entities that can spawn in a chunk in
|
||||
* this world
|
||||
*
|
||||
* @param spawnCategory the entity category
|
||||
* @return The ambient spawn limit
|
||||
*/
|
||||
int getSpawnLimit(@NotNull SpawnCategory spawnCategory);
|
||||
|
||||
/**
|
||||
* Sets the limit for number of {@link SpawnCategory} entities 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.
|
||||
*
|
||||
* @param spawnCategory the entity category
|
||||
* @param limit the new mob limit
|
||||
*/
|
||||
void setSpawnLimit(@NotNull SpawnCategory spawnCategory, int limit);
|
||||
|
||||
/**
|
||||
* Play a Sound at the provided Location in the World.
|
||||
* <p>
|
||||
|
@ -638,4 +638,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
@NotNull
|
||||
Pose getPose();
|
||||
|
||||
/**
|
||||
* Get the category of spawn to which this entity belongs.
|
||||
*
|
||||
* @return the entity´s category spawn
|
||||
*/
|
||||
@NotNull
|
||||
SpawnCategory getSpawnCategory();
|
||||
}
|
||||
|
43
paper-api/src/main/java/org/bukkit/entity/SpawnCategory.java
Normal file
43
paper-api/src/main/java/org/bukkit/entity/SpawnCategory.java
Normal file
@ -0,0 +1,43 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents groups of entities with shared spawn behaviors and mob caps.
|
||||
*
|
||||
* @see <a href="https://minecraft.fandom.com/wiki/Spawn#Java_Edition_mob_cap">Minecraft Wiki</a>
|
||||
*/
|
||||
public enum SpawnCategory {
|
||||
|
||||
/**
|
||||
* Entities related to Monsters, eg: Witch, Zombie, Creeper, etc.
|
||||
*/
|
||||
MONSTER,
|
||||
/**
|
||||
* Entities related to Animals, eg: Strider, Cow, Turtle, etc.
|
||||
*/
|
||||
ANIMAL,
|
||||
/**
|
||||
* Entities related to Water Animals, eg: Squid or Dolphin.
|
||||
*/
|
||||
WATER_ANIMAL,
|
||||
/**
|
||||
* Entities related to Water Ambient, eg: Cod, PufferFish, Tropical Fish,
|
||||
* Salmon, etc.
|
||||
*/
|
||||
WATER_AMBIENT,
|
||||
/**
|
||||
* Entities related to Water Underground, eg: Glow Squid.
|
||||
*/
|
||||
WATER_UNDERGROUND_CREATURE,
|
||||
/**
|
||||
* Entities related to Ambient, eg: Bat.
|
||||
*/
|
||||
AMBIENT,
|
||||
/**
|
||||
* All the Axolotl are represented by this Category.
|
||||
*/
|
||||
AXOLOTL,
|
||||
/**
|
||||
* Entities not related to a mob, eg: Player, ArmorStand, Boat, etc.
|
||||
*/
|
||||
MISC;
|
||||
}
|
Loading…
Reference in New Issue
Block a user