diff --git a/src/main/java/pw/kaboom/extras/commands/CommandDestroyEntities.java b/src/main/java/pw/kaboom/extras/commands/CommandDestroyEntities.java index 7a80e74..9a7b0c1 100644 --- a/src/main/java/pw/kaboom/extras/commands/CommandDestroyEntities.java +++ b/src/main/java/pw/kaboom/extras/commands/CommandDestroyEntities.java @@ -2,15 +2,14 @@ package pw.kaboom.extras.commands; import org.bukkit.Bukkit; import org.bukkit.World; - import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; - import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; public final class CommandDestroyEntities implements CommandExecutor { + @Override public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) { int entityCount = 0; int worldCount = 0; @@ -24,6 +23,7 @@ public final class CommandDestroyEntities implements CommandExecutor { } worldCount++; } + sender.sendMessage("Successfully destroyed " + entityCount + " entities in " + worldCount + " worlds"); return true; } diff --git a/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java b/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java index 86c04bb..901e61a 100644 --- a/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java +++ b/src/main/java/pw/kaboom/extras/modules/player/PlayerConnection.java @@ -61,12 +61,6 @@ public final class PlayerConnection implements Listener { } } - final Integer spawnRadius = Bukkit.getWorld("world").getGameRuleValue(GameRule.SPAWN_RADIUS); - - if (spawnRadius > 100) { - Bukkit.getWorld("world").setGameRule(GameRule.SPAWN_RADIUS, 100); - } - try { final PlayerProfile profile = event.getPlayerProfile(); @@ -191,6 +185,12 @@ public final class PlayerConnection implements Listener { world.setGameRule(GameRule.RANDOM_TICK_SPEED, 6); } + final Integer spawnRadius = world.getGameRuleValue(GameRule.SPAWN_RADIUS); + + if (spawnRadius > 100) { + world.setGameRule(GameRule.SPAWN_RADIUS, 100); + } + if (!world.isAutoSave()) { world.setAutoSave(true); }