mirror of
https://github.com/kaboomserver/extras.git
synced 2025-02-11 11:40:19 +00:00
Add option to configure entity cap per chunk (closes #311)
This commit is contained in:
parent
d2ee02ba6e
commit
c3a674f8fd
2 changed files with 7 additions and 1 deletions
|
@ -90,7 +90,11 @@ public final class EntitySpawn implements Listener {
|
|||
default:
|
||||
if (!EntityType.PLAYER.equals(entityType)) {
|
||||
final int chunkEntityCount = chunk.getEntities().length;
|
||||
final int chunkEntityCountLimit = 30;
|
||||
final int chunkEntityCountLimit = PLUGIN.getConfig().getInt("maxEntitiesPerChunk");
|
||||
if(chunkEntityCount == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (chunkEntityCount >= chunkEntityCountLimit) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ enableKick: false
|
|||
enableJoinRestrictions: false
|
||||
opOnJoin: true
|
||||
randomizeSpawn: false
|
||||
# Set to -1 to disable
|
||||
maxEntitiesPerChunk: 30
|
||||
playerJoinTitle: "§7Welcome to Kaboom!"
|
||||
playerJoinSubtitle: "Free OP • Anarchy • Creative"
|
||||
opTag: "§4§l[§c§lOP§4§l] §c"
|
||||
|
|
Loading…
Reference in a new issue