Program: 34073
Project: 34073
Buggy source:
public boolean onCommand(final CommandSender sender,final Command command,final String label,final String[] split){
  Player player;
  if (sender instanceof Player) {
    player=(Player)sender;
    if (split.length > 0) {
      if (split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")) {
        if (!checkAdminPerms(player,split)) {
          player.sendMessage(ChatColor.RED + Locale.errorNoPermission);
          return true;
        }
      }
 else {
        if (!checkModPerms(player,split)) {
          player.sendMessage(ChatColor.RED + Locale.errorNoPermission);
          return true;
        }
      }
    }
  }
switch (split.length) {
case 0:
    help(sender,label);
  return true;
case 1:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
  sender.sendMessage("String_Node_Str");
  TreeMap<Integer,List<UUID>> topEntityIslands=new TreeMap<Integer,List<UUID>>();
  sender.sendMessage("String_Node_Str" + plugin.getGrid().getOwnershipMap().size() + "String_Node_Str");
  for (  Island island : plugin.getGrid().getOwnershipMap().values()) {
    if (!island.isSpawn()) {
      Location islandLoc=new Location(island.getCenter().getWorld(),island.getCenter().getBlockX(),128,island.getCenter().getBlockZ());
      Entity snowball=islandLoc.getWorld().spawnEntity(islandLoc,EntityType.SNOWBALL);
      if (snowball == null) {
        sender.sendMessage("String_Node_Str" + island.getCenter().toString());
      }
 else {
        island.clearStats();
        List<Entity> islandEntities=snowball.getNearbyEntities(Settings.islandDistance / 2,128,Settings.islandDistance / 2);
        snowball.remove();
        if (islandEntities.size() > 2) {
          int numOfEntities=0;
          for (          Entity entity : islandEntities) {
            if (entity instanceof LivingEntity && !(entity instanceof Player)) {
              numOfEntities++;
              island.addEntity(entity.getType());
            }
          }
          List<UUID> players=new ArrayList<UUID>();
          if (topEntityIslands.containsKey(numOfEntities)) {
            players=topEntityIslands.get(numOfEntities);
          }
          players.add(island.getOwner());
          topEntityIslands.put(numOfEntities,players);
        }
      }
    }
  }
  int rank=1;
  for (  int numOfEntities : topEntityIslands.descendingKeySet()) {
    if (numOfEntities > 0) {
      List<UUID> owners=topEntityIslands.get(numOfEntities);
      for (      UUID owner : owners) {
        sender.sendMessage("String_Node_Str" + rank + "String_Node_Str"+ plugin.getPlayers().getName(owner)+ "String_Node_Str"+ numOfEntities);
        String content="String_Node_Str";
        for (        Entry<EntityType,Integer> entry : plugin.getGrid().getIsland(owner).getEntities().entrySet()) {
          int num=entry.getValue();
          String color=ChatColor.GREEN.toString();
          if (num > 10 && num <= 20) {
            color=ChatColor.YELLOW.toString();
          }
 else           if (num > 20 && num <= 40) {
            color=ChatColor.GOLD.toString();
          }
 else           if (num > 40) {
            color=ChatColor.RED.toString();
          }
          content+=Util.prettifyText(entry.getKey().toString()) + "String_Node_Str" + color+ entry.getValue()+ ChatColor.WHITE+ "String_Node_Str";
        }
        int lastComma=content.lastIndexOf("String_Node_Str");
        if (lastComma > 0) {
          content=content.substring(0,lastComma);
        }
        sender.sendMessage("String_Node_Str" + content);
      }
      rank++;
      if (rank > 10) {
        break;
      }
    }
  }
  return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ "String_Node_Str");
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Player p=(Player)sender;
if (!p.getLocation().getWorld().getName().equals(Settings.worldName)) {
p.sendMessage(ChatColor.RED + Locale.errorWrongWorld);
return true;
}
Location closestIsland=getClosestIsland(((Player)sender).getLocation());
Island oldSpawn=plugin.getGrid().getSpawn();
Island newSpawn=plugin.getGrid().getIslandAt(closestIsland);
if (newSpawn != null && newSpawn.isSpawn()) {
ASkyBlock.getIslandWorld().setSpawnLocation(p.getLocation().getBlockX(),p.getLocation().getBlockY(),p.getLocation().getBlockZ());
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
return true;
}
if (newSpawn != null && newSpawn.getOwner() != null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.getPlayers().getName(newSpawn.getOwner()));
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (oldSpawn != null) {
sender.sendMessage(ChatColor.GOLD + "String_Node_Str" + oldSpawn.getCenter().getBlockX()+ "String_Node_Str"+ oldSpawn.getCenter().getBlockZ()+ "String_Node_Str");
plugin.getGrid().deleteSpawn();
}
if (newSpawn == null) {
newSpawn=plugin.getGrid().addIsland(closestIsland.getBlockX(),closestIsland.getBlockZ());
}
plugin.getGrid().setSpawn(newSpawn);
ASkyBlock.getIslandWorld().setSpawnLocation(p.getLocation().getBlockX(),p.getLocation().getBlockY(),p.getLocation().getBlockZ());
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + p.getLocation().getBlockX()+ "String_Node_Str"+ p.getLocation().getBlockZ());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getCenter().getBlockX()+ "String_Node_Str"+ newSpawn.getCenter().getBlockZ());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getMinX()+ "String_Node_Str"+ newSpawn.getMinZ()+ "String_Node_Str"+ (newSpawn.getMinX() + newSpawn.getIslandDistance() - 1)+ "String_Node_Str"+ (newSpawn.getMinZ() + newSpawn.getIslandDistance() - 1));
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getProtectionSize());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getMinProtectedX()+ "String_Node_Str"+ newSpawn.getMinProtectedZ()+ "String_Node_Str"+ (newSpawn.getMinProtectedX() + newSpawn.getProtectionSize() - 1)+ "String_Node_Str"+ (newSpawn.getMinProtectedZ() + newSpawn.getProtectionSize() - 1));
if (newSpawn.isLocked()) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Location closestIsland=getClosestIsland(((Player)sender).getLocation());
if (closestIsland == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(closestIsland);
if (island != null && island.isSpawn()) {
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinX()+ "String_Node_Str"+ island.getMinZ()+ "String_Node_Str"+ (island.getMinX() + island.getIslandDistance() - 1)+ "String_Node_Str"+ (island.getMinZ() + island.getIslandDistance() - 1));
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getProtectionSize());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinProtectedX()+ "String_Node_Str"+ island.getMinProtectedZ()+ "String_Node_Str"+ (island.getMinProtectedX() + island.getProtectionSize() - 1)+ "String_Node_Str"+ (island.getMinProtectedZ() + island.getProtectionSize() - 1));
if (island.isLocked()) {
  sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
return true;
}
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(closestIsland);
if (target == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
showInfo(target,sender);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Player p=(Player)sender;
BlockIterator iter=new BlockIterator(p,10);
Block lastBlock=iter.next();
while (iter.hasNext()) {
lastBlock=iter.next();
if (lastBlock.getType() == Material.AIR) continue;
break;
}
if (!lastBlock.getType().equals(Material.SIGN_POST)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Sign sign=(Sign)lastBlock.getState();
try {
if (!sign.getLine(0).equalsIgnoreCase(ChatColor.GREEN + Locale.warpswelcomeLine) && !sign.getLine(0).equalsIgnoreCase(ChatColor.RED + Locale.warpswelcomeLine)) {
  sender.sendMessage(ChatColor.RED + "String_Node_Str");
  return true;
}
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
Location closestBedRock=getClosestIsland(((Player)sender).getLocation());
if (closestBedRock == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(closestBedRock);
if (target == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (WarpSigns.addWarp(target,lastBlock.getLocation())) {
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + plugin.getPlayers().getName(target));
return true;
}
sender.sendMessage(ChatColor.RED + "String_Node_Str" + WarpSigns.getWarpOwner(lastBlock.getLocation()));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
plugin.reloadConfig();
plugin.loadPluginConfig();
Challenges.reloadChallengeConfig();
plugin.getChallenges();
if (Settings.useEconomy && VaultHelper.setupEconomy()) {
ControlPanel.loadShop();
}
 else {
Settings.useEconomy=false;
}
ControlPanel.loadControlPanel();
sender.sendMessage(ChatColor.YELLOW + Locale.reloadconfigReloaded);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
sender.sendMessage(ChatColor.YELLOW + Locale.adminTopTengenerating);
TopTen.topTenCreate();
sender.sendMessage(ChatColor.YELLOW + Locale.adminTopTenfinished);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
sender.sendMessage(ChatColor.RED + Locale.purgealreadyRunning);
return true;
}
sender.sendMessage(ChatColor.YELLOW + Locale.purgeusage.replace("String_Node_Str",label));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!confirmReq) {
sender.sendMessage(ChatColor.RED + Locale.confirmerrorTimeLimitExpired);
return true;
}
 else {
confirmOK=true;
confirmReq=false;
}
return true;
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return false;
}
case 2:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!split[1].equalsIgnoreCase("String_Node_Str")) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(((Player)sender).getLocation());
if (island == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
UUID owner=island.getOwner();
String name="String_Node_Str";
if (owner != null) {
name=plugin.getPlayers().getName(owner);
sender.sendMessage(ChatColor.RED + "String_Node_Str" + name);
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ name+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ "String_Node_Str");
return true;
}
 else {
sender.sendMessage(ChatColor.YELLOW + Locale.deleteremoving.replace("String_Node_Str",name));
new DeleteIslandChunk(plugin,island.getCenter());
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(((Player)sender).getLocation());
if (island == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
 else {
int newRange=10;
int maxRange=Settings.islandDistance;
if (island.isSpawn()) {
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + newRange);
if (newRange > maxRange) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ maxRange);
sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
island.setProtectionSize(newRange);
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinX()+ "String_Node_Str"+ island.getMinZ()+ "String_Node_Str"+ (island.getMinX() + island.getIslandDistance() - 1)+ "String_Node_Str"+ (island.getMinZ() + island.getIslandDistance() - 1));
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getProtectionSize());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinProtectedX()+ "String_Node_Str"+ island.getMinProtectedZ()+ "String_Node_Str"+ (island.getMinProtectedX() + island.getProtectionSize() - 1)+ "String_Node_Str"+ (island.getMinProtectedZ() + island.getProtectionSize() - 1));
if (island.isLocked()) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
}
 else {
if (!plugin.getConfig().getBoolean("String_Node_Str")) {
maxRange-=16;
}
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
if (newRange < 10 || newRange > maxRange) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
island.setProtectionSize(newRange);
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.WHITE+ newRange);
showInfo(island.getOwner(),sender);
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
sender.sendMessage(ChatColor.RED + Locale.purgealreadyRunning);
return true;
}
purgeFlag=true;
final int time=Integer.parseInt(split[1]) * 24;
sender.sendMessage(ChatColor.YELLOW + Locale.purgecalculating.replace("String_Node_Str",split[1]));
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
public void run(){
final File directoryPlayers=new File(plugin.getDataFolder() + File.separator + "String_Node_Str");
long offlineTime=0L;
for (final File playerFile : directoryPlayers.listFiles()) {
if (playerFile.getName().endsWith("String_Node_Str")) {
final UUID playerUUID=UUID.fromString(playerFile.getName().substring(0,playerFile.getName().length() - 4));
if (Bukkit.getPlayer(playerUUID) == null) {
  final OfflinePlayer oplayer=Bukkit.getOfflinePlayer(playerUUID);
  offlineTime=oplayer.getLastPlayed();
  offlineTime=(System.currentTimeMillis() - offlineTime) / 3600000L;
  if (offlineTime > time) {
    YamlConfiguration oldPlayer=new YamlConfiguration();
    try {
      oldPlayer.load(playerFile);
      if (oldPlayer.getBoolean("String_Node_Str",false)) {
        if (!oldPlayer.getBoolean("String_Node_Str",false)) {
          if (oldPlayer.getInt("String_Node_Str",0) < Settings.abandonedIslandLevel) {
            removeList.add(playerUUID);
          }
 else {
          }
        }
 else {
        }
      }
 else {
      }
    }
 catch (    Exception e) {
      plugin.getLogger().severe("String_Node_Str" + playerFile.getName() + "String_Node_Str");
    }
  }
}
}
}
if (removeList.isEmpty()) {
sender.sendMessage(ChatColor.YELLOW + Locale.purgenoneFound);
purgeFlag=false;
return;
}
sender.sendMessage(ChatColor.YELLOW + Locale.purgethisWillRemove.replace("String_Node_Str",String.valueOf(removeList.size())));
sender.sendMessage(ChatColor.RED + Locale.purgewarning);
sender.sendMessage(ChatColor.RED + Locale.purgetypeConfirm.replace("String_Node_Str",label));
confirmReq=true;
confirmOK=false;
confirmTimer=0;
new BukkitRunnable(){
@Override public void run(){
if (confirmTimer++ > 10) {
  confirmReq=false;
  confirmOK=false;
  purgeFlag=false;
  removeList.clear();
  sender.sendMessage(ChatColor.YELLOW + Locale.purgepurgeCancelled);
  this.cancel();
}
 else if (confirmOK) {
  final int total=removeList.size();
  new BukkitRunnable(){
    @Override public void run(){
      if (removeList.isEmpty() && purgeFlag) {
        purgeFlag=false;
        sender.sendMessage(ChatColor.YELLOW + Locale.purgefinished);
        this.cancel();
      }
      if (removeList.size() > 0 && purgeFlag) {
        plugin.deletePlayerIsland(removeList.get(0),true);
        sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + removeList.size()+ "String_Node_Str"+ total+ "String_Node_Str"+ Locale.purgeremovingName.replace("String_Node_Str",plugin.getPlayers().getName(removeList.get(0))));
        removeList.remove(0);
      }
      sender.sendMessage("String_Node_Str");
    }
  }
.runTaskTimer(plugin,0L,20L);
  confirmReq=false;
  confirmOK=false;
  this.cancel();
}
}
}
.runTaskTimer(plugin,0L,40L);
}
}
);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
plugin.getPlayers().setResetsLeft(playerUUID,Settings.resetLimit);
sender.sendMessage(ChatColor.YELLOW + Locale.clearedResetLimit + "String_Node_Str"+ Settings.resetLimit+ "String_Node_Str");
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return true;
}
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().getIslandLocation(playerUUID) != null) {
Location safeSpot=plugin.getGrid().getSafeHomeLocation(playerUUID);
if (safeSpot != null) {
((Player)sender).teleport(safeSpot);
}
 else {
sender.sendMessage(ChatColor.RED + Locale.warpserrorNotSafe);
Location warpSpot=plugin.getPlayers().getIslandLocation(playerUUID);
sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpSpot.getBlockX()+ "String_Node_Str"+ warpSpot.getBlockY()+ "String_Node_Str"+ warpSpot.getBlockZ());
}
return true;
}
sender.sendMessage(Locale.errorNoIslandOther);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
sender.sendMessage(ChatColor.YELLOW + Locale.deleteremoving.replace("String_Node_Str",split[1]));
Player target=plugin.getServer().getPlayer(playerUUID);
if (target != null) {
CoopPlay.getInstance().clearMyInvitedCoops(target);
CoopPlay.getInstance().clearMyCoops(target);
plugin.resetPlayer(target);
}
plugin.deletePlayerIsland(playerUUID,true);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (sender instanceof Player) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
if (adminSetPlayerIsland(sender,((Player)sender).getLocation(),playerUUID)) {
sender.sendMessage(ChatColor.GREEN + Locale.registersettingIsland.replace("String_Node_Str",split[1]));
}
 else {
sender.sendMessage(ChatColor.RED + Locale.registererrorBedrockNotFound);
}
return true;
}
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().inTeam(playerUUID)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Location island=plugin.getPlayers().getIslandLocation(playerUUID);
if (island == null) {
sender.sendMessage(ChatColor.RED + Locale.errorNoIslandOther);
return true;
}
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + plugin.getPlayers().getIslandLocation(playerUUID).getBlockX()+ "String_Node_Str"+ plugin.getPlayers().getIslandLocation(playerUUID).getBlockZ());
plugin.deletePlayerIsland(playerUUID,false);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
showInfo(playerUUID,sender);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
plugin.getPlayers().resetAllChallenges(playerUUID);
sender.sendMessage(ChatColor.YELLOW + Locale.resetChallengessuccess.replace("String_Node_Str",split[1]));
return true;
}
 else {
return false;
}
case 3:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
if (!plugin.getPlayers().getTeamLeader(playerUUID).equals(playerUUID)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.getPlayers().getName(plugin.getPlayers().getTeamLeader(playerUUID)));
return true;
}
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
 else {
int newRange=0;
int maxRange=Settings.islandDistance;
if (!plugin.getConfig().getBoolean("String_Node_Str")) {
maxRange-=16;
}
try {
newRange=Integer.valueOf(split[2]);
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
if (newRange < 10 || newRange > maxRange) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
island.setProtectionSize(newRange);
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.WHITE+ newRange);
showInfo(playerUUID,sender);
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
if (!plugin.getPlayers().getTeamLeader(playerUUID).equals(playerUUID)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.getPlayers().getName(plugin.getPlayers().getTeamLeader(playerUUID)));
return true;
}
}
Biome biome=null;
String biomeName=split[2].toUpperCase();
try {
biome=Biome.valueOf(biomeName);
biomeName=biome.name();
if (!plugin.getConfig().contains("String_Node_Str" + biomeName)) {
sender.sendMessage(ChatColor.RED + Locale.biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
sender.sendMessage(b.name());
}
}
return true;
}
biomeName=plugin.getConfig().getString("String_Node_Str" + biomeName + "String_Node_Str",Util.prettifyText(biomeName));
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + Locale.biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
sender.sendMessage(b.name());
}
}
return true;
}
if (plugin.getPlayers().inTeam(playerUUID) && plugin.getPlayers().getTeamIslandLocation(playerUUID) != null) {
plugin.getBiomes().setIslandBiome(plugin.getPlayers().getTeamIslandLocation(playerUUID),biome);
}
 else {
plugin.getBiomes().setIslandBiome(plugin.getPlayers().getIslandLocation(playerUUID),biome);
}
sender.sendMessage(ChatColor.GREEN + Locale.biomeSet.replace("String_Node_Str",biomeName));
Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
if (targetPlayer != null) {
targetPlayer.sendMessage("String_Node_Str" + ChatColor.GREEN + Locale.biomeSet.replace("String_Node_Str",biomeName));
}
 else {
Messages.setMessage(playerUUID,"String_Node_Str" + ChatColor.GREEN + Locale.biomeSet.replace("String_Node_Str",biomeName));
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
if (!plugin.getPlayers().inTeam(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorNoTeam);
return true;
}
UUID teamLeader=plugin.getPlayers().getTeamLeader(playerUUID);
if (!teamLeader.equals(playerUUID)) {
plugin.getPlayers().setLeaveTeam(playerUUID);
plugin.getPlayers().setHomeLocation(playerUUID,null);
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getPlayers().removeMember(teamLeader,playerUUID);
if (plugin.getPlayers().getMembers(teamLeader).size() < 2) {
plugin.getPlayers().setLeaveTeam(teamLeader);
}
WarpSigns.removeWarp(playerUUID);
sender.sendMessage(ChatColor.RED + Locale.kicknameRemoved.replace("String_Node_Str",split[2]));
return true;
}
 else {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + label+ "String_Node_Str"+ split[2]+ "String_Node_Str");
return true;
}
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return false;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().checkChallenge(playerUUID,split[1].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[1].toLowerCase())) {
sender.sendMessage(ChatColor.RED + Locale.completeChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().get(playerUUID).completeChallenge(split[1].toLowerCase());
sender.sendMessage(ChatColor.YELLOW + Locale.completeChallengechallangeCompleted.replace("String_Node_Str",split[1].toLowerCase()).replace("String_Node_Str",split[2]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (!plugin.getPlayers().checkChallenge(playerUUID,split[1].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[1].toLowerCase())) {
sender.sendMessage(ChatColor.RED + Locale.resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().resetChallenge(playerUUID,split[1].toLowerCase());
sender.sendMessage(ChatColor.YELLOW + Locale.resetChallengechallengeReset.replace("String_Node_Str",split[1].toLowerCase()).replace("String_Node_Str",split[2]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") && split[1].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
showInfoChallenges(playerUUID,sender);
return true;
}
}
return false;
case 4:
if (split[0].equalsIgnoreCase("String_Node_Str") && split[1].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
final Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
final UUID teamLeader=plugin.getPlayers().getUUID(split[3]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID) || !plugin.getPlayers().isAKnownPlayer(teamLeader)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (playerUUID.equals(teamLeader)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (!plugin.getPlayers().hasIsland(teamLeader)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.inviteerrorThatPlayerIsAlreadyInATeam);
return true;
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(teamLeader)) {
plugin.getPlayers().setJoinTeam(teamLeader,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader));
plugin.getPlayers().addTeamMember(teamLeader,teamLeader);
sender.sendMessage(ChatColor.GOLD + "String_Node_Str");
}
if (targetPlayer != null) {
targetPlayer.performCommand(Settings.ISLANDCOMMAND + "String_Node_Str");
}
if (plugin.getPlayers().hasIsland(playerUUID)) {
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
if (islandLoc != null) {
sender.sendMessage(ChatColor.RED + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ islandLoc.getBlockX()+ "String_Node_Str"+ islandLoc.getBlockZ()+ "String_Node_Str");
}
}
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getPlayers().setHasIsland(playerUUID,false);
plugin.getPlayers().setJoinTeam(playerUUID,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader));
if (plugin.getPlayers().getHomeLocation(teamLeader) != null) {
plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getHomeLocation(teamLeader));
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getIslandLocation(teamLeader));
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(playerUUID)) {
plugin.getPlayers().addTeamMember(teamLeader,playerUUID);
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
 else {
sender.sendMessage(ChatColor.GOLD + "String_Node_Str");
}
if (targetPlayer != null) {
plugin.getGrid().homeTeleport(targetPlayer);
}
return true;
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return false;
}
default :
return false;
}
}

Fixed version (ground truth):
public boolean onCommand(final CommandSender sender,final Command command,final String label,final String[] split){
  Player player;
  if (sender instanceof Player) {
    player=(Player)sender;
    if (split.length > 0) {
      if (split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")|| split[0].equalsIgnoreCase("String_Node_Str")) {
        if (!checkAdminPerms(player,split)) {
          player.sendMessage(ChatColor.RED + Locale.errorNoPermission);
          return true;
        }
      }
 else {
        if (!checkModPerms(player,split)) {
          player.sendMessage(ChatColor.RED + Locale.errorNoPermission);
          return true;
        }
      }
    }
  }
switch (split.length) {
case 0:
    help(sender,label);
  return true;
case 1:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
  sender.sendMessage("String_Node_Str");
  TreeMap<Integer,List<UUID>> topEntityIslands=new TreeMap<Integer,List<UUID>>();
  sender.sendMessage("String_Node_Str" + plugin.getGrid().getOwnershipMap().size() + "String_Node_Str");
  for (  Island island : plugin.getGrid().getOwnershipMap().values()) {
    if (!island.isSpawn()) {
      Location islandLoc=new Location(island.getCenter().getWorld(),island.getCenter().getBlockX(),128,island.getCenter().getBlockZ());
      Entity snowball=islandLoc.getWorld().spawnEntity(islandLoc,EntityType.SNOWBALL);
      if (snowball == null) {
        sender.sendMessage("String_Node_Str" + island.getCenter().toString());
      }
 else {
        island.clearStats();
        List<Entity> islandEntities=snowball.getNearbyEntities(Settings.islandDistance / 2,128,Settings.islandDistance / 2);
        snowball.remove();
        if (islandEntities.size() > 2) {
          int numOfEntities=0;
          for (          Entity entity : islandEntities) {
            if (entity instanceof LivingEntity && !(entity instanceof Player)) {
              numOfEntities++;
              island.addEntity(entity.getType());
            }
          }
          List<UUID> players=new ArrayList<UUID>();
          if (topEntityIslands.containsKey(numOfEntities)) {
            players=topEntityIslands.get(numOfEntities);
          }
          players.add(island.getOwner());
          topEntityIslands.put(numOfEntities,players);
        }
      }
    }
  }
  int rank=1;
  for (  int numOfEntities : topEntityIslands.descendingKeySet()) {
    if (numOfEntities > 0) {
      List<UUID> owners=topEntityIslands.get(numOfEntities);
      for (      UUID owner : owners) {
        sender.sendMessage("String_Node_Str" + rank + "String_Node_Str"+ plugin.getPlayers().getName(owner)+ "String_Node_Str"+ numOfEntities);
        String content="String_Node_Str";
        for (        Entry<EntityType,Integer> entry : plugin.getGrid().getIsland(owner).getEntities().entrySet()) {
          int num=entry.getValue();
          String color=ChatColor.GREEN.toString();
          if (num > 10 && num <= 20) {
            color=ChatColor.YELLOW.toString();
          }
 else           if (num > 20 && num <= 40) {
            color=ChatColor.GOLD.toString();
          }
 else           if (num > 40) {
            color=ChatColor.RED.toString();
          }
          content+=Util.prettifyText(entry.getKey().toString()) + "String_Node_Str" + color+ entry.getValue()+ ChatColor.WHITE+ "String_Node_Str";
        }
        int lastComma=content.lastIndexOf("String_Node_Str");
        if (lastComma > 0) {
          content=content.substring(0,lastComma);
        }
        sender.sendMessage("String_Node_Str" + content);
      }
      rank++;
      if (rank > 10) {
        break;
      }
    }
  }
  return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ "String_Node_Str");
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Player p=(Player)sender;
if (!p.getLocation().getWorld().getName().equals(Settings.worldName)) {
p.sendMessage(ChatColor.RED + Locale.errorWrongWorld);
return true;
}
Location closestIsland=getClosestIsland(((Player)sender).getLocation());
Island oldSpawn=plugin.getGrid().getSpawn();
Island newSpawn=plugin.getGrid().getIslandAt(closestIsland);
if (newSpawn != null && newSpawn.isSpawn()) {
ASkyBlock.getIslandWorld().setSpawnLocation(p.getLocation().getBlockX(),p.getLocation().getBlockY(),p.getLocation().getBlockZ());
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
return true;
}
if (newSpawn != null && newSpawn.getOwner() != null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.getPlayers().getName(newSpawn.getOwner()));
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (oldSpawn != null) {
sender.sendMessage(ChatColor.GOLD + "String_Node_Str" + oldSpawn.getCenter().getBlockX()+ "String_Node_Str"+ oldSpawn.getCenter().getBlockZ()+ "String_Node_Str");
plugin.getGrid().deleteSpawn();
}
if (newSpawn == null) {
newSpawn=plugin.getGrid().addIsland(closestIsland.getBlockX(),closestIsland.getBlockZ());
}
plugin.getGrid().setSpawn(newSpawn);
ASkyBlock.getIslandWorld().setSpawnLocation(p.getLocation().getBlockX(),p.getLocation().getBlockY(),p.getLocation().getBlockZ());
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + p.getLocation().getBlockX()+ "String_Node_Str"+ p.getLocation().getBlockZ());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getCenter().getBlockX()+ "String_Node_Str"+ newSpawn.getCenter().getBlockZ());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getMinX()+ "String_Node_Str"+ newSpawn.getMinZ()+ "String_Node_Str"+ (newSpawn.getMinX() + newSpawn.getIslandDistance() - 1)+ "String_Node_Str"+ (newSpawn.getMinZ() + newSpawn.getIslandDistance() - 1));
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getProtectionSize());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + newSpawn.getMinProtectedX()+ "String_Node_Str"+ newSpawn.getMinProtectedZ()+ "String_Node_Str"+ (newSpawn.getMinProtectedX() + newSpawn.getProtectionSize() - 1)+ "String_Node_Str"+ (newSpawn.getMinProtectedZ() + newSpawn.getProtectionSize() - 1));
if (newSpawn.isLocked()) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Location closestIsland=getClosestIsland(((Player)sender).getLocation());
if (closestIsland == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(closestIsland);
if (island != null && island.isSpawn()) {
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinX()+ "String_Node_Str"+ island.getMinZ()+ "String_Node_Str"+ (island.getMinX() + island.getIslandDistance() - 1)+ "String_Node_Str"+ (island.getMinZ() + island.getIslandDistance() - 1));
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getProtectionSize());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinProtectedX()+ "String_Node_Str"+ island.getMinProtectedZ()+ "String_Node_Str"+ (island.getMinProtectedX() + island.getProtectionSize() - 1)+ "String_Node_Str"+ (island.getMinProtectedZ() + island.getProtectionSize() - 1));
if (island.isLocked()) {
  sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
return true;
}
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(closestIsland);
if (target == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
showInfo(target,sender);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Player p=(Player)sender;
BlockIterator iter=new BlockIterator(p,10);
Block lastBlock=iter.next();
while (iter.hasNext()) {
lastBlock=iter.next();
if (lastBlock.getType() == Material.AIR) continue;
break;
}
if (!lastBlock.getType().equals(Material.SIGN_POST)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Sign sign=(Sign)lastBlock.getState();
try {
if (!sign.getLine(0).equalsIgnoreCase(ChatColor.GREEN + Locale.warpswelcomeLine) && !sign.getLine(0).equalsIgnoreCase(ChatColor.RED + Locale.warpswelcomeLine)) {
  sender.sendMessage(ChatColor.RED + "String_Node_Str");
  return true;
}
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
Location closestBedRock=getClosestIsland(((Player)sender).getLocation());
if (closestBedRock == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(closestBedRock);
if (target == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (WarpSigns.addWarp(target,lastBlock.getLocation())) {
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + plugin.getPlayers().getName(target));
return true;
}
sender.sendMessage(ChatColor.RED + "String_Node_Str" + WarpSigns.getWarpOwner(lastBlock.getLocation()));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
plugin.reloadConfig();
plugin.loadPluginConfig();
Challenges.reloadChallengeConfig();
plugin.getChallenges();
if (Settings.useEconomy && VaultHelper.setupEconomy()) {
ControlPanel.loadShop();
}
 else {
Settings.useEconomy=false;
}
ControlPanel.loadControlPanel();
if (Settings.updateCheck) {
plugin.checkUpdates();
}
 else {
plugin.setUpdateCheck(null);
}
sender.sendMessage(ChatColor.YELLOW + Locale.reloadconfigReloaded);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
sender.sendMessage(ChatColor.YELLOW + Locale.adminTopTengenerating);
TopTen.topTenCreate();
sender.sendMessage(ChatColor.YELLOW + Locale.adminTopTenfinished);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
sender.sendMessage(ChatColor.RED + Locale.purgealreadyRunning);
return true;
}
sender.sendMessage(ChatColor.YELLOW + Locale.purgeusage.replace("String_Node_Str",label));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!confirmReq) {
sender.sendMessage(ChatColor.RED + Locale.confirmerrorTimeLimitExpired);
return true;
}
 else {
confirmOK=true;
confirmReq=false;
}
return true;
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return false;
}
case 2:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!split[1].equalsIgnoreCase("String_Node_Str")) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(((Player)sender).getLocation());
if (island == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
UUID owner=island.getOwner();
String name="String_Node_Str";
if (owner != null) {
name=plugin.getPlayers().getName(owner);
sender.sendMessage(ChatColor.RED + "String_Node_Str" + name);
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ name+ ChatColor.RESET+ "String_Node_Str"+ ChatColor.RED+ "String_Node_Str");
return true;
}
 else {
sender.sendMessage(ChatColor.YELLOW + Locale.deleteremoving.replace("String_Node_Str",name));
new DeleteIslandChunk(plugin,island.getCenter());
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(((Player)sender).getLocation());
if (island == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
 else {
int newRange=10;
int maxRange=Settings.islandDistance;
if (island.isSpawn()) {
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + newRange);
if (newRange > maxRange) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ "String_Node_Str"+ maxRange);
sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
island.setProtectionSize(newRange);
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinX()+ "String_Node_Str"+ island.getMinZ()+ "String_Node_Str"+ (island.getMinX() + island.getIslandDistance() - 1)+ "String_Node_Str"+ (island.getMinZ() + island.getIslandDistance() - 1));
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getProtectionSize());
sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + island.getMinProtectedX()+ "String_Node_Str"+ island.getMinProtectedZ()+ "String_Node_Str"+ (island.getMinProtectedX() + island.getProtectionSize() - 1)+ "String_Node_Str"+ (island.getMinProtectedZ() + island.getProtectionSize() - 1));
if (island.isLocked()) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
}
}
 else {
if (!plugin.getConfig().getBoolean("String_Node_Str")) {
maxRange-=16;
}
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
if (newRange < 10 || newRange > maxRange) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
island.setProtectionSize(newRange);
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.WHITE+ newRange);
showInfo(island.getOwner(),sender);
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
sender.sendMessage(ChatColor.RED + Locale.purgealreadyRunning);
return true;
}
purgeFlag=true;
final int time=Integer.parseInt(split[1]) * 24;
sender.sendMessage(ChatColor.YELLOW + Locale.purgecalculating.replace("String_Node_Str",split[1]));
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
public void run(){
final File directoryPlayers=new File(plugin.getDataFolder() + File.separator + "String_Node_Str");
long offlineTime=0L;
for (final File playerFile : directoryPlayers.listFiles()) {
if (playerFile.getName().endsWith("String_Node_Str")) {
final UUID playerUUID=UUID.fromString(playerFile.getName().substring(0,playerFile.getName().length() - 4));
if (Bukkit.getPlayer(playerUUID) == null) {
  final OfflinePlayer oplayer=Bukkit.getOfflinePlayer(playerUUID);
  offlineTime=oplayer.getLastPlayed();
  offlineTime=(System.currentTimeMillis() - offlineTime) / 3600000L;
  if (offlineTime > time) {
    YamlConfiguration oldPlayer=new YamlConfiguration();
    try {
      oldPlayer.load(playerFile);
      if (oldPlayer.getBoolean("String_Node_Str",false)) {
        if (!oldPlayer.getBoolean("String_Node_Str",false)) {
          if (oldPlayer.getInt("String_Node_Str",0) < Settings.abandonedIslandLevel) {
            removeList.add(playerUUID);
          }
 else {
          }
        }
 else {
        }
      }
 else {
      }
    }
 catch (    Exception e) {
      plugin.getLogger().severe("String_Node_Str" + playerFile.getName() + "String_Node_Str");
    }
  }
}
}
}
if (removeList.isEmpty()) {
sender.sendMessage(ChatColor.YELLOW + Locale.purgenoneFound);
purgeFlag=false;
return;
}
sender.sendMessage(ChatColor.YELLOW + Locale.purgethisWillRemove.replace("String_Node_Str",String.valueOf(removeList.size())));
sender.sendMessage(ChatColor.RED + Locale.purgewarning);
sender.sendMessage(ChatColor.RED + Locale.purgetypeConfirm.replace("String_Node_Str",label));
confirmReq=true;
confirmOK=false;
confirmTimer=0;
new BukkitRunnable(){
@Override public void run(){
if (confirmTimer++ > 10) {
  confirmReq=false;
  confirmOK=false;
  purgeFlag=false;
  removeList.clear();
  sender.sendMessage(ChatColor.YELLOW + Locale.purgepurgeCancelled);
  this.cancel();
}
 else if (confirmOK) {
  final int total=removeList.size();
  new BukkitRunnable(){
    @Override public void run(){
      if (removeList.isEmpty() && purgeFlag) {
        purgeFlag=false;
        sender.sendMessage(ChatColor.YELLOW + Locale.purgefinished);
        this.cancel();
      }
      if (removeList.size() > 0 && purgeFlag) {
        plugin.deletePlayerIsland(removeList.get(0),true);
        sender.sendMessage(ChatColor.YELLOW + "String_Node_Str" + removeList.size()+ "String_Node_Str"+ total+ "String_Node_Str"+ Locale.purgeremovingName.replace("String_Node_Str",plugin.getPlayers().getName(removeList.get(0))));
        removeList.remove(0);
      }
      sender.sendMessage("String_Node_Str");
    }
  }
.runTaskTimer(plugin,0L,20L);
  confirmReq=false;
  confirmOK=false;
  this.cancel();
}
}
}
.runTaskTimer(plugin,0L,40L);
}
}
);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
plugin.getPlayers().setResetsLeft(playerUUID,Settings.resetLimit);
sender.sendMessage(ChatColor.YELLOW + Locale.clearedResetLimit + "String_Node_Str"+ Settings.resetLimit+ "String_Node_Str");
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return true;
}
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().getIslandLocation(playerUUID) != null) {
Location safeSpot=plugin.getGrid().getSafeHomeLocation(playerUUID);
if (safeSpot != null) {
((Player)sender).teleport(safeSpot);
}
 else {
sender.sendMessage(ChatColor.RED + Locale.warpserrorNotSafe);
Location warpSpot=plugin.getPlayers().getIslandLocation(playerUUID);
sender.sendMessage(ChatColor.RED + "String_Node_Str" + warpSpot.getBlockX()+ "String_Node_Str"+ warpSpot.getBlockY()+ "String_Node_Str"+ warpSpot.getBlockZ());
}
return true;
}
sender.sendMessage(Locale.errorNoIslandOther);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
sender.sendMessage(ChatColor.YELLOW + Locale.deleteremoving.replace("String_Node_Str",split[1]));
Player target=plugin.getServer().getPlayer(playerUUID);
if (target != null) {
CoopPlay.getInstance().clearMyInvitedCoops(target);
CoopPlay.getInstance().clearMyCoops(target);
plugin.resetPlayer(target);
}
plugin.deletePlayerIsland(playerUUID,true);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (sender instanceof Player) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
if (adminSetPlayerIsland(sender,((Player)sender).getLocation(),playerUUID)) {
sender.sendMessage(ChatColor.GREEN + Locale.registersettingIsland.replace("String_Node_Str",split[1]));
}
 else {
sender.sendMessage(ChatColor.RED + Locale.registererrorBedrockNotFound);
}
return true;
}
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().inTeam(playerUUID)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
Location island=plugin.getPlayers().getIslandLocation(playerUUID);
if (island == null) {
sender.sendMessage(ChatColor.RED + Locale.errorNoIslandOther);
return true;
}
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + plugin.getPlayers().getIslandLocation(playerUUID).getBlockX()+ "String_Node_Str"+ plugin.getPlayers().getIslandLocation(playerUUID).getBlockZ());
plugin.deletePlayerIsland(playerUUID,false);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
showInfo(playerUUID,sender);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
plugin.getPlayers().resetAllChallenges(playerUUID);
sender.sendMessage(ChatColor.YELLOW + Locale.resetChallengessuccess.replace("String_Node_Str",split[1]));
return true;
}
 else {
return false;
}
case 3:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
if (!plugin.getPlayers().getTeamLeader(playerUUID).equals(playerUUID)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.getPlayers().getName(plugin.getPlayers().getTeamLeader(playerUUID)));
return true;
}
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
 else {
int newRange=0;
int maxRange=Settings.islandDistance;
if (!plugin.getConfig().getBoolean("String_Node_Str")) {
maxRange-=16;
}
try {
newRange=Integer.valueOf(split[2]);
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
if (newRange < 10 || newRange > maxRange) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + maxRange);
return true;
}
island.setProtectionSize(newRange);
sender.sendMessage(ChatColor.GREEN + "String_Node_Str" + ChatColor.WHITE+ newRange);
showInfo(playerUUID,sender);
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
if (!plugin.getPlayers().getTeamLeader(playerUUID).equals(playerUUID)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + plugin.getPlayers().getName(plugin.getPlayers().getTeamLeader(playerUUID)));
return true;
}
}
Biome biome=null;
String biomeName=split[2].toUpperCase();
try {
biome=Biome.valueOf(biomeName);
biomeName=biome.name();
if (!plugin.getConfig().contains("String_Node_Str" + biomeName)) {
sender.sendMessage(ChatColor.RED + Locale.biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
sender.sendMessage(b.name());
}
}
return true;
}
biomeName=plugin.getConfig().getString("String_Node_Str" + biomeName + "String_Node_Str",Util.prettifyText(biomeName));
}
 catch (Exception e) {
sender.sendMessage(ChatColor.RED + Locale.biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
sender.sendMessage(b.name());
}
}
return true;
}
if (plugin.getPlayers().inTeam(playerUUID) && plugin.getPlayers().getTeamIslandLocation(playerUUID) != null) {
plugin.getBiomes().setIslandBiome(plugin.getPlayers().getTeamIslandLocation(playerUUID),biome);
}
 else {
plugin.getBiomes().setIslandBiome(plugin.getPlayers().getIslandLocation(playerUUID),biome);
}
sender.sendMessage(ChatColor.GREEN + Locale.biomeSet.replace("String_Node_Str",biomeName));
Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
if (targetPlayer != null) {
targetPlayer.sendMessage("String_Node_Str" + ChatColor.GREEN + Locale.biomeSet.replace("String_Node_Str",biomeName));
}
 else {
Messages.setMessage(playerUUID,"String_Node_Str" + ChatColor.GREEN + Locale.biomeSet.replace("String_Node_Str",biomeName));
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
if (!plugin.getPlayers().inTeam(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorNoTeam);
return true;
}
UUID teamLeader=plugin.getPlayers().getTeamLeader(playerUUID);
if (!teamLeader.equals(playerUUID)) {
plugin.getPlayers().setLeaveTeam(playerUUID);
plugin.getPlayers().setHomeLocation(playerUUID,null);
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getPlayers().removeMember(teamLeader,playerUUID);
if (plugin.getPlayers().getMembers(teamLeader).size() < 2) {
plugin.getPlayers().setLeaveTeam(teamLeader);
}
WarpSigns.removeWarp(playerUUID);
sender.sendMessage(ChatColor.RED + Locale.kicknameRemoved.replace("String_Node_Str",split[2]));
return true;
}
 else {
sender.sendMessage(ChatColor.RED + "String_Node_Str" + label+ "String_Node_Str"+ split[2]+ "String_Node_Str");
return true;
}
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return false;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().checkChallenge(playerUUID,split[1].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[1].toLowerCase())) {
sender.sendMessage(ChatColor.RED + Locale.completeChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().get(playerUUID).completeChallenge(split[1].toLowerCase());
sender.sendMessage(ChatColor.YELLOW + Locale.completeChallengechallangeCompleted.replace("String_Node_Str",split[1].toLowerCase()).replace("String_Node_Str",split[2]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (!plugin.getPlayers().checkChallenge(playerUUID,split[1].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[1].toLowerCase())) {
sender.sendMessage(ChatColor.RED + Locale.resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().resetChallenge(playerUUID,split[1].toLowerCase());
sender.sendMessage(ChatColor.YELLOW + Locale.resetChallengechallengeReset.replace("String_Node_Str",split[1].toLowerCase()).replace("String_Node_Str",split[2]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") && split[1].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
 else {
showInfoChallenges(playerUUID,sender);
return true;
}
}
return false;
case 4:
if (split[0].equalsIgnoreCase("String_Node_Str") && split[1].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2]);
final Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
final UUID teamLeader=plugin.getPlayers().getUUID(split[3]);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID) || !plugin.getPlayers().isAKnownPlayer(teamLeader)) {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownPlayer);
return true;
}
if (playerUUID.equals(teamLeader)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (!plugin.getPlayers().hasIsland(teamLeader)) {
sender.sendMessage(ChatColor.RED + "String_Node_Str");
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
sender.sendMessage(ChatColor.RED + Locale.inviteerrorThatPlayerIsAlreadyInATeam);
return true;
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(teamLeader)) {
plugin.getPlayers().setJoinTeam(teamLeader,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader));
plugin.getPlayers().addTeamMember(teamLeader,teamLeader);
sender.sendMessage(ChatColor.GOLD + "String_Node_Str");
}
if (targetPlayer != null) {
targetPlayer.performCommand(Settings.ISLANDCOMMAND + "String_Node_Str");
}
if (plugin.getPlayers().hasIsland(playerUUID)) {
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
if (islandLoc != null) {
sender.sendMessage(ChatColor.RED + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ islandLoc.getBlockX()+ "String_Node_Str"+ islandLoc.getBlockZ()+ "String_Node_Str");
}
}
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getPlayers().setHasIsland(playerUUID,false);
plugin.getPlayers().setJoinTeam(playerUUID,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader));
if (plugin.getPlayers().getHomeLocation(teamLeader) != null) {
plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getHomeLocation(teamLeader));
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getIslandLocation(teamLeader));
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(playerUUID)) {
plugin.getPlayers().addTeamMember(teamLeader,playerUUID);
sender.sendMessage(ChatColor.GREEN + "String_Node_Str");
}
 else {
sender.sendMessage(ChatColor.GOLD + "String_Node_Str");
}
if (targetPlayer != null) {
plugin.getGrid().homeTeleport(targetPlayer);
}
return true;
}
 else {
sender.sendMessage(ChatColor.RED + Locale.errorUnknownCommand);
return false;
}
default :
return false;
}
}