Added ability to disable mob spawning inside of arenas.

This commit is contained in:
2022-06-04 14:26:52 -04:00
parent 4c9a5b2282
commit cd569b9914
5 changed files with 55 additions and 2 deletions

View File

@@ -404,6 +404,25 @@ public final class CommandHandler {
this.snowbrawl.saveConfig();
}
@Command(hook = "set_arena_mobspawningallowed")
public void commandArenasMobSpawningAllowed(CommandSender sender, String name, boolean mobSpawningAllowed){
Arena arena = this.snowbrawl.getArenaManager().getArenaByName(name);
if (arena == null){
sender.sendMessage(failMessage("The specified arena does not exist."));
return;
}
arena.setMobSpawningAllowed(mobSpawningAllowed);
if (mobSpawningAllowed){
sender.sendMessage(successMessage("Mob spawning is now allowed in arena " + arena.getName() + "."));
} else {
sender.sendMessage(successMessage("Mob spawning is now blocked in arena " + arena.getName() + "."));
}
this.snowbrawl.saveConfig();
}
/**
* Sets one corner of this arena's bounds to the given coordinates.
*