Program: 33807
Project: 33807
Buggy source:
@Override 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 (player.getUniqueId() == null) {
      return false;
    }
    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")|| 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)) {
          Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoPermission);
          return true;
        }
      }
 else {
        if (!checkModPerms(player,split)) {
          Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoPermission);
          return true;
        }
      }
    }
  }
  if (split.length > 1 && split[0].equalsIgnoreCase("String_Node_Str")) {
    final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
    if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
      Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
      return true;
    }
 else {
      if (split.length == 2) {
        Util.sendMessage(sender,plugin.getGrid().getIslandName(playerUUID));
      }
 else {
        String name=split[2];
        for (int i=3; i < split.length; i++) {
          name=name + "String_Node_Str" + split[i];
        }
        if (name.length() < Settings.minNameLength) {
          Util.sendMessage(sender,ChatColor.RED + (plugin.myLocale().errorTooShort).replace("String_Node_Str",String.valueOf(Settings.minNameLength)));
          return true;
        }
        if (name.length() > Settings.maxNameLength) {
          Util.sendMessage(sender,ChatColor.RED + (plugin.myLocale().errorTooLong).replace("String_Node_Str",String.valueOf(Settings.maxNameLength)));
          return true;
        }
        plugin.getGrid().setIslandName(playerUUID,ChatColor.translateAlternateColorCodes('&',name));
        Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
      }
      return true;
    }
  }
switch (split.length) {
case 0:
    help(sender,label);
  return true;
case 1:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
  Util.sendMessage(sender,plugin.myLocale().helpColor + plugin.myLocale().adminHelpsetLanguage);
  return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
for (String challenge : plugin.getChallenges().getRepeatingChallengeResets()) {
  Util.sendMessage(sender,ChatColor.GREEN + challenge);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (LavaCheck.getStats().size() == 0) {
  Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().banNone);
  return true;
}
for (Long level : LavaCheck.getStats().keySet()) {
  if (level == Long.MIN_VALUE) {
    Util.sendMessage(sender,plugin.myLocale().challengeslevel + "String_Node_Str");
  }
 else {
    Util.sendMessage(sender,plugin.myLocale().challengeslevel + "String_Node_Str" + level);
  }
  Collection<String> result=new TreeSet<String>(Collator.getInstance());
  for (  Material mat : LavaCheck.getStats().get(level).elementSet()) {
    result.add("String_Node_Str" + Util.prettifyText(mat.toString()) + "String_Node_Str"+ LavaCheck.getStats().get(level).count(mat)+ "String_Node_Str"+ LavaCheck.getStats().get(level).size()+ "String_Node_Str"+ ((long)((double)LavaCheck.getStats().get(level).count(mat) / LavaCheck.getStats().get(level).size() * 100))+ "String_Node_Str"+ String.valueOf(LavaCheck.getConfigChances(level,mat))+ "String_Node_Str");
  }
  for (  String r : result) {
    Util.sendMessage(sender,r);
  }
}
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpsetDeaths);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str");
return true;
}
 else if (Settings.teamChat && split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
if (VaultHelper.checkPerm(player,Settings.PERMPREFIX + "String_Node_Str") || player.isOp()) {
if (plugin.getChatListener().toggleSpy(player.getUniqueId())) {
  Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().teamChatSpyStatusOn);
}
 else {
  Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().teamChatSpyStatusOff);
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
Island island=plugin.getGrid().getIslandAt(player.getLocation());
if (island == null) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNotOnIsland);
return true;
}
 else {
Player owner=plugin.getServer().getPlayer(island.getOwner());
if (island.isLocked()) {
  Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockUnlocking);
  island.setLocked(false);
  if (owner != null) {
    Util.sendMessage(owner,plugin.myLocale(owner.getUniqueId()).adminLockadminUnlockedIsland);
  }
 else {
    plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminUnlockedIsland);
  }
}
 else {
  Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockLocking);
  island.setLocked(true);
  if (owner != null) {
    Util.sendMessage(owner,plugin.myLocale(owner.getUniqueId()).adminLockadminLockedIsland);
  }
 else {
    plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminLockedIsland);
  }
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,plugin.myLocale().adminTopBreedersFinding);
Util.sendMessage(sender,plugin.myLocale().adminTopBreedersChecking.replace("String_Node_Str",String.valueOf(plugin.getGrid().getOwnershipMap().size())));
final List<Entity> allEntities=ASkyBlock.getIslandWorld().getEntities();
final World islandWorld=ASkyBlock.getIslandWorld();
final World netherWorld=ASkyBlock.getNetherWorld();
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
  Map<UUID,Multiset<EntityType>> result=new HashMap<UUID,Multiset<EntityType>>();
  for (  Entity entity : allEntities) {
    if (entity.getLocation().getWorld().equals(islandWorld) || entity.getLocation().getWorld().equals(netherWorld)) {
      if (entity instanceof Creature && !(entity instanceof Player)) {
        Island island=plugin.getGrid().getIslandAt(entity.getLocation());
        if (island != null && !island.isSpawn()) {
          UUID owner=island.getOwner();
          Multiset<EntityType> count=result.get(owner);
          if (count == null) {
            count=HashMultiset.create();
          }
          count.add(entity.getType());
          result.put(owner,count);
        }
      }
    }
  }
  TreeMap<Integer,List<UUID>> topEntityIslands=new TreeMap<Integer,List<UUID>>();
  for (  Entry<UUID,Multiset<EntityType>> entry : result.entrySet()) {
    int numOfEntities=entry.getValue().size();
    List<UUID> players=topEntityIslands.get(numOfEntities);
    if (players == null) {
      players=new ArrayList<UUID>();
    }
    players.add(entry.getKey());
    topEntityIslands.put(numOfEntities,players);
  }
  final TreeMap<Integer,List<UUID>> topBreeders=topEntityIslands;
  final Map<UUID,Multiset<EntityType>> finalResult=result;
  plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
    @Override public void run(){
      if (topBreeders.isEmpty()) {
        Util.sendMessage(sender,plugin.myLocale().adminTopBreedersNothing);
        return;
      }
      int rank=1;
      for (      int numOfEntities : topBreeders.descendingKeySet()) {
        if (numOfEntities > 5) {
          List<UUID> owners=topBreeders.get(numOfEntities);
          for (          UUID owner : owners) {
            Util.sendMessage(sender,"String_Node_Str" + rank + "String_Node_Str"+ plugin.getPlayers().getName(owner)+ "String_Node_Str"+ numOfEntities);
            String content="String_Node_Str";
            Multiset<EntityType> entityCount=finalResult.get(owner);
            for (            EntityType entity : entityCount.elementSet()) {
              int num=entityCount.count(entity);
              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(entity.toString()) + "String_Node_Str" + color+ num+ ChatColor.WHITE+ "String_Node_Str";
            }
            int lastComma=content.lastIndexOf("String_Node_Str");
            if (lastComma > 0) {
              content=content.substring(0,lastComma);
            }
            Util.sendMessage(sender,"String_Node_Str" + content);
          }
          rank++;
          if (rank > 10) {
            break;
          }
        }
      }
      if (rank == 1) {
        Util.sendMessage(sender,plugin.myLocale().adminTopBreedersNothing);
      }
    }
  }
);
}
}
);
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslandError);
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
player=(Player)sender;
if (!player.getLocation().getWorld().getName().equals(Settings.worldName)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorWrongWorld);
return true;
}
Location closestIsland=getClosestIsland(player.getLocation());
Island oldSpawn=plugin.getGrid().getSpawn();
Island newSpawn=plugin.getGrid().getIslandAt(closestIsland);
if (newSpawn != null && newSpawn.isSpawn()) {
plugin.getGrid().setSpawnPoint(player.getLocation());
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetSpawnset);
return true;
}
if (newSpawn != null && newSpawn.getOwner() != null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnownedBy.replace("String_Node_Str",plugin.getPlayers().getName(newSpawn.getOwner())));
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnmove);
return true;
}
if (oldSpawn != null) {
Util.sendMessage(sender,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());
newSpawn.setSpawnDefaults();
}
plugin.getGrid().setSpawn(newSpawn);
plugin.getGrid().setSpawnPoint(player.getLocation());
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale().adminSetSpawnsetting.replace("String_Node_Str",player.getLocation().getBlockX() + "String_Node_Str" + player.getLocation().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",newSpawn.getCenter().getBlockX() + "String_Node_Str" + newSpawn.getCenter().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",newSpawn.getMinX() + "String_Node_Str" + newSpawn.getMinZ())).replace("String_Node_Str",(newSpawn.getMinX() + newSpawn.getIslandDistance() - 1) + "String_Node_Str" + (newSpawn.getMinZ() + newSpawn.getIslandDistance() - 1)));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(newSpawn.getProtectionSize())));
Util.sendMessage(player,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",newSpawn.getMinProtectedX() + "String_Node_Str" + newSpawn.getMinProtectedZ())).replace("String_Node_Str",+(newSpawn.getMinProtectedX() + newSpawn.getProtectionSize() - 1) + "String_Node_Str" + (newSpawn.getMinProtectedZ() + newSpawn.getProtectionSize() - 1)));
if (newSpawn.isLocked()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
plugin.getGrid().saveGrid(true);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
Location closestIsland=getClosestIsland(((Player)sender).getLocation());
if (closestIsland == null) {
Util.sendMessage(sender,ChatColor.RED + "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(closestIsland);
if (island != null && island.isSpawn()) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminInfotitle);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",island.getCenter().getBlockX() + "String_Node_Str" + island.getCenter().getBlockZ()));
Util.sendMessage(sender,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",island.getMinX() + "String_Node_Str" + island.getMinZ())).replace("String_Node_Str",(island.getMinX() + island.getIslandDistance() - 1) + "String_Node_Str" + (island.getMinZ() + island.getIslandDistance() - 1)));
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(island.getProtectionSize())));
Util.sendMessage(sender,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",island.getMinProtectedX() + "String_Node_Str" + island.getMinProtectedZ())).replace("String_Node_Str",+(island.getMinProtectedX() + island.getProtectionSize() - 1) + "String_Node_Str" + (island.getMinProtectedZ() + island.getProtectionSize() - 1)));
if (island.isLocked()) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
return true;
}
if (island == null) {
plugin.getLogger().info("String_Node_Str" + closestIsland);
}
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(closestIsland);
if (target == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminInfounowned);
return true;
}
showInfo(target,sender);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
player=(Player)sender;
if (!VaultHelper.checkPerm(player,Settings.PERMPREFIX + "String_Node_Str") && !player.isOp()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoPermission);
return true;
}
BlockIterator iter=new BlockIterator(player,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)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminResetSignNoSign);
return true;
}
Sign sign=(Sign)lastBlock.getState();
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).adminResetSignFound);
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(player.getLocation());
if (target == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminInfounowned);
return true;
}
if (plugin.getWarpSignsListener().addWarp(target,lastBlock.getLocation())) {
sign.setLine(0,ChatColor.GREEN + plugin.myLocale().warpswelcomeLine);
sign.update(true,false);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).adminResetSignRescued.replace("String_Node_Str",plugin.getPlayers().getName(target)));
return true;
}
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminResetSignErrorExists.replace("String_Node_Str",plugin.getWarpSignsListener().getWarpOwner(lastBlock.getLocation())));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
plugin.getPlayerEvents().removeAllTempPerms();
plugin.reloadConfig();
PluginConfig.loadPluginConfig(plugin);
plugin.getChallenges().reloadChallengeConfig();
if (Settings.useEconomy && VaultHelper.setupEconomy()) {
ControlPanel.loadShop();
}
 else {
Settings.useEconomy=false;
}
ControlPanel.loadControlPanel();
if (Settings.updateCheck) {
plugin.checkUpdates();
}
 else {
plugin.setUpdateCheck(null);
}
plugin.getIslandCmd().loadSchematics();
if (plugin.getAcidTask() != null) plugin.getAcidTask().runAcidItemRemovalTask();
plugin.getPlayerEvents().giveAllTempPerms();
for (Player players : plugin.getServer().getOnlinePlayers()) {
UUID playerUUID=players.getUniqueId();
if (plugin.getPlayers().hasIsland(playerUUID) || plugin.getPlayers().inTeam(playerUUID)) {
if (Settings.resetLimit < plugin.getPlayers().getResetsLeft(playerUUID) || (Settings.resetLimit >= 0 && plugin.getPlayers().getResetsLeft(playerUUID) < 0)) {
plugin.getPlayers().setResetsLeft(playerUUID,Settings.resetLimit);
}
}
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().reloadconfigReloaded);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().adminTopTengenerating);
TopTen.topTenCreate(sender);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgealreadyRunning);
return true;
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgeusage.replace("String_Node_Str",label));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!confirmReq) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().confirmerrorTimeLimitExpired);
return true;
}
 else {
confirmOK=true;
confirmReq=false;
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (asyncPending) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorCommandNotReady);
return true;
}
plugin.getPlayers().clearResets(Settings.resetLimit);
final File playerFolder=plugin.getPlayersFolder();
asyncPending=true;
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
int done=0;
FilenameFilter ymlFilter=new FilenameFilter(){
@Override public boolean accept(File dir,String name){
  String lowercaseName=name.toLowerCase();
  if (lowercaseName.endsWith("String_Node_Str")) {
    return true;
  }
 else {
    return false;
  }
}
}
;
for (File file : playerFolder.listFiles(ymlFilter)) {
List<String> playerFileContents=new ArrayList<String>();
done++;
try {
  Scanner scanner=new Scanner(file);
  while (scanner.hasNextLine()) {
    final String lineFromFile=scanner.nextLine();
    if (lineFromFile.contains("String_Node_Str")) {
      playerFileContents.add("String_Node_Str" + Settings.resetLimit);
    }
 else {
      playerFileContents.add(lineFromFile);
    }
  }
  scanner.close();
  try (FileWriter writer=new FileWriter(file)){
    for (    String str : playerFileContents) {
      writer.write(str + "String_Node_Str");
    }
  }
   if (done % 500 == 0) {
    final int update=done;
    plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
      @Override public void run(){
        Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().clearedResetLimit + "String_Node_Str"+ update+ "String_Node_Str");
      }
    }
);
  }
}
 catch (FileNotFoundException e) {
  e.printStackTrace();
}
catch (IOException e) {
  e.printStackTrace();
}
}
asyncPending=false;
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().clearedResetLimit + "String_Node_Str"+ done+ "String_Node_Str");
}
}
);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return false;
}
case 2:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (asyncPending) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorCommandNotReady);
return true;
}
if (plugin.getAvailableLocales().keySet().contains(split[1])) {
try {
Util.setConfig("String_Node_Str",Settings.defaultLanguage,split[1]);
}
 catch (IOException e) {
Util.sendMessage(sender,ChatColor.RED + e.getMessage());
return true;
}
plugin.getConfig().set("String_Node_Str",split[1]);
Settings.defaultLanguage=split[1];
HashMap<String,ASLocale> availableLocales=new HashMap<String,ASLocale>();
FileLister fl=new FileLister(plugin);
try {
int index=1;
for (String code : fl.list()) {
availableLocales.put(code,new ASLocale(plugin,code,index++));
}
}
 catch (IOException e1) {
plugin.getLogger().severe("String_Node_Str");
}
if (!availableLocales.containsKey(Settings.defaultLanguage)) {
plugin.getLogger().severe("String_Node_Str" + Settings.defaultLanguage + "String_Node_Str");
Settings.defaultLanguage="String_Node_Str";
availableLocales.put(Settings.defaultLanguage,new ASLocale(plugin,Settings.defaultLanguage,0));
}
plugin.setAvailableLocales(availableLocales);
for (UUID onlinePlayer : plugin.getPlayers().getOnlineCachedPlayers()) {
plugin.getPlayers().setLocale(onlinePlayer,Settings.defaultLanguage);
}
final File playerFolder=plugin.getPlayersFolder();
asyncPending=true;
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
try {
Util.setPlayerYamlConfig(playerFolder,"String_Node_Str",Settings.defaultLanguage);
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
  @Override public void run(){
    Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
    asyncPending=false;
  }
}
);
}
 catch (final IOException e) {
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
  @Override public void run(){
    Util.sendMessage(sender,ChatColor.RED + e.getMessage());
    asyncPending=false;
  }
}
);
}
}
}
);
Util.sendMessage(sender,ChatColor.RED + plugin.getAvailableLocales().keySet().toString());
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (playerUUID == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
if (sender instanceof Player) {
plugin.getIslandCmd().calculateIslandLevel(sender,playerUUID,false);
}
 else {
plugin.getIslandCmd().calculateIslandLevel(sender,playerUUID,true);
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
split[1]=split[1].toLowerCase();
if (!Settings.challengeList.contains(split[1])) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getChallenges().clearChallengeReset(split[1]);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!Settings.challengeList.contains(split[1].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getChallenges().resetChallengeForAll(split[1].toLowerCase(),0L,"String_Node_Str");
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
plugin.reloadConfig();
PluginConfig.loadPluginConfig(plugin);
if (split[1].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetInProgress);
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
for (Island island : plugin.getGrid().getOwnedIslands().values()) {
island.setIgsDefaults();
}
for (Island island : plugin.getGrid().getUnownedIslands().values()) {
island.setIgsDefaults();
}
plugin.getGrid().saveGrid();
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
@Override public void run(){
plugin.getWarpPanel().updateAllWarpText();
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetDone);
}
}
);
}
}
);
return true;
}
 else {
for (SettingsFlag flag : SettingsFlag.values()) {
if (split[1].equalsIgnoreCase(flag.toString())) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetInProgress);
final SettingsFlag flagToSet=flag;
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
for (Island island : plugin.getGrid().getOwnedIslands().values()) {
  island.setIgsFlag(flagToSet,Settings.defaultIslandSettings.get(flagToSet));
}
for (Island island : plugin.getGrid().getUnownedIslands().values()) {
  island.setIgsFlag(flagToSet,Settings.defaultIslandSettings.get(flagToSet));
}
plugin.getGrid().saveGrid();
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
  @Override public void run(){
    if (flagToSet.equals(SettingsFlag.PVP) || flagToSet.equals(SettingsFlag.NETHER_PVP)) {
      plugin.getWarpPanel().updateAllWarpText();
    }
    Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetDone);
  }
}
);
}
}
);
return true;
}
}
Util.sendMessage(sender,plugin.myLocale().helpColor + "String_Node_Str" + label+ "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpSettingsReset);
Util.sendMessage(sender,ChatColor.GREEN + "String_Node_Str");
String commaList="String_Node_Str";
for (SettingsFlag flag : SettingsFlag.values()) {
commaList+="String_Node_Str" + flag.toString();
}
Util.sendMessage(sender,commaList);
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
Player p=(Player)sender;
if (!VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str") && !p.isOp()) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorNoPermission);
return true;
}
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
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)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(p.getUniqueId()).adminResetSignNoSign);
return true;
}
Sign sign=(Sign)lastBlock.getState();
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
Island island=plugin.getGrid().getIslandAt(islandLoc);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorNoIsland);
return true;
}
if (!island.inIslandSpace(sign.getLocation())) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).adminSetHomeNotOnPlayersIsland);
}
 else {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminResetSignFound);
if (plugin.getWarpSignsListener().addWarp(playerUUID,lastBlock.getLocation())) {
sign.setLine(0,ChatColor.GREEN + plugin.myLocale().warpswelcomeLine);
sign.update();
Util.sendMessage(p,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminResetSignRescued.replace("String_Node_Str",plugin.getPlayers().getName(playerUUID)));
return true;
}
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(p.getUniqueId()).adminResetSignErrorExists.replace("String_Node_Str",plugin.getWarpSignsListener().getWarpOwner(lastBlock.getLocation())));
}
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!split[1].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslandError);
return true;
}
Island island=plugin.getGrid().getIslandAt(((Player)sender).getLocation());
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslandnoid);
return true;
}
UUID owner=island.getOwner();
String name="String_Node_Str";
if (owner != null) {
name=plugin.getPlayers().getName(owner);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnownedBy.replace("String_Node_Str",name));
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslanduse.replace("String_Node_Str",name));
return true;
}
 else {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().deleteremoving.replace("String_Node_Str",name));
deleteIslands(island,sender);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
plugin.getGrid().setIslandName(playerUUID,null);
Util.sendMessage(sender,plugin.myLocale().generalSuccess);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
Location safeHome=plugin.getGrid().getSafeHomeLocation(playerUUID,1);
if (safeHome == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetHomeNoneFound);
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,safeHome);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetHomeHomeSet.replace("String_Node_Str",safeHome.getBlockX() + "String_Node_Str" + safeHome.getBlockY()+ "String_Node_Str"+ safeHome.getBlockZ()));
}
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoIslandOther);
return true;
}
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
Island island=plugin.getGrid().getIslandAt(islandLoc);
if (island == null || !island.inIslandSpace(player.getLocation())) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminSetHomeNotOnPlayersIsland);
}
 else {
if (!GridManager.isSafeLocation(player.getLocation())) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminSetHomeNoneFound);
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,player.getLocation());
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).adminSetHomeHomeSet.replace("String_Node_Str",player.getLocation().getBlockX() + "String_Node_Str" + player.getLocation().getBlockY()+ "String_Node_Str"+ player.getLocation().getBlockZ()));
}
}
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
UUID playerUUID=player.getUniqueId();
Island island=plugin.getGrid().getIslandAt(player.getLocation());
if (island == null) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().errorNotOnIsland);
return true;
}
 else {
int newRange=10;
int maxRange=Settings.islandDistance;
if (island.isSpawn()) {
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid);
return true;
}
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
if (newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(playerUUID).adminSetRangeWarning.replace("String_Node_Str",String.valueOf(maxRange)));
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeWarning2);
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",island.getCenter().getBlockX() + "String_Node_Str" + island.getCenter().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",island.getMinX() + "String_Node_Str" + island.getMinZ()).replace("String_Node_Str",(island.getMinX() + island.getIslandDistance() - 1) + "String_Node_Str" + (island.getMinZ() + island.getIslandDistance() - 1)));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(island.getProtectionSize())));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",island.getMinProtectedX() + "String_Node_Str" + island.getMinProtectedZ()).replace("String_Node_Str",+(island.getMinProtectedX() + island.getProtectionSize() - 1) + "String_Node_Str" + (island.getMinProtectedZ() + island.getProtectionSize() - 1)));
if (island.isLocked()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
}
 else {
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(island.getOwner(),sender);
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
UUID playerUUID=player.getUniqueId();
Island island=plugin.getGrid().getIslandAt(player.getLocation());
if (island == null) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().errorNotOnIsland);
return true;
}
 else {
int newRange=island.getProtectionSize();
int maxRange=Settings.islandDistance;
if (island.isSpawn()) {
try {
newRange=Integer.valueOf(split[1]) + island.getProtectionSize();
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid);
return true;
}
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
if (newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(playerUUID).adminSetRangeWarning.replace("String_Node_Str",String.valueOf(maxRange)));
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeWarning2);
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",island.getCenter().getBlockX() + "String_Node_Str" + island.getCenter().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",island.getMinX() + "String_Node_Str" + island.getMinZ()).replace("String_Node_Str",(island.getMinX() + island.getIslandDistance() - 1) + "String_Node_Str" + (island.getMinZ() + island.getIslandDistance() - 1)));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(island.getProtectionSize())));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",island.getMinProtectedX() + "String_Node_Str" + island.getMinProtectedZ()).replace("String_Node_Str",+(island.getMinProtectedX() + island.getProtectionSize() - 1) + "String_Node_Str" + (island.getMinProtectedZ() + island.getProtectionSize() - 1)));
if (island.isLocked()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
}
 else {
try {
newRange=Integer.valueOf(split[1]) + island.getProtectionSize();
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(island.getOwner(),sender);
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (split[1].equalsIgnoreCase("String_Node_Str") || split[1].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
Player p=(Player)sender;
if (!p.getLocation().getWorld().equals(ASkyBlock.getIslandWorld()) && !p.getLocation().getWorld().equals(ASkyBlock.getNetherWorld())) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorWrongWorld);
return true;
}
Island island=plugin.getGrid().getIslandAt(p.getLocation());
if (island == null) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorNoIslandOther);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
island.setPurgeProtected(true);
}
 else {
island.setPurgeProtected(false);
}
if (island.isPurgeProtected()) {
Util.sendMessage(p,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminPreventPurge);
}
 else {
Util.sendMessage(p,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminAllowPurge);
}
return true;
}
if (purgeFlag) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgealreadyRunning);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
countUnowned(sender);
return true;
}
purgeFlag=true;
final int time;
try {
time=Integer.parseInt(split[1]) * 24;
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgeusage.replace("String_Node_Str",label));
purgeFlag=false;
return true;
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgecalculating.replace("String_Node_Str",split[1]));
for (Entry<UUID,Island> entry : plugin.getGrid().getOwnershipMap().entrySet()) {
if (entry.getKey() != null && !entry.getValue().isPurgeProtected()) {
if (Bukkit.getOfflinePlayer(entry.getKey()).hasPlayedBefore()) {
long offlineTime=Bukkit.getOfflinePlayer(entry.getKey()).getLastPlayed();
offlineTime=(System.currentTimeMillis() - offlineTime) / 3600000L;
if (offlineTime > time) {
removeList.add(entry.getKey());
}
}
 else {
removeList.add(entry.getKey());
}
}
}
if (removeList.isEmpty()) {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgenoneFound);
purgeFlag=false;
return true;
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgethisWillRemove.replace("String_Node_Str",String.valueOf(removeList.size())).replace("String_Node_Str",String.valueOf(Settings.abandonedIslandLevel)));
long runtime=removeList.size() * 2L;
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgeEstimatedRunTime.replace("String_Node_Str",String.format("String_Node_Str",runtime / 3600,(runtime % 3600) / 60,(runtime % 60))));
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgewarning);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgetypeConfirm.replace("String_Node_Str",label));
if (removeList.size() > Settings.maxPurge) {
Util.sendMessage(sender,plugin.myLocale().purgeLimit.replace("String_Node_Str",String.valueOf(Settings.maxPurge)));
Iterator<UUID> it=removeList.iterator();
int count=1;
while (it.hasNext()) {
it.next();
if (count++ > Settings.maxPurge) {
it.remove();
}
}
}
confirmReq=true;
confirmOK=false;
confirmTimer=0;
new BukkitRunnable(){
@Override public void run(){
if (confirmTimer++ > 10) {
confirmReq=false;
confirmOK=false;
purgeFlag=false;
removeList.clear();
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgepurgeCancelled);
this.cancel();
}
 else if (confirmOK) {
final int total=removeList.size();
new BukkitRunnable(){
@Override public void run(){
if (removeList.isEmpty() && purgeFlag) {
purgeFlag=false;
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgefinished);
this.cancel();
}
if (removeList.size() > 0 && purgeFlag) {
if (plugin.getServer().getPlayer(removeList.get(0)) == null) {
if (plugin.getPlayers().getIslandLevel(removeList.get(0)) < Settings.abandonedIslandLevel) {
  Util.sendMessage(sender,ChatColor.YELLOW + "String_Node_Str" + (total - removeList.size() + 1)+ "String_Node_Str"+ total+ "String_Node_Str"+ plugin.myLocale().purgeremovingName.replace("String_Node_Str",plugin.getPlayers().getName(removeList.get(0))));
  plugin.deletePlayerIsland(removeList.get(0),true);
}
}
 else {
Util.sendMessage(sender,ChatColor.YELLOW + "String_Node_Str" + (total - removeList.size() + 1)+ "String_Node_Str"+ total+ "String_Node_Str"+ "String_Node_Str");
}
removeList.remove(0);
}
}
}
.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],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Island island=plugin.getGrid().getIsland(playerUUID);
if (island != null) {
Player owner=plugin.getServer().getPlayer(island.getOwner());
if (island.isLocked()) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockUnlocking);
island.setLocked(false);
if (owner != null) {
owner.sendMessage(plugin.myLocale(owner.getUniqueId()).adminLockadminUnlockedIsland);
}
 else {
plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminUnlockedIsland);
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockLocking);
island.setLocked(true);
if (owner != null) {
Util.sendMessage(owner,plugin.myLocale(owner.getUniqueId()).adminLockadminLockedIsland);
}
 else {
plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminLockedIsland);
}
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.GREEN + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ plugin.getPlayers().getDeaths(playerUUID)+ "String_Node_Str"+ plugin.myLocale().deaths);
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpsetDeaths);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
plugin.getPlayers().setResetsLeft(playerUUID,Settings.resetLimit);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().clearedResetLimit + "String_Node_Str"+ Settings.resetLimit+ "String_Node_Str");
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return true;
}
player=(Player)sender;
final UUID targetUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(targetUUID)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().hasIsland(targetUUID) || plugin.getPlayers().inTeam(targetUUID)) {
Location warpSpot=plugin.getPlayers().getIslandLocation(targetUUID).toVector().toLocation(ASkyBlock.getIslandWorld());
String failureMessage=ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminTpManualWarp.replace("String_Node_Str",warpSpot.getBlockX() + "String_Node_Str" + warpSpot.getBlockY()+ "String_Node_Str"+ warpSpot.getBlockZ());
Location home=plugin.getPlayers().getHomeLocation(targetUUID);
plugin.getGrid();
if (home != null && home.getWorld().equals(ASkyBlock.getIslandWorld()) && GridManager.isSafeLocation(home)) {
player.teleport(home);
return true;
}
new SafeTeleportBuilder(plugin).entity(player).location(warpSpot).failureMessage(failureMessage).build();
return true;
}
Util.sendMessage(sender,plugin.myLocale().errorNoIslandOther);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!Settings.createNether || !Settings.newNether || ASkyBlock.getNetherWorld() == null) {
return false;
}
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return true;
}
player=(Player)sender;
final UUID targetUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(targetUUID)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().hasIsland(targetUUID) || plugin.getPlayers().inTeam(targetUUID)) {
Location warpSpot=plugin.getPlayers().getIslandLocation(targetUUID).toVector().toLocation(ASkyBlock.getNetherWorld());
String failureMessage=ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminTpManualWarp.replace("String_Node_Str",warpSpot.getBlockX() + "String_Node_Str" + warpSpot.getBlockY()+ "String_Node_Str"+ warpSpot.getBlockZ());
Location home=plugin.getPlayers().getHomeLocation(targetUUID);
plugin.getGrid();
if (home != null && home.getWorld().equals(ASkyBlock.getNetherWorld()) && GridManager.isSafeLocation(home)) {
player.teleport(home);
return true;
}
new SafeTeleportBuilder(plugin).entity(player).location(warpSpot).failureMessage(failureMessage).build();
return true;
}
Util.sendMessage(sender,plugin.myLocale().errorNoIslandOther);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().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) {
player=(Player)sender;
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Location islandLoc=plugin.getGrid().getClosestIsland(player.getLocation());
Island island=plugin.getGrid().getIslandAt(islandLoc);
if (island == null) {
plugin.getIslandCmd().reserveLocation(playerUUID,islandLoc);
Util.sendMessage(sender,ChatColor.GREEN + "String_Node_Str" + islandLoc.getBlockX()+ "String_Node_Str"+ islandLoc.getBlockZ()+ "String_Node_Str"+ plugin.myLocale().generalSuccess);
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminReserveIslandExists);
}
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (sender instanceof Player) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
if (adminSetPlayerIsland(sender,((Player)sender).getLocation(),playerUUID)) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().registersettingIsland.replace("String_Node_Str",split[1]));
plugin.getGrid().saveGrid();
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().registererrorBedrockNotFound);
}
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminUnregisterOnTeam);
return true;
}
Location island=plugin.getPlayers().getIslandLocation(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminUnregisterKeepBlocks.replace("String_Node_Str",+plugin.getPlayers().getIslandLocation(playerUUID).getBlockX() + "String_Node_Str" + plugin.getPlayers().getIslandLocation(playerUUID).getBlockZ()));
plugin.deletePlayerIsland(playerUUID,false);
plugin.getGrid().saveGrid();
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().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],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
plugin.getPlayers().resetAllChallenges(playerUUID,true);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().resetChallengessuccess.replace("String_Node_Str",split[1]));
return true;
}
 else {
return false;
}
case 3:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!Settings.challengeList.contains(split[1].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
split[2]=split[2].trim();
if (split[2].length() > 1 && (split[2].toLowerCase().endsWith("String_Node_Str") || split[2].toLowerCase().endsWith("String_Node_Str") || split[2].toLowerCase().endsWith("String_Node_Str"))) {
char unit=split[2].charAt(split[2].length() - 1);
String value=split[2].substring(0,split[2].length() - 1);
try {
long repeat=0;
int number=Integer.valueOf(value);
switch (unit) {
case 'm':
repeat=60000L * number;
break;
case 'h':
repeat=60000L * 60 * number;
break;
case 'd':
repeat=60000L * 60 * 24* number;
break;
}
plugin.getChallenges().resetChallengeForAll(split[1].toLowerCase(),repeat,split[2]);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
}
 catch (Exception e) {
e.printStackTrace();
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminResetChallengeForAllError);
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminResetChallengeForAllError);
return true;
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgealreadyRunning);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str") && split[2].equalsIgnoreCase("String_Node_Str")) {
if (!purgeUnownedConfirm) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().confirmerrorTimeLimitExpired);
return true;
}
 else {
purgeUnownedConfirm=false;
purgeUnownedIslands(sender);
return true;
}
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
playerUUID=plugin.getPlayers().getTeamLeader(playerUUID);
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
 else {
int newRange=0;
int maxRange=Settings.islandDistance;
try {
newRange=Integer.valueOf(split[2]) + island.getProtectionSize();
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(playerUUID,sender);
plugin.getGrid().saveGrid();
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
playerUUID=plugin.getPlayers().getTeamLeader(playerUUID);
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
 else {
int newRange=0;
int maxRange=Settings.islandDistance;
try {
newRange=Integer.valueOf(split[2]);
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(playerUUID,sender);
plugin.getGrid().saveGrid();
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
try {
int newDeaths=Integer.valueOf(split[2]);
int oldDeaths=plugin.getPlayers().getDeaths(playerUUID);
plugin.getPlayers().setDeaths(playerUUID,newDeaths);
Util.sendMessage(sender,ChatColor.GREEN + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ oldDeaths+ "String_Node_Str"+ newDeaths+ "String_Node_Str"+ plugin.myLocale().deaths);
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ plugin.getPlayers().getDeaths(playerUUID)+ "String_Node_Str"+ plugin.myLocale().deaths);
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpsetDeaths);
return true;
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
playerUUID=plugin.getPlayers().getTeamLeader(playerUUID);
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIsland);
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)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
Util.sendMessage(sender,b.name());
}
}
return true;
}
biomeName=plugin.getConfig().getString("String_Node_Str" + biomeName + "String_Node_Str",Util.prettifyText(biomeName));
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
Util.sendMessage(sender,b.name());
}
}
return true;
}
new SetBiome(plugin,island,biome,sender);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().biomeSet.replace("String_Node_Str",biomeName));
Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
if (targetPlayer != null) {
Util.sendMessage(targetPlayer,"String_Node_Str" + ChatColor.GREEN + plugin.myLocale(playerUUID).biomeSet.replace("String_Node_Str",biomeName));
}
 else {
plugin.getMessages().setMessage(playerUUID,"String_Node_Str" + ChatColor.GREEN + plugin.myLocale(playerUUID).biomeSet.replace("String_Node_Str",biomeName));
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
if (!plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoTeam);
return true;
}
UUID teamLeader=plugin.getPlayers().getTeamLeader(playerUUID);
if (teamLeader == null) {
if (!plugin.getPlayers().setLeaveTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
plugin.getPlayers().setHomeLocation(playerUUID,null);
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getWarpSignsListener().removeWarp(playerUUID);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().kicknameRemoved.replace("String_Node_Str",split[2]));
plugin.getPlayers().save(playerUUID);
return true;
}
if (!teamLeader.equals(playerUUID)) {
if (!plugin.getPlayers().setLeaveTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
plugin.getPlayers().setHomeLocation(playerUUID,null);
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getPlayers().removeMember(teamLeader,playerUUID);
if (plugin.getPlayers().getMembers(teamLeader).size() < 2) {
if (!plugin.getPlayers().setLeaveTeam(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
}
plugin.getWarpSignsListener().removeWarp(playerUUID);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().kicknameRemoved.replace("String_Node_Str",split[2]));
plugin.getPlayers().save(playerUUID);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.RED + (plugin.myLocale().adminTeamKickLeader.replace("String_Node_Str",label)).replace("String_Node_Str",split[2]));
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return false;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().checkChallenge(playerUUID,split[2].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[2].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().completeChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().get(playerUUID).completeChallenge(split[2].toLowerCase());
plugin.getPlayers().save(playerUUID);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().completeChallengechallangeCompleted.replace("String_Node_Str",split[2].toLowerCase()).replace("String_Node_Str",split[1]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (!plugin.getPlayers().checkChallenge(playerUUID,split[2].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[2].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().resetChallenge(playerUUID,split[2].toLowerCase());
plugin.getPlayers().save(playerUUID);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().resetChallengechallengeReset.replace("String_Node_Str",split[2].toLowerCase()).replace("String_Node_Str",split[1]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") && split[1].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().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],true);
final Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
final UUID teamLeader=plugin.getPlayers().getUUID(split[3],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID) || !plugin.getPlayers().isAKnownPlayer(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (playerUUID.equals(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminTeamAddLeaderToOwn);
return true;
}
if (!plugin.getPlayers().hasIsland(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminTeamAddLeaderNoIsland);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().inviteerrorThatPlayerIsAlreadyInATeam);
return true;
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(teamLeader)) {
if (!plugin.getPlayers().setJoinTeam(teamLeader,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader))) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
plugin.getPlayers().addTeamMember(teamLeader,teamLeader);
Util.sendMessage(sender,ChatColor.GOLD + plugin.myLocale().adminTeamAddedLeader);
}
if (targetPlayer != null) {
Util.runCommand(targetPlayer,Settings.ISLANDCOMMAND + "String_Node_Str");
}
if (plugin.getPlayers().hasIsland(playerUUID)) {
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
if (islandLoc != null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminTeamNowUnowned.replace("String_Node_Str",plugin.getPlayers().getName(playerUUID)).replace("String_Node_Str",islandLoc.getBlockX() + "String_Node_Str" + islandLoc.getBlockZ()));
}
}
plugin.deletePlayerIsland(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));
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminTeamSettingHome);
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getIslandLocation(teamLeader));
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminTeamSettingHome);
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(playerUUID)) {
plugin.getPlayers().addTeamMember(teamLeader,playerUUID);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminTeamAddingPlayer);
}
 else {
Util.sendMessage(sender,ChatColor.GOLD + plugin.myLocale().adminTeamAlreadyOnTeam);
}
if (targetPlayer != null) {
plugin.getGrid().homeTeleport(targetPlayer);
}
plugin.getGrid().saveGrid();
return true;
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return false;
}
default :
return false;
}
}

Fixed version (ground truth):
@Override 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 (player.getUniqueId() == null) {
      return false;
    }
    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")|| 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)) {
          Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoPermission);
          return true;
        }
      }
 else {
        if (!checkModPerms(player,split)) {
          Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoPermission);
          return true;
        }
      }
    }
  }
  if (split.length > 1 && split[0].equalsIgnoreCase("String_Node_Str")) {
    final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
    if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
      Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
      return true;
    }
 else {
      if (split.length == 2) {
        Util.sendMessage(sender,plugin.getGrid().getIslandName(playerUUID));
      }
 else {
        String name=split[2];
        for (int i=3; i < split.length; i++) {
          name=name + "String_Node_Str" + split[i];
        }
        if (name.length() < Settings.minNameLength) {
          Util.sendMessage(sender,ChatColor.RED + (plugin.myLocale().errorTooShort).replace("String_Node_Str",String.valueOf(Settings.minNameLength)));
          return true;
        }
        if (name.length() > Settings.maxNameLength) {
          Util.sendMessage(sender,ChatColor.RED + (plugin.myLocale().errorTooLong).replace("String_Node_Str",String.valueOf(Settings.maxNameLength)));
          return true;
        }
        plugin.getGrid().setIslandName(playerUUID,ChatColor.translateAlternateColorCodes('&',name));
        Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
      }
      return true;
    }
  }
switch (split.length) {
case 0:
    help(sender,label);
  return true;
case 1:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
  Util.sendMessage(sender,plugin.myLocale().helpColor + plugin.myLocale().adminHelpsetLanguage);
  return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
for (String challenge : plugin.getChallenges().getRepeatingChallengeResets()) {
  Util.sendMessage(sender,ChatColor.GREEN + challenge);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (LavaCheck.getStats().size() == 0) {
  Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().banNone);
  return true;
}
for (Long level : LavaCheck.getStats().keySet()) {
  if (level == Long.MIN_VALUE) {
    Util.sendMessage(sender,plugin.myLocale().challengeslevel + "String_Node_Str");
  }
 else {
    Util.sendMessage(sender,plugin.myLocale().challengeslevel + "String_Node_Str" + level);
  }
  Collection<String> result=new TreeSet<String>(Collator.getInstance());
  for (  Material mat : LavaCheck.getStats().get(level).elementSet()) {
    result.add("String_Node_Str" + Util.prettifyText(mat.toString()) + "String_Node_Str"+ LavaCheck.getStats().get(level).count(mat)+ "String_Node_Str"+ LavaCheck.getStats().get(level).size()+ "String_Node_Str"+ ((long)((double)LavaCheck.getStats().get(level).count(mat) / LavaCheck.getStats().get(level).size() * 100))+ "String_Node_Str"+ String.valueOf(LavaCheck.getConfigChances(level,mat))+ "String_Node_Str");
  }
  for (  String r : result) {
    Util.sendMessage(sender,r);
  }
}
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpsetDeaths);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str");
return true;
}
 else if (Settings.teamChat && split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
if (VaultHelper.checkPerm(player,Settings.PERMPREFIX + "String_Node_Str") || player.isOp()) {
if (plugin.getChatListener().toggleSpy(player.getUniqueId())) {
  Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().teamChatSpyStatusOn);
}
 else {
  Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().teamChatSpyStatusOff);
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
Island island=plugin.getGrid().getIslandAt(player.getLocation());
if (island == null) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNotOnIsland);
return true;
}
 else {
Player owner=plugin.getServer().getPlayer(island.getOwner());
if (island.isLocked()) {
  Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockUnlocking);
  island.setLocked(false);
  if (owner != null) {
    Util.sendMessage(owner,plugin.myLocale(owner.getUniqueId()).adminLockadminUnlockedIsland);
  }
 else {
    plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminUnlockedIsland);
  }
}
 else {
  Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockLocking);
  island.setLocked(true);
  if (owner != null) {
    Util.sendMessage(owner,plugin.myLocale(owner.getUniqueId()).adminLockadminLockedIsland);
  }
 else {
    plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminLockedIsland);
  }
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,plugin.myLocale().adminTopBreedersFinding);
Util.sendMessage(sender,plugin.myLocale().adminTopBreedersChecking.replace("String_Node_Str",String.valueOf(plugin.getGrid().getOwnershipMap().size())));
final List<Entity> allEntities=ASkyBlock.getIslandWorld().getEntities();
final World islandWorld=ASkyBlock.getIslandWorld();
final World netherWorld=ASkyBlock.getNetherWorld();
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
  Map<UUID,Multiset<EntityType>> result=new HashMap<UUID,Multiset<EntityType>>();
  for (  Entity entity : allEntities) {
    if (entity.getLocation().getWorld().equals(islandWorld) || entity.getLocation().getWorld().equals(netherWorld)) {
      if (entity instanceof Creature && !(entity instanceof Player)) {
        Island island=plugin.getGrid().getIslandAt(entity.getLocation());
        if (island != null && !island.isSpawn()) {
          UUID owner=island.getOwner();
          Multiset<EntityType> count=result.get(owner);
          if (count == null) {
            count=HashMultiset.create();
          }
          count.add(entity.getType());
          result.put(owner,count);
        }
      }
    }
  }
  TreeMap<Integer,List<UUID>> topEntityIslands=new TreeMap<Integer,List<UUID>>();
  for (  Entry<UUID,Multiset<EntityType>> entry : result.entrySet()) {
    int numOfEntities=entry.getValue().size();
    List<UUID> players=topEntityIslands.get(numOfEntities);
    if (players == null) {
      players=new ArrayList<UUID>();
    }
    players.add(entry.getKey());
    topEntityIslands.put(numOfEntities,players);
  }
  final TreeMap<Integer,List<UUID>> topBreeders=topEntityIslands;
  final Map<UUID,Multiset<EntityType>> finalResult=result;
  plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
    @Override public void run(){
      if (topBreeders.isEmpty()) {
        Util.sendMessage(sender,plugin.myLocale().adminTopBreedersNothing);
        return;
      }
      int rank=1;
      for (      int numOfEntities : topBreeders.descendingKeySet()) {
        if (numOfEntities > 5) {
          List<UUID> owners=topBreeders.get(numOfEntities);
          for (          UUID owner : owners) {
            Util.sendMessage(sender,"String_Node_Str" + rank + "String_Node_Str"+ plugin.getPlayers().getName(owner)+ "String_Node_Str"+ numOfEntities);
            String content="String_Node_Str";
            Multiset<EntityType> entityCount=finalResult.get(owner);
            for (            EntityType entity : entityCount.elementSet()) {
              int num=entityCount.count(entity);
              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(entity.toString()) + "String_Node_Str" + color+ num+ ChatColor.WHITE+ "String_Node_Str";
            }
            int lastComma=content.lastIndexOf("String_Node_Str");
            if (lastComma > 0) {
              content=content.substring(0,lastComma);
            }
            Util.sendMessage(sender,"String_Node_Str" + content);
          }
          rank++;
          if (rank > 10) {
            break;
          }
        }
      }
      if (rank == 1) {
        Util.sendMessage(sender,plugin.myLocale().adminTopBreedersNothing);
      }
    }
  }
);
}
}
);
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslandError);
return true;
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
player=(Player)sender;
if (!player.getLocation().getWorld().getName().equals(Settings.worldName)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorWrongWorld);
return true;
}
Location closestIsland=getClosestIsland(player.getLocation());
Island oldSpawn=plugin.getGrid().getSpawn();
Island newSpawn=plugin.getGrid().getIslandAt(closestIsland);
if (newSpawn != null && newSpawn.isSpawn()) {
plugin.getGrid().setSpawnPoint(player.getLocation());
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetSpawnset);
return true;
}
if (newSpawn != null && newSpawn.getOwner() != null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnownedBy.replace("String_Node_Str",plugin.getPlayers().getName(newSpawn.getOwner())));
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnmove);
return true;
}
if (oldSpawn != null) {
Util.sendMessage(sender,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());
newSpawn.setSpawnDefaults();
}
plugin.getGrid().setSpawn(newSpawn);
plugin.getGrid().setSpawnPoint(player.getLocation());
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale().adminSetSpawnsetting.replace("String_Node_Str",player.getLocation().getBlockX() + "String_Node_Str" + player.getLocation().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",newSpawn.getCenter().getBlockX() + "String_Node_Str" + newSpawn.getCenter().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",newSpawn.getMinX() + "String_Node_Str" + newSpawn.getMinZ())).replace("String_Node_Str",(newSpawn.getMinX() + newSpawn.getIslandDistance() - 1) + "String_Node_Str" + (newSpawn.getMinZ() + newSpawn.getIslandDistance() - 1)));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(newSpawn.getProtectionSize())));
Util.sendMessage(player,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",newSpawn.getMinProtectedX() + "String_Node_Str" + newSpawn.getMinProtectedZ())).replace("String_Node_Str",+(newSpawn.getMinProtectedX() + newSpawn.getProtectionSize() - 1) + "String_Node_Str" + (newSpawn.getMinProtectedZ() + newSpawn.getProtectionSize() - 1)));
if (newSpawn.isLocked()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
plugin.getGrid().saveGrid(true);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") || split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
Location closestIsland=getClosestIsland(((Player)sender).getLocation());
if (closestIsland == null) {
Util.sendMessage(sender,ChatColor.RED + "String_Node_Str");
return true;
}
Island island=plugin.getGrid().getIslandAt(closestIsland);
if (island != null && island.isSpawn()) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminInfotitle);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",island.getCenter().getBlockX() + "String_Node_Str" + island.getCenter().getBlockZ()));
Util.sendMessage(sender,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",island.getMinX() + "String_Node_Str" + island.getMinZ())).replace("String_Node_Str",(island.getMinX() + island.getIslandDistance() - 1) + "String_Node_Str" + (island.getMinZ() + island.getIslandDistance() - 1)));
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(island.getProtectionSize())));
Util.sendMessage(sender,ChatColor.YELLOW + (plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",island.getMinProtectedX() + "String_Node_Str" + island.getMinProtectedZ())).replace("String_Node_Str",+(island.getMinProtectedX() + island.getProtectionSize() - 1) + "String_Node_Str" + (island.getMinProtectedZ() + island.getProtectionSize() - 1)));
if (island.isLocked()) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
return true;
}
if (island == null) {
plugin.getLogger().info("String_Node_Str" + closestIsland);
}
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(closestIsland);
if (target == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminInfounowned);
return true;
}
showInfo(target,sender);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
player=(Player)sender;
if (!VaultHelper.checkPerm(player,Settings.PERMPREFIX + "String_Node_Str") && !player.isOp()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoPermission);
return true;
}
BlockIterator iter=new BlockIterator(player,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)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminResetSignNoSign);
return true;
}
Sign sign=(Sign)lastBlock.getState();
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).adminResetSignFound);
UUID target=plugin.getPlayers().getPlayerFromIslandLocation(player.getLocation());
if (target == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminInfounowned);
return true;
}
if (plugin.getWarpSignsListener().addWarp(target,lastBlock.getLocation())) {
sign.setLine(0,ChatColor.GREEN + plugin.myLocale().warpswelcomeLine);
sign.update(true,false);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).adminResetSignRescued.replace("String_Node_Str",plugin.getPlayers().getName(target)));
return true;
}
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminResetSignErrorExists.replace("String_Node_Str",plugin.getWarpSignsListener().getWarpOwner(lastBlock.getLocation())));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
plugin.getPlayerEvents().removeAllTempPerms();
plugin.reloadConfig();
PluginConfig.loadPluginConfig(plugin);
plugin.getChallenges().reloadChallengeConfig();
if (Settings.useEconomy && VaultHelper.setupEconomy()) {
ControlPanel.loadShop();
}
 else {
Settings.useEconomy=false;
}
ControlPanel.loadControlPanel();
if (Settings.updateCheck) {
plugin.checkUpdates();
}
 else {
plugin.setUpdateCheck(null);
}
plugin.getIslandCmd().loadSchematics();
if (plugin.getAcidTask() != null) plugin.getAcidTask().runAcidItemRemovalTask();
plugin.getPlayerEvents().giveAllTempPerms();
for (Player players : plugin.getServer().getOnlinePlayers()) {
UUID playerUUID=players.getUniqueId();
if (plugin.getPlayers().hasIsland(playerUUID) || plugin.getPlayers().inTeam(playerUUID)) {
if (Settings.resetLimit < plugin.getPlayers().getResetsLeft(playerUUID) || (Settings.resetLimit >= 0 && plugin.getPlayers().getResetsLeft(playerUUID) < 0)) {
plugin.getPlayers().setResetsLeft(playerUUID,Settings.resetLimit);
}
}
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().reloadconfigReloaded);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().adminTopTengenerating);
TopTen.topTenCreate(sender);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgealreadyRunning);
return true;
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgeusage.replace("String_Node_Str",label));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!confirmReq) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().confirmerrorTimeLimitExpired);
return true;
}
 else {
confirmOK=true;
confirmReq=false;
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (asyncPending) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorCommandNotReady);
return true;
}
plugin.getPlayers().clearResets(Settings.resetLimit);
final File playerFolder=plugin.getPlayersFolder();
asyncPending=true;
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
int done=0;
FilenameFilter ymlFilter=new FilenameFilter(){
@Override public boolean accept(File dir,String name){
  String lowercaseName=name.toLowerCase();
  if (lowercaseName.endsWith("String_Node_Str")) {
    return true;
  }
 else {
    return false;
  }
}
}
;
for (File file : playerFolder.listFiles(ymlFilter)) {
List<String> playerFileContents=new ArrayList<String>();
done++;
try {
  Scanner scanner=new Scanner(file);
  while (scanner.hasNextLine()) {
    final String lineFromFile=scanner.nextLine();
    if (lineFromFile.contains("String_Node_Str")) {
      playerFileContents.add("String_Node_Str" + Settings.resetLimit);
    }
 else {
      playerFileContents.add(lineFromFile);
    }
  }
  scanner.close();
  try (FileWriter writer=new FileWriter(file)){
    for (    String str : playerFileContents) {
      writer.write(str + "String_Node_Str");
    }
  }
   if (done % 500 == 0) {
    final int update=done;
    plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
      @Override public void run(){
        Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().clearedResetLimit + "String_Node_Str"+ update+ "String_Node_Str");
      }
    }
);
  }
}
 catch (FileNotFoundException e) {
  e.printStackTrace();
}
catch (IOException e) {
  e.printStackTrace();
}
}
asyncPending=false;
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().clearedResetLimit + "String_Node_Str"+ done+ "String_Node_Str");
}
}
);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return false;
}
case 2:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (asyncPending) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorCommandNotReady);
return true;
}
if (plugin.getAvailableLocales().keySet().contains(split[1])) {
try {
Util.setConfig("String_Node_Str",Settings.defaultLanguage,split[1]);
}
 catch (IOException e) {
Util.sendMessage(sender,ChatColor.RED + e.getMessage());
return true;
}
plugin.getConfig().set("String_Node_Str",split[1]);
Settings.defaultLanguage=split[1];
HashMap<String,ASLocale> availableLocales=new HashMap<String,ASLocale>();
FileLister fl=new FileLister(plugin);
try {
int index=1;
for (String code : fl.list()) {
availableLocales.put(code,new ASLocale(plugin,code,index++));
}
}
 catch (IOException e1) {
plugin.getLogger().severe("String_Node_Str");
}
if (!availableLocales.containsKey(Settings.defaultLanguage)) {
plugin.getLogger().severe("String_Node_Str" + Settings.defaultLanguage + "String_Node_Str");
Settings.defaultLanguage="String_Node_Str";
availableLocales.put(Settings.defaultLanguage,new ASLocale(plugin,Settings.defaultLanguage,0));
}
plugin.setAvailableLocales(availableLocales);
for (UUID onlinePlayer : plugin.getPlayers().getOnlineCachedPlayers()) {
plugin.getPlayers().setLocale(onlinePlayer,Settings.defaultLanguage);
}
final File playerFolder=plugin.getPlayersFolder();
asyncPending=true;
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
try {
Util.setPlayerYamlConfig(playerFolder,"String_Node_Str",Settings.defaultLanguage);
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
  @Override public void run(){
    Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
    asyncPending=false;
  }
}
);
}
 catch (final IOException e) {
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
  @Override public void run(){
    Util.sendMessage(sender,ChatColor.RED + e.getMessage());
    asyncPending=false;
  }
}
);
}
}
}
);
Util.sendMessage(sender,ChatColor.RED + plugin.getAvailableLocales().keySet().toString());
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (playerUUID == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
if (sender instanceof Player) {
plugin.getIslandCmd().calculateIslandLevel(sender,playerUUID,false);
}
 else {
plugin.getIslandCmd().calculateIslandLevel(sender,playerUUID,true);
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
split[1]=split[1].toLowerCase();
if (!Settings.challengeList.contains(split[1])) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getChallenges().clearChallengeReset(split[1]);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!Settings.challengeList.contains(split[1].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getChallenges().resetChallengeForAll(split[1].toLowerCase(),0L,"String_Node_Str");
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
plugin.reloadConfig();
PluginConfig.loadPluginConfig(plugin);
if (split[1].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetInProgress);
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
for (Island island : plugin.getGrid().getOwnedIslands().values()) {
island.setIgsDefaults();
}
for (Island island : plugin.getGrid().getUnownedIslands().values()) {
island.setIgsDefaults();
}
plugin.getGrid().saveGrid();
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
@Override public void run(){
plugin.getWarpPanel().updateAllWarpText();
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetDone);
}
}
);
}
}
);
return true;
}
 else {
for (SettingsFlag flag : SettingsFlag.values()) {
if (split[1].equalsIgnoreCase(flag.toString())) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetInProgress);
final SettingsFlag flagToSet=flag;
plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
@Override public void run(){
for (Island island : plugin.getGrid().getOwnedIslands().values()) {
  island.setIgsFlag(flagToSet,Settings.defaultIslandSettings.get(flagToSet));
}
for (Island island : plugin.getGrid().getUnownedIslands().values()) {
  island.setIgsFlag(flagToSet,Settings.defaultIslandSettings.get(flagToSet));
}
plugin.getGrid().saveGrid();
plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
  @Override public void run(){
    if (flagToSet.equals(SettingsFlag.PVP) || flagToSet.equals(SettingsFlag.NETHER_PVP)) {
      plugin.getWarpPanel().updateAllWarpText();
    }
    Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().settingsResetDone);
  }
}
);
}
}
);
return true;
}
}
Util.sendMessage(sender,plugin.myLocale().helpColor + "String_Node_Str" + label+ "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpSettingsReset);
Util.sendMessage(sender,ChatColor.GREEN + "String_Node_Str");
String commaList="String_Node_Str";
for (SettingsFlag flag : SettingsFlag.values()) {
commaList+="String_Node_Str" + flag.toString();
}
Util.sendMessage(sender,commaList);
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUseInGame);
return true;
}
Player p=(Player)sender;
if (!VaultHelper.checkPerm(p,Settings.PERMPREFIX + "String_Node_Str") && !p.isOp()) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorNoPermission);
return true;
}
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
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)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(p.getUniqueId()).adminResetSignNoSign);
return true;
}
Sign sign=(Sign)lastBlock.getState();
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
Island island=plugin.getGrid().getIslandAt(islandLoc);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorNoIsland);
return true;
}
if (!island.inIslandSpace(sign.getLocation())) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).adminSetHomeNotOnPlayersIsland);
}
 else {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminResetSignFound);
if (plugin.getWarpSignsListener().addWarp(playerUUID,lastBlock.getLocation())) {
sign.setLine(0,ChatColor.GREEN + plugin.myLocale().warpswelcomeLine);
sign.update();
Util.sendMessage(p,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminResetSignRescued.replace("String_Node_Str",plugin.getPlayers().getName(playerUUID)));
return true;
}
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale(p.getUniqueId()).adminResetSignErrorExists.replace("String_Node_Str",plugin.getWarpSignsListener().getWarpOwner(lastBlock.getLocation())));
}
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!split[1].equalsIgnoreCase("String_Node_Str")) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslandError);
return true;
}
Island island=plugin.getGrid().getIslandAt(((Player)sender).getLocation());
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslandnoid);
return true;
}
UUID owner=island.getOwner();
String name="String_Node_Str";
if (owner != null) {
name=plugin.getPlayers().getName(owner);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetSpawnownedBy.replace("String_Node_Str",name));
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminDeleteIslanduse.replace("String_Node_Str",name));
return true;
}
 else {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().deleteremoving.replace("String_Node_Str",name));
deleteIslands(island,sender);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
plugin.getGrid().setIslandName(playerUUID,null);
Util.sendMessage(sender,plugin.myLocale().generalSuccess);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
Location safeHome=plugin.getGrid().getSafeHomeLocation(playerUUID,1);
if (safeHome == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetHomeNoneFound);
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,safeHome);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetHomeHomeSet.replace("String_Node_Str",safeHome.getBlockX() + "String_Node_Str" + safeHome.getBlockY()+ "String_Node_Str"+ safeHome.getBlockZ()));
}
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
}
 else {
if (!plugin.getPlayers().hasIsland(playerUUID) && !plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorNoIslandOther);
return true;
}
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
Island island=plugin.getGrid().getIslandAt(islandLoc);
if (island == null || !island.inIslandSpace(player.getLocation())) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminSetHomeNotOnPlayersIsland);
}
 else {
if (!GridManager.isSafeLocation(player.getLocation())) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminSetHomeNoneFound);
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,player.getLocation());
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(player.getUniqueId()).adminSetHomeHomeSet.replace("String_Node_Str",player.getLocation().getBlockX() + "String_Node_Str" + player.getLocation().getBlockY()+ "String_Node_Str"+ player.getLocation().getBlockZ()));
}
}
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
UUID playerUUID=player.getUniqueId();
Island island=plugin.getGrid().getIslandAt(player.getLocation());
if (island == null) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().errorNotOnIsland);
return true;
}
 else {
int newRange=10;
int maxRange=Settings.islandDistance;
if (island.isSpawn()) {
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid);
return true;
}
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
if (newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(playerUUID).adminSetRangeWarning.replace("String_Node_Str",String.valueOf(maxRange)));
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeWarning2);
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",island.getCenter().getBlockX() + "String_Node_Str" + island.getCenter().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",island.getMinX() + "String_Node_Str" + island.getMinZ()).replace("String_Node_Str",(island.getMinX() + island.getIslandDistance() - 1) + "String_Node_Str" + (island.getMinZ() + island.getIslandDistance() - 1)));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(island.getProtectionSize())));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",island.getMinProtectedX() + "String_Node_Str" + island.getMinProtectedZ()).replace("String_Node_Str",+(island.getMinProtectedX() + island.getProtectionSize() - 1) + "String_Node_Str" + (island.getMinProtectedZ() + island.getProtectionSize() - 1)));
if (island.isLocked()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
}
 else {
try {
newRange=Integer.valueOf(split[1]);
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(island.getOwner(),sender);
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
player=(Player)sender;
UUID playerUUID=player.getUniqueId();
Island island=plugin.getGrid().getIslandAt(player.getLocation());
if (island == null) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().errorNotOnIsland);
return true;
}
 else {
int newRange=island.getProtectionSize();
int maxRange=Settings.islandDistance;
if (island.isSpawn()) {
try {
newRange=Integer.valueOf(split[1]) + island.getProtectionSize();
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid);
return true;
}
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
if (newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(playerUUID).adminSetRangeWarning.replace("String_Node_Str",String.valueOf(maxRange)));
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeWarning2);
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncenter.replace("String_Node_Str",island.getCenter().getBlockX() + "String_Node_Str" + island.getCenter().getBlockZ()));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnlimits.replace("String_Node_Str",island.getMinX() + "String_Node_Str" + island.getMinZ()).replace("String_Node_Str",(island.getMinX() + island.getIslandDistance() - 1) + "String_Node_Str" + (island.getMinZ() + island.getIslandDistance() - 1)));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawnrange.replace("String_Node_Str",String.valueOf(island.getProtectionSize())));
Util.sendMessage(player,ChatColor.YELLOW + plugin.myLocale().adminSetSpawncoords.replace("String_Node_Str",island.getMinProtectedX() + "String_Node_Str" + island.getMinProtectedZ()).replace("String_Node_Str",+(island.getMinProtectedX() + island.getProtectionSize() - 1) + "String_Node_Str" + (island.getMinProtectedZ() + island.getProtectionSize() - 1)));
if (island.isLocked()) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale().adminSetSpawnlocked);
}
}
 else {
try {
newRange=Integer.valueOf(split[1]) + island.getProtectionSize();
}
 catch (Exception e) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(playerUUID).adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale(playerUUID).adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(player,ChatColor.GREEN + plugin.myLocale(playerUUID).adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(island.getOwner(),sender);
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (split[1].equalsIgnoreCase("String_Node_Str") || split[1].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminLockerrorInGame);
return true;
}
Player p=(Player)sender;
if (!p.getLocation().getWorld().equals(ASkyBlock.getIslandWorld()) && !p.getLocation().getWorld().equals(ASkyBlock.getNetherWorld())) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorWrongWorld);
return true;
}
Island island=plugin.getGrid().getIslandAt(p.getLocation());
if (island == null) {
Util.sendMessage(p,ChatColor.RED + plugin.myLocale(p.getUniqueId()).errorNoIslandOther);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
island.setPurgeProtected(true);
}
 else {
island.setPurgeProtected(false);
}
if (island.isPurgeProtected()) {
Util.sendMessage(p,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminPreventPurge);
}
 else {
Util.sendMessage(p,ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).adminAllowPurge);
}
return true;
}
if (purgeFlag) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgealreadyRunning);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
countUnowned(sender);
return true;
}
purgeFlag=true;
final int time;
try {
time=Integer.parseInt(split[1]) * 24;
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgeusage.replace("String_Node_Str",label));
purgeFlag=false;
return true;
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgecalculating.replace("String_Node_Str",split[1]));
for (Entry<UUID,Island> entry : plugin.getGrid().getOwnershipMap().entrySet()) {
if (entry.getKey() != null && !entry.getValue().isPurgeProtected()) {
if (Bukkit.getOfflinePlayer(entry.getKey()).hasPlayedBefore()) {
long offlineTime=Bukkit.getOfflinePlayer(entry.getKey()).getLastPlayed();
offlineTime=(System.currentTimeMillis() - offlineTime) / 3600000L;
if (offlineTime > time && plugin.getPlayers().getIslandLevel(entry.getKey()) < Settings.abandonedIslandLevel) {
removeList.add(entry.getKey());
}
}
 else {
removeList.add(entry.getKey());
}
}
}
if (removeList.isEmpty()) {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgenoneFound);
purgeFlag=false;
return true;
}
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgethisWillRemove.replace("String_Node_Str",String.valueOf(removeList.size())).replace("String_Node_Str",String.valueOf(Settings.abandonedIslandLevel)));
long runtime=removeList.size() * 2L;
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgeEstimatedRunTime.replace("String_Node_Str",String.format("String_Node_Str",runtime / 3600,(runtime % 3600) / 60,(runtime % 60))));
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgewarning);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgetypeConfirm.replace("String_Node_Str",label));
if (removeList.size() > Settings.maxPurge) {
Util.sendMessage(sender,plugin.myLocale().purgeLimit.replace("String_Node_Str",String.valueOf(Settings.maxPurge)));
Iterator<UUID> it=removeList.iterator();
int count=1;
while (it.hasNext()) {
it.next();
if (count++ > Settings.maxPurge) {
it.remove();
}
}
}
confirmReq=true;
confirmOK=false;
confirmTimer=0;
new BukkitRunnable(){
@Override public void run(){
if (confirmTimer++ > 10) {
confirmReq=false;
confirmOK=false;
purgeFlag=false;
removeList.clear();
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgepurgeCancelled);
this.cancel();
}
 else if (confirmOK) {
final int total=removeList.size();
new BukkitRunnable(){
@Override public void run(){
if (removeList.isEmpty() && purgeFlag) {
purgeFlag=false;
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().purgefinished);
this.cancel();
}
if (removeList.size() > 0 && purgeFlag) {
if (plugin.getServer().getPlayer(removeList.get(0)) == null) {
if (plugin.getPlayers().getIslandLevel(removeList.get(0)) < Settings.abandonedIslandLevel) {
  Util.sendMessage(sender,ChatColor.YELLOW + "String_Node_Str" + (total - removeList.size() + 1)+ "String_Node_Str"+ total+ "String_Node_Str"+ plugin.myLocale().purgeremovingName.replace("String_Node_Str",plugin.getPlayers().getName(removeList.get(0))));
  plugin.deletePlayerIsland(removeList.get(0),true);
}
}
 else {
Util.sendMessage(sender,ChatColor.YELLOW + "String_Node_Str" + (total - removeList.size() + 1)+ "String_Node_Str"+ total+ "String_Node_Str"+ "String_Node_Str");
}
removeList.remove(0);
}
}
}
.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],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Island island=plugin.getGrid().getIsland(playerUUID);
if (island != null) {
Player owner=plugin.getServer().getPlayer(island.getOwner());
if (island.isLocked()) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockUnlocking);
island.setLocked(false);
if (owner != null) {
owner.sendMessage(plugin.myLocale(owner.getUniqueId()).adminLockadminUnlockedIsland);
}
 else {
plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminUnlockedIsland);
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().lockLocking);
island.setLocked(true);
if (owner != null) {
Util.sendMessage(owner,plugin.myLocale(owner.getUniqueId()).adminLockadminLockedIsland);
}
 else {
plugin.getMessages().setMessage(island.getOwner(),plugin.myLocale(island.getOwner()).adminLockadminLockedIsland);
}
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
}
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.GREEN + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ plugin.getPlayers().getDeaths(playerUUID)+ "String_Node_Str"+ plugin.myLocale().deaths);
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpsetDeaths);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
plugin.getPlayers().setResetsLeft(playerUUID,Settings.resetLimit);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().clearedResetLimit + "String_Node_Str"+ Settings.resetLimit+ "String_Node_Str");
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return true;
}
player=(Player)sender;
final UUID targetUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(targetUUID)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().hasIsland(targetUUID) || plugin.getPlayers().inTeam(targetUUID)) {
Location warpSpot=plugin.getPlayers().getIslandLocation(targetUUID).toVector().toLocation(ASkyBlock.getIslandWorld());
String failureMessage=ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminTpManualWarp.replace("String_Node_Str",warpSpot.getBlockX() + "String_Node_Str" + warpSpot.getBlockY()+ "String_Node_Str"+ warpSpot.getBlockZ());
Location home=plugin.getPlayers().getHomeLocation(targetUUID);
plugin.getGrid();
if (home != null && home.getWorld().equals(ASkyBlock.getIslandWorld()) && GridManager.isSafeLocation(home)) {
player.teleport(home);
return true;
}
new SafeTeleportBuilder(plugin).entity(player).location(warpSpot).failureMessage(failureMessage).build();
return true;
}
Util.sendMessage(sender,plugin.myLocale().errorNoIslandOther);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!Settings.createNether || !Settings.newNether || ASkyBlock.getNetherWorld() == null) {
return false;
}
if (!(sender instanceof Player)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return true;
}
player=(Player)sender;
final UUID targetUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(targetUUID)) {
Util.sendMessage(player,ChatColor.RED + plugin.myLocale(player.getUniqueId()).errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().hasIsland(targetUUID) || plugin.getPlayers().inTeam(targetUUID)) {
Location warpSpot=plugin.getPlayers().getIslandLocation(targetUUID).toVector().toLocation(ASkyBlock.getNetherWorld());
String failureMessage=ChatColor.RED + plugin.myLocale(player.getUniqueId()).adminTpManualWarp.replace("String_Node_Str",warpSpot.getBlockX() + "String_Node_Str" + warpSpot.getBlockY()+ "String_Node_Str"+ warpSpot.getBlockZ());
Location home=plugin.getPlayers().getHomeLocation(targetUUID);
plugin.getGrid();
if (home != null && home.getWorld().equals(ASkyBlock.getNetherWorld()) && GridManager.isSafeLocation(home)) {
player.teleport(home);
return true;
}
new SafeTeleportBuilder(plugin).entity(player).location(warpSpot).failureMessage(failureMessage).build();
return true;
}
Util.sendMessage(sender,plugin.myLocale().errorNoIslandOther);
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().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) {
player=(Player)sender;
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
Location islandLoc=plugin.getGrid().getClosestIsland(player.getLocation());
Island island=plugin.getGrid().getIslandAt(islandLoc);
if (island == null) {
plugin.getIslandCmd().reserveLocation(playerUUID,islandLoc);
Util.sendMessage(sender,ChatColor.GREEN + "String_Node_Str" + islandLoc.getBlockX()+ "String_Node_Str"+ islandLoc.getBlockZ()+ "String_Node_Str"+ plugin.myLocale().generalSuccess);
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminReserveIslandExists);
}
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (sender instanceof Player) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
if (adminSetPlayerIsland(sender,((Player)sender).getLocation(),playerUUID)) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().registersettingIsland.replace("String_Node_Str",split[1]));
plugin.getGrid().saveGrid();
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().registererrorBedrockNotFound);
}
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
if (plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminUnregisterOnTeam);
return true;
}
Location island=plugin.getPlayers().getIslandLocation(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminUnregisterKeepBlocks.replace("String_Node_Str",+plugin.getPlayers().getIslandLocation(playerUUID).getBlockX() + "String_Node_Str" + plugin.getPlayers().getIslandLocation(playerUUID).getBlockZ()));
plugin.deletePlayerIsland(playerUUID,false);
plugin.getGrid().saveGrid();
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().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],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
plugin.getPlayers().resetAllChallenges(playerUUID,true);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().resetChallengessuccess.replace("String_Node_Str",split[1]));
return true;
}
 else {
return false;
}
case 3:
if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (!Settings.challengeList.contains(split[1].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
split[2]=split[2].trim();
if (split[2].length() > 1 && (split[2].toLowerCase().endsWith("String_Node_Str") || split[2].toLowerCase().endsWith("String_Node_Str") || split[2].toLowerCase().endsWith("String_Node_Str"))) {
char unit=split[2].charAt(split[2].length() - 1);
String value=split[2].substring(0,split[2].length() - 1);
try {
long repeat=0;
int number=Integer.valueOf(value);
switch (unit) {
case 'm':
repeat=60000L * number;
break;
case 'h':
repeat=60000L * 60 * number;
break;
case 'd':
repeat=60000L * 60 * 24* number;
break;
}
plugin.getChallenges().resetChallengeForAll(split[1].toLowerCase(),repeat,split[2]);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().generalSuccess);
}
 catch (Exception e) {
e.printStackTrace();
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminResetChallengeForAllError);
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminResetChallengeForAllError);
return true;
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
if (purgeFlag) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().purgealreadyRunning);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str") && split[2].equalsIgnoreCase("String_Node_Str")) {
if (!purgeUnownedConfirm) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().confirmerrorTimeLimitExpired);
return true;
}
 else {
purgeUnownedConfirm=false;
purgeUnownedIslands(sender);
return true;
}
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
playerUUID=plugin.getPlayers().getTeamLeader(playerUUID);
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
 else {
int newRange=0;
int maxRange=Settings.islandDistance;
try {
newRange=Integer.valueOf(split[2]) + island.getProtectionSize();
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(playerUUID,sender);
plugin.getGrid().saveGrid();
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
playerUUID=plugin.getPlayers().getTeamLeader(playerUUID);
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIslandOther);
return true;
}
 else {
int newRange=0;
int maxRange=Settings.islandDistance;
try {
newRange=Integer.valueOf(split[2]);
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
if (newRange < 10 || newRange > maxRange) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminSetRangeInvalid + "String_Node_Str"+ plugin.myLocale().adminSetRangeTip.replace("String_Node_Str",String.valueOf(maxRange)));
return true;
}
island.setProtectionSize(newRange);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminSetRangeSet.replace("String_Node_Str",String.valueOf(newRange)));
showInfo(playerUUID,sender);
plugin.getGrid().saveGrid();
return true;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
 else {
try {
int newDeaths=Integer.valueOf(split[2]);
int oldDeaths=plugin.getPlayers().getDeaths(playerUUID);
plugin.getPlayers().setDeaths(playerUUID,newDeaths);
Util.sendMessage(sender,ChatColor.GREEN + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ oldDeaths+ "String_Node_Str"+ newDeaths+ "String_Node_Str"+ plugin.myLocale().deaths);
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.GREEN + plugin.getPlayers().getName(playerUUID) + "String_Node_Str"+ plugin.getPlayers().getDeaths(playerUUID)+ "String_Node_Str"+ plugin.myLocale().deaths);
Util.sendMessage(sender,plugin.myLocale().helpColor + label + "String_Node_Str"+ ChatColor.WHITE+ "String_Node_Str"+ plugin.myLocale().adminHelpsetDeaths);
return true;
}
return true;
}
}
if (split[0].equalsIgnoreCase("String_Node_Str")) {
UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
playerUUID=plugin.getPlayers().getTeamLeader(playerUUID);
}
Island island=plugin.getGrid().getIsland(playerUUID);
if (island == null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoIsland);
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)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
Util.sendMessage(sender,b.name());
}
}
return true;
}
biomeName=plugin.getConfig().getString("String_Node_Str" + biomeName + "String_Node_Str",Util.prettifyText(biomeName));
}
 catch (Exception e) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().biomeUnknown);
for (Biome b : Biome.values()) {
if (plugin.getConfig().contains("String_Node_Str" + b.name())) {
Util.sendMessage(sender,b.name());
}
}
return true;
}
new SetBiome(plugin,island,biome,sender);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().biomeSet.replace("String_Node_Str",biomeName));
Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
if (targetPlayer != null) {
Util.sendMessage(targetPlayer,"String_Node_Str" + ChatColor.GREEN + plugin.myLocale(playerUUID).biomeSet.replace("String_Node_Str",biomeName));
}
 else {
plugin.getMessages().setMessage(playerUUID,"String_Node_Str" + ChatColor.GREEN + plugin.myLocale(playerUUID).biomeSet.replace("String_Node_Str",biomeName));
}
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (split[1].equalsIgnoreCase("String_Node_Str")) {
if (!plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorNoTeam);
return true;
}
UUID teamLeader=plugin.getPlayers().getTeamLeader(playerUUID);
if (teamLeader == null) {
if (!plugin.getPlayers().setLeaveTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
plugin.getPlayers().setHomeLocation(playerUUID,null);
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getWarpSignsListener().removeWarp(playerUUID);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().kicknameRemoved.replace("String_Node_Str",split[2]));
plugin.getPlayers().save(playerUUID);
return true;
}
if (!teamLeader.equals(playerUUID)) {
if (!plugin.getPlayers().setLeaveTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
plugin.getPlayers().setHomeLocation(playerUUID,null);
plugin.getPlayers().setIslandLocation(playerUUID,null);
plugin.getPlayers().removeMember(teamLeader,playerUUID);
if (plugin.getPlayers().getMembers(teamLeader).size() < 2) {
if (!plugin.getPlayers().setLeaveTeam(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
}
plugin.getWarpSignsListener().removeWarp(playerUUID);
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().kicknameRemoved.replace("String_Node_Str",split[2]));
plugin.getPlayers().save(playerUUID);
return true;
}
 else {
Util.sendMessage(sender,ChatColor.RED + (plugin.myLocale().adminTeamKickLeader.replace("String_Node_Str",label)).replace("String_Node_Str",split[2]));
return true;
}
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return false;
}
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (plugin.getPlayers().checkChallenge(playerUUID,split[2].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[2].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().completeChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().get(playerUUID).completeChallenge(split[2].toLowerCase());
plugin.getPlayers().save(playerUUID);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().completeChallengechallangeCompleted.replace("String_Node_Str",split[2].toLowerCase()).replace("String_Node_Str",split[1]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[1],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (!plugin.getPlayers().checkChallenge(playerUUID,split[2].toLowerCase()) || !plugin.getPlayers().get(playerUUID).challengeExists(split[2].toLowerCase())) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().resetChallengeerrorChallengeDoesNotExist);
return true;
}
plugin.getPlayers().resetChallenge(playerUUID,split[2].toLowerCase());
plugin.getPlayers().save(playerUUID);
Util.sendMessage(sender,ChatColor.YELLOW + plugin.myLocale().resetChallengechallengeReset.replace("String_Node_Str",split[2].toLowerCase()).replace("String_Node_Str",split[1]));
return true;
}
 else if (split[0].equalsIgnoreCase("String_Node_Str") && split[1].equalsIgnoreCase("String_Node_Str")) {
final UUID playerUUID=plugin.getPlayers().getUUID(split[2],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().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],true);
final Player targetPlayer=plugin.getServer().getPlayer(playerUUID);
final UUID teamLeader=plugin.getPlayers().getUUID(split[3],true);
if (!plugin.getPlayers().isAKnownPlayer(playerUUID) || !plugin.getPlayers().isAKnownPlayer(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownPlayer);
return true;
}
if (playerUUID.equals(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminTeamAddLeaderToOwn);
return true;
}
if (!plugin.getPlayers().hasIsland(teamLeader)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminTeamAddLeaderNoIsland);
return true;
}
if (plugin.getPlayers().inTeam(playerUUID)) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().inviteerrorThatPlayerIsAlreadyInATeam);
return true;
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(teamLeader)) {
if (!plugin.getPlayers().setJoinTeam(teamLeader,teamLeader,plugin.getPlayers().getIslandLocation(teamLeader))) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorBlockedByAPI);
return true;
}
plugin.getPlayers().addTeamMember(teamLeader,teamLeader);
Util.sendMessage(sender,ChatColor.GOLD + plugin.myLocale().adminTeamAddedLeader);
}
if (targetPlayer != null) {
Util.runCommand(targetPlayer,Settings.ISLANDCOMMAND + "String_Node_Str");
}
if (plugin.getPlayers().hasIsland(playerUUID)) {
Location islandLoc=plugin.getPlayers().getIslandLocation(playerUUID);
if (islandLoc != null) {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().adminTeamNowUnowned.replace("String_Node_Str",plugin.getPlayers().getName(playerUUID)).replace("String_Node_Str",islandLoc.getBlockX() + "String_Node_Str" + islandLoc.getBlockZ()));
}
}
plugin.deletePlayerIsland(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));
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminTeamSettingHome);
}
 else {
plugin.getPlayers().setHomeLocation(playerUUID,plugin.getPlayers().getIslandLocation(teamLeader));
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminTeamSettingHome);
}
if (!plugin.getPlayers().getMembers(teamLeader).contains(playerUUID)) {
plugin.getPlayers().addTeamMember(teamLeader,playerUUID);
Util.sendMessage(sender,ChatColor.GREEN + plugin.myLocale().adminTeamAddingPlayer);
}
 else {
Util.sendMessage(sender,ChatColor.GOLD + plugin.myLocale().adminTeamAlreadyOnTeam);
}
if (targetPlayer != null) {
plugin.getGrid().homeTeleport(targetPlayer);
}
plugin.getGrid().saveGrid();
return true;
}
 else {
Util.sendMessage(sender,ChatColor.RED + plugin.myLocale().errorUnknownCommand);
return false;
}
default :
return false;
}
}