mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-27 09:55:36 -05:00
Different way of checking spawn radius
This commit is contained in:
parent
7546fa0e1e
commit
d3b171b5db
2 changed files with 8 additions and 8 deletions
|
@ -2,15 +2,14 @@ package pw.kaboom.extras.commands;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
public final class CommandDestroyEntities implements CommandExecutor {
|
public final class CommandDestroyEntities implements CommandExecutor {
|
||||||
|
@Override
|
||||||
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
|
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
|
||||||
int entityCount = 0;
|
int entityCount = 0;
|
||||||
int worldCount = 0;
|
int worldCount = 0;
|
||||||
|
@ -24,6 +23,7 @@ public final class CommandDestroyEntities implements CommandExecutor {
|
||||||
}
|
}
|
||||||
worldCount++;
|
worldCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage("Successfully destroyed " + entityCount + " entities in " + worldCount + " worlds");
|
sender.sendMessage("Successfully destroyed " + entityCount + " entities in " + worldCount + " worlds");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
try {
|
||||||
final PlayerProfile profile = event.getPlayerProfile();
|
final PlayerProfile profile = event.getPlayerProfile();
|
||||||
|
|
||||||
|
@ -191,6 +185,12 @@ public final class PlayerConnection implements Listener {
|
||||||
world.setGameRule(GameRule.RANDOM_TICK_SPEED, 6);
|
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()) {
|
if (!world.isAutoSave()) {
|
||||||
world.setAutoSave(true);
|
world.setAutoSave(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue