Program: 58043
Project: 58043
Buggy source:
@Override public boolean execute(final PlotPlayer plr,final String... args){
  if (args.length == 0) {
    MainUtil.sendMessage(plr,C.CLUSTER_AVAILABLE_ARGS);
    return false;
  }
  final String sub=args[0].toLowerCase();
switch (sub) {
case "String_Node_Str":
case "String_Node_Str":
{
      if (!Permissions.hasPermission(plr,"String_Node_Str")) {
        MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
        return false;
      }
      if (args.length != 1) {
        MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
        return false;
      }
      final HashSet<PlotCluster> clusters=ClusterManager.getClusters(plr.getLocation().getWorld());
      MainUtil.sendMessage(plr,C.CLUSTER_LIST_HEADING,clusters.size() + "String_Node_Str");
      for (      final PlotCluster cluster : clusters) {
        final String name="String_Node_Str" + cluster.getName() + "String_Node_Str"+ cluster.toString();
        if (UUIDHandler.getUUID(plr).equals(cluster.owner)) {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,"String_Node_Str" + name);
        }
 else         if (cluster.helpers.contains(UUIDHandler.getUUID(plr))) {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,"String_Node_Str" + name);
        }
 else         if (cluster.invited.contains(UUIDHandler.getUUID(plr))) {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,"String_Node_Str" + name);
        }
 else {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,cluster.toString());
        }
      }
      return true;
    }
case "String_Node_Str":
case "String_Node_Str":
{
    if (!Permissions.hasPermission(plr,"String_Node_Str")) {
      MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
      return false;
    }
    if (args.length != 4) {
      final PlotId id=ClusterManager.estimatePlotId(plr.getLocation());
      MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
      MainUtil.sendMessage(plr,C.CLUSTER_CURRENT_PLOTID,"String_Node_Str" + id);
      return false;
    }
    final PlotId pos1=MainUtil.parseId(args[2]);
    final PlotId pos2=MainUtil.parseId(args[3]);
    if ((pos1 == null) || (pos2 == null)) {
      MainUtil.sendMessage(plr,C.NOT_VALID_PLOT_ID);
      return false;
    }
    final String name=args[1];
    for (    final PlotCluster cluster : ClusterManager.getClusters(plr.getLocation().getWorld())) {
      if (name.equals(cluster.getName())) {
        MainUtil.sendMessage(plr,C.ALIAS_IS_TAKEN);
        return false;
      }
    }
    final PlotClusterId id=new PlotClusterId(pos1,pos2);
    final HashSet<PlotCluster> intersects=ClusterManager.getIntersects(plr.getLocation().getWorld(),id);
    if ((intersects.size() > 0) || (pos2.x < pos1.x) || (pos2.y < pos1.y)) {
      MainUtil.sendMessage(plr,C.CLUSTER_INTERSECTION,intersects.size() + "String_Node_Str");
      return false;
    }
    final String world=plr.getLocation().getWorld();
    final PlotCluster cluster=new PlotCluster(world,pos1,pos2,UUIDHandler.getUUID(plr));
    cluster.settings.setAlias(name);
    DBFunc.createCluster(world,cluster);
    if (!ClusterManager.clusters.containsKey(world)) {
      ClusterManager.clusters.put(world,new HashSet<PlotCluster>());
    }
    ClusterManager.clusters.get(world).add(cluster);
    for (    final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld()).values()) {
      final PlotCluster current=ClusterManager.getCluster(plot);
      if (cluster.equals(current) && !cluster.hasRights(plot.owner)) {
        cluster.invited.add(plot.owner);
        DBFunc.setInvited(world,cluster,plot.owner);
      }
    }
    if (!PlotSquared.isPlotWorld(world)) {
      PlotSquared.config.createSection("String_Node_Str" + world);
      PlotSquared.loadWorld(world,null);
    }
    MainUtil.sendMessage(plr,C.CLUSTER_ADDED);
    return true;
  }
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
  if (!Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
  if ((args.length != 1) && (args.length != 2)) {
    MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
    return false;
  }
  PlotCluster cluster;
  if (args.length == 2) {
    cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
    if (cluster == null) {
      MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
      return false;
    }
  }
 else {
    cluster=ClusterManager.getCluster(plr.getLocation());
    if (cluster == null) {
      MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
      return false;
    }
  }
  if (!cluster.owner.equals(UUIDHandler.getUUID(plr))) {
    if (!Permissions.hasPermission(plr,"String_Node_Str")) {
      MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
      return false;
    }
  }
  final PlotWorld plotworld=PlotSquared.getPlotWorld(plr.getLocation().getWorld());
  if (plotworld.TYPE == 2) {
    final ArrayList<Plot> toRemove=new ArrayList<>();
    for (    final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld()).values()) {
      final PlotCluster other=ClusterManager.getCluster(plot);
      if (cluster.equals(other)) {
        toRemove.add(plot);
      }
    }
    for (    final Plot plot : toRemove) {
      DBFunc.delete(plot.world,plot);
    }
  }
  DBFunc.delete(cluster);
  if (plotworld.TYPE == 2) {
    AugmentedPopulator.removePopulator(plr.getLocation().getWorld(),cluster);
  }
  for (  final String set : ClusterManager.clusters.keySet()) {
  }
  ClusterManager.last=null;
  ClusterManager.clusters.get(cluster.world).remove(cluster);
  ClusterManager.regenCluster(cluster);
  MainUtil.sendMessage(plr,C.CLUSTER_DELETED);
  return true;
}
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
  MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
  return false;
}
if (args.length != 3) {
  MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
  return false;
}
final PlotId pos1=MainUtil.parseId(args[1]);
final PlotId pos2=MainUtil.parseId(args[2]);
if ((pos1 == null) || (pos2 == null)) {
  MainUtil.sendMessage(plr,C.NOT_VALID_PLOT_ID);
  return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
  MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
  return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
  if (!Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
}
final PlotClusterId id=new PlotClusterId(pos1,pos2);
final HashSet<PlotCluster> intersects=ClusterManager.getIntersects(plr.getLocation().getWorld(),id);
if (intersects.size() > 1) {
  MainUtil.sendMessage(plr,C.CLUSTER_INTERSECTION,(intersects.size() - 1) + "String_Node_Str");
  return false;
}
DBFunc.resizeCluster(cluster,id);
MainUtil.sendMessage(plr,C.CLUSTER_RESIZED);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
PlotCluster cluster;
if (args.length == 2) {
cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
  MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
  return false;
}
}
 else {
cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
  MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
  return false;
}
}
if (!cluster.owner.equals(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
  MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
  return false;
}
}
ClusterManager.regenCluster(cluster);
MainUtil.sendMessage(plr,C.CLUSTER_REGENERATED);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 2) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
final UUID uuid=UUIDHandler.getUUID(args[1]);
if (uuid == null) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[1]);
return false;
}
if (!cluster.hasRights(uuid)) {
cluster.invited.add(uuid);
final String world=plr.getLocation().getWorld();
DBFunc.setInvited(world,cluster,uuid);
final PlotPlayer player=UUIDHandler.getPlayer(uuid);
if (player != null) {
MainUtil.sendMessage(player,C.CLUSTER_INVITED,cluster.getName());
}
}
MainUtil.sendMessage(plr,C.CLUSTER_ADDED_USER);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 2) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
final UUID uuid=UUIDHandler.getUUID(args[1]);
if (uuid == null) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[1]);
return false;
}
if (uuid.equals(UUIDHandler.getUUID(plr)) || uuid.equals(cluster.owner) || !cluster.hasRights(uuid)) {
MainUtil.sendMessage(plr,C.CANNOT_KICK_PLAYER,cluster.getName());
return false;
}
if (cluster.helpers.contains(uuid)) {
cluster.helpers.remove(uuid);
DBFunc.removeHelper(cluster,uuid);
}
cluster.invited.remove(uuid);
DBFunc.removeInvited(cluster,uuid);
final PlotPlayer player=UUIDHandler.getPlayer(uuid);
if (player != null) {
MainUtil.sendMessage(player,C.CLUSTER_REMOVED,cluster.getName());
}
for (final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld(),uuid)) {
final PlotCluster current=ClusterManager.getCluster(plot);
if ((current != null) && current.equals(cluster)) {
final String world=plr.getLocation().getWorld();
DBFunc.delete(world,plot);
}
}
MainUtil.sendMessage(plr,C.CLUSTER_KICKED_USER);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
PlotCluster cluster;
if (args.length == 2) {
cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
return false;
}
}
 else {
cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
}
final UUID uuid=UUIDHandler.getUUID(plr);
if (!cluster.hasRights(uuid)) {
MainUtil.sendMessage(plr,C.CLUSTER_NOT_ADDED);
return false;
}
if (uuid.equals(cluster.owner)) {
MainUtil.sendMessage(plr,C.CLUSTER_CANNOT_LEAVE);
return false;
}
if (cluster.helpers.contains(uuid)) {
cluster.helpers.remove(uuid);
DBFunc.removeHelper(cluster,uuid);
}
cluster.invited.remove(uuid);
DBFunc.removeInvited(cluster,uuid);
MainUtil.sendMessage(plr,C.CLUSTER_REMOVED,cluster.getName());
for (final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld(),uuid)) {
final PlotCluster current=ClusterManager.getCluster(plot);
if ((current != null) && current.equals(cluster)) {
final String world=plr.getLocation().getWorld();
DBFunc.delete(world,plot);
}
}
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 3) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
final UUID uuid=UUIDHandler.getUUID(args[2]);
if (uuid == null) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[1]);
return false;
}
if (args[1].toLowerCase().equals("String_Node_Str")) {
cluster.helpers.add(uuid);
return MainUtil.sendMessage(plr,C.CLUSTER_ADDED_HELPER);
}
if (args[1].toLowerCase().equals("String_Node_Str")) {
cluster.helpers.remove(uuid);
return MainUtil.sendMessage(plr,C.CLUSTER_REMOVED_HELPER);
}
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 2) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
return false;
}
final UUID uuid=UUIDHandler.getUUID(plr);
if (!cluster.hasRights(uuid)) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
plr.teleport(ClusterManager.getHome(cluster));
return MainUtil.sendMessage(plr,C.CLUSTER_TELEPORTING);
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
PlotCluster cluster;
if (args.length == 2) {
cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
return false;
}
}
 else {
cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
}
final String id=cluster.toString();
String owner=UUIDHandler.getName(cluster.owner);
if (owner == null) {
owner="String_Node_Str";
}
final String name=cluster.getName();
final String size=((cluster.getP2().x - cluster.getP1().x) + 1) + "String_Node_Str" + ((cluster.getP2().y - cluster.getP1().y) + 1);
final String rights=cluster.hasRights(UUIDHandler.getUUID(plr)) + "String_Node_Str";
String message=C.CLUSTER_INFO.s();
message=message.replaceAll("String_Node_Str",id);
message=message.replaceAll("String_Node_Str",owner);
message=message.replaceAll("String_Node_Str",name);
message=message.replaceAll("String_Node_Str",size);
message=message.replaceAll("String_Node_Str",rights);
MainUtil.sendMessage(plr,message);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
final Location base=ClusterManager.getClusterBottom(cluster);
final Location relative=plr.getLocation().subtract(base.getX(),0,base.getZ());
final BlockLoc blockloc=new BlockLoc(relative.getX(),relative.getY(),relative.getZ());
cluster.settings.setPosition(blockloc);
DBFunc.setPosition(cluster,relative.getX() + "String_Node_Str" + relative.getY()+ "String_Node_Str"+ relative.getZ());
return MainUtil.sendMessage(plr,C.POSITION_SET);
}
}
MainUtil.sendMessage(plr,C.CLUSTER_AVAILABLE_ARGS);
return false;
}

Fixed version (ground truth):
@Override public boolean execute(final PlotPlayer plr,final String... args){
  if (args.length == 0) {
    MainUtil.sendMessage(plr,C.CLUSTER_AVAILABLE_ARGS);
    return false;
  }
  final String sub=args[0].toLowerCase();
switch (sub) {
case "String_Node_Str":
case "String_Node_Str":
{
      if (!Permissions.hasPermission(plr,"String_Node_Str")) {
        MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
        return false;
      }
      if (args.length != 1) {
        MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
        return false;
      }
      final HashSet<PlotCluster> clusters=ClusterManager.getClusters(plr.getLocation().getWorld());
      MainUtil.sendMessage(plr,C.CLUSTER_LIST_HEADING,clusters.size() + "String_Node_Str");
      for (      final PlotCluster cluster : clusters) {
        final String name="String_Node_Str" + cluster.getName() + "String_Node_Str"+ cluster.toString();
        if (UUIDHandler.getUUID(plr).equals(cluster.owner)) {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,"String_Node_Str" + name);
        }
 else         if (cluster.helpers.contains(UUIDHandler.getUUID(plr))) {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,"String_Node_Str" + name);
        }
 else         if (cluster.invited.contains(UUIDHandler.getUUID(plr))) {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,"String_Node_Str" + name);
        }
 else {
          MainUtil.sendMessage(plr,C.CLUSTER_LIST_ELEMENT,cluster.toString());
        }
      }
      return true;
    }
case "String_Node_Str":
case "String_Node_Str":
{
    if (!Permissions.hasPermission(plr,"String_Node_Str")) {
      MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
      return false;
    }
    if (args.length != 4) {
      final PlotId id=ClusterManager.estimatePlotId(plr.getLocation());
      MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
      MainUtil.sendMessage(plr,C.CLUSTER_CURRENT_PLOTID,"String_Node_Str" + id);
      return false;
    }
    final PlotId pos1=MainUtil.parseId(args[2]);
    final PlotId pos2=MainUtil.parseId(args[3]);
    if ((pos1 == null) || (pos2 == null)) {
      MainUtil.sendMessage(plr,C.NOT_VALID_PLOT_ID);
      return false;
    }
    final String name=args[1];
    for (    final PlotCluster cluster : ClusterManager.getClusters(plr.getLocation().getWorld())) {
      if (name.equals(cluster.getName())) {
        MainUtil.sendMessage(plr,C.ALIAS_IS_TAKEN);
        return false;
      }
    }
    final PlotClusterId id=new PlotClusterId(pos1,pos2);
    final HashSet<PlotCluster> intersects=ClusterManager.getIntersects(plr.getLocation().getWorld(),id);
    if ((intersects.size() > 0) || (pos2.x < pos1.x) || (pos2.y < pos1.y)) {
      MainUtil.sendMessage(plr,C.CLUSTER_INTERSECTION,intersects.size() + "String_Node_Str");
      return false;
    }
    final String world=plr.getLocation().getWorld();
    final PlotCluster cluster=new PlotCluster(world,pos1,pos2,UUIDHandler.getUUID(plr));
    cluster.settings.setAlias(name);
    DBFunc.createCluster(world,cluster);
    if (!ClusterManager.clusters.containsKey(world)) {
      ClusterManager.clusters.put(world,new HashSet<PlotCluster>());
    }
    ClusterManager.clusters.get(world).add(cluster);
    for (    final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld()).values()) {
      final PlotCluster current=ClusterManager.getCluster(plot);
      if (cluster.equals(current) && !cluster.hasRights(plot.owner_)) {
        cluster.invited.add(plot.owner_);
        DBFunc.setInvited(world,cluster,plot.owner_);
      }
    }
    if (!PlotSquared.isPlotWorld(world)) {
      PlotSquared.config.createSection("String_Node_Str" + world);
      PlotSquared.loadWorld(world,null);
    }
    MainUtil.sendMessage(plr,C.CLUSTER_ADDED);
    return true;
  }
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
  if (!Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
  if ((args.length != 1) && (args.length != 2)) {
    MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
    return false;
  }
  PlotCluster cluster;
  if (args.length == 2) {
    cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
    if (cluster == null) {
      MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
      return false;
    }
  }
 else {
    cluster=ClusterManager.getCluster(plr.getLocation());
    if (cluster == null) {
      MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
      return false;
    }
  }
  if (!cluster.owner.equals(UUIDHandler.getUUID(plr))) {
    if (!Permissions.hasPermission(plr,"String_Node_Str")) {
      MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
      return false;
    }
  }
  final PlotWorld plotworld=PlotSquared.getPlotWorld(plr.getLocation().getWorld());
  if (plotworld.TYPE == 2) {
    final ArrayList<Plot> toRemove=new ArrayList<>();
    for (    final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld()).values()) {
      final PlotCluster other=ClusterManager.getCluster(plot);
      if (cluster.equals(other)) {
        toRemove.add(plot);
      }
    }
    for (    final Plot plot : toRemove) {
      DBFunc.delete(plot.world,plot);
    }
  }
  DBFunc.delete(cluster);
  if (plotworld.TYPE == 2) {
    AugmentedPopulator.removePopulator(plr.getLocation().getWorld(),cluster);
  }
  for (  final String set : ClusterManager.clusters.keySet()) {
  }
  ClusterManager.last=null;
  ClusterManager.clusters.get(cluster.world).remove(cluster);
  ClusterManager.regenCluster(cluster);
  MainUtil.sendMessage(plr,C.CLUSTER_DELETED);
  return true;
}
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
  MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
  return false;
}
if (args.length != 3) {
  MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
  return false;
}
final PlotId pos1=MainUtil.parseId(args[1]);
final PlotId pos2=MainUtil.parseId(args[2]);
if ((pos1 == null) || (pos2 == null)) {
  MainUtil.sendMessage(plr,C.NOT_VALID_PLOT_ID);
  return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
  MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
  return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
  if (!Permissions.hasPermission(plr,"String_Node_Str")) {
    MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
    return false;
  }
}
final PlotClusterId id=new PlotClusterId(pos1,pos2);
final HashSet<PlotCluster> intersects=ClusterManager.getIntersects(plr.getLocation().getWorld(),id);
if (intersects.size() > 1) {
  MainUtil.sendMessage(plr,C.CLUSTER_INTERSECTION,(intersects.size() - 1) + "String_Node_Str");
  return false;
}
DBFunc.resizeCluster(cluster,id);
MainUtil.sendMessage(plr,C.CLUSTER_RESIZED);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
PlotCluster cluster;
if (args.length == 2) {
cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
  MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
  return false;
}
}
 else {
cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
  MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
  return false;
}
}
if (!cluster.owner.equals(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
  MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
  return false;
}
}
ClusterManager.regenCluster(cluster);
MainUtil.sendMessage(plr,C.CLUSTER_REGENERATED);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 2) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
final UUID uuid=UUIDHandler.getUUID(args[1]);
if (uuid == null) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[1]);
return false;
}
if (!cluster.hasRights(uuid)) {
cluster.invited.add(uuid);
final String world=plr.getLocation().getWorld();
DBFunc.setInvited(world,cluster,uuid);
final PlotPlayer player=UUIDHandler.getPlayer(uuid);
if (player != null) {
MainUtil.sendMessage(player,C.CLUSTER_INVITED,cluster.getName());
}
}
MainUtil.sendMessage(plr,C.CLUSTER_ADDED_USER);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 2) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
final UUID uuid=UUIDHandler.getUUID(args[1]);
if (uuid == null) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[1]);
return false;
}
if (uuid.equals(UUIDHandler.getUUID(plr)) || uuid.equals(cluster.owner) || !cluster.hasRights(uuid)) {
MainUtil.sendMessage(plr,C.CANNOT_KICK_PLAYER,cluster.getName());
return false;
}
if (cluster.helpers.contains(uuid)) {
cluster.helpers.remove(uuid);
DBFunc.removeHelper(cluster,uuid);
}
cluster.invited.remove(uuid);
DBFunc.removeInvited(cluster,uuid);
final PlotPlayer player=UUIDHandler.getPlayer(uuid);
if (player != null) {
MainUtil.sendMessage(player,C.CLUSTER_REMOVED,cluster.getName());
}
for (final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld(),uuid)) {
final PlotCluster current=ClusterManager.getCluster(plot);
if ((current != null) && current.equals(cluster)) {
final String world=plr.getLocation().getWorld();
DBFunc.delete(world,plot);
}
}
MainUtil.sendMessage(plr,C.CLUSTER_KICKED_USER);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
PlotCluster cluster;
if (args.length == 2) {
cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
return false;
}
}
 else {
cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
}
final UUID uuid=UUIDHandler.getUUID(plr);
if (!cluster.hasRights(uuid)) {
MainUtil.sendMessage(plr,C.CLUSTER_NOT_ADDED);
return false;
}
if (uuid.equals(cluster.owner)) {
MainUtil.sendMessage(plr,C.CLUSTER_CANNOT_LEAVE);
return false;
}
if (cluster.helpers.contains(uuid)) {
cluster.helpers.remove(uuid);
DBFunc.removeHelper(cluster,uuid);
}
cluster.invited.remove(uuid);
DBFunc.removeInvited(cluster,uuid);
MainUtil.sendMessage(plr,C.CLUSTER_REMOVED,cluster.getName());
for (final Plot plot : PlotSquared.getPlots(plr.getLocation().getWorld(),uuid)) {
final PlotCluster current=ClusterManager.getCluster(plot);
if ((current != null) && current.equals(cluster)) {
final String world=plr.getLocation().getWorld();
DBFunc.delete(world,plot);
}
}
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 3) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
final UUID uuid=UUIDHandler.getUUID(args[2]);
if (uuid == null) {
MainUtil.sendMessage(plr,C.INVALID_PLAYER,args[1]);
return false;
}
if (args[1].toLowerCase().equals("String_Node_Str")) {
cluster.helpers.add(uuid);
return MainUtil.sendMessage(plr,C.CLUSTER_ADDED_HELPER);
}
if (args[1].toLowerCase().equals("String_Node_Str")) {
cluster.helpers.remove(uuid);
return MainUtil.sendMessage(plr,C.CLUSTER_REMOVED_HELPER);
}
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if (args.length != 2) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
return false;
}
final UUID uuid=UUIDHandler.getUUID(plr);
if (!cluster.hasRights(uuid)) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
plr.teleport(ClusterManager.getHome(cluster));
return MainUtil.sendMessage(plr,C.CLUSTER_TELEPORTING);
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
PlotCluster cluster;
if (args.length == 2) {
cluster=ClusterManager.getCluster(plr.getLocation().getWorld(),args[1]);
if (cluster == null) {
MainUtil.sendMessage(plr,C.INVALID_CLUSTER,args[1]);
return false;
}
}
 else {
cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
}
final String id=cluster.toString();
String owner=UUIDHandler.getName(cluster.owner);
if (owner == null) {
owner="String_Node_Str";
}
final String name=cluster.getName();
final String size=((cluster.getP2().x - cluster.getP1().x) + 1) + "String_Node_Str" + ((cluster.getP2().y - cluster.getP1().y) + 1);
final String rights=cluster.hasRights(UUIDHandler.getUUID(plr)) + "String_Node_Str";
String message=C.CLUSTER_INFO.s();
message=message.replaceAll("String_Node_Str",id);
message=message.replaceAll("String_Node_Str",owner);
message=message.replaceAll("String_Node_Str",name);
message=message.replaceAll("String_Node_Str",size);
message=message.replaceAll("String_Node_Str",rights);
MainUtil.sendMessage(plr,message);
return true;
}
case "String_Node_Str":
case "String_Node_Str":
case "String_Node_Str":
{
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
if ((args.length != 1) && (args.length != 2)) {
MainUtil.sendMessage(plr,C.COMMAND_SYNTAX,"String_Node_Str");
return false;
}
final PlotCluster cluster=ClusterManager.getCluster(plr.getLocation());
if (cluster == null) {
MainUtil.sendMessage(plr,C.NOT_IN_CLUSTER);
return false;
}
if (!cluster.hasHelperRights(UUIDHandler.getUUID(plr))) {
if (!Permissions.hasPermission(plr,"String_Node_Str")) {
MainUtil.sendMessage(plr,C.NO_PERMISSION,"String_Node_Str");
return false;
}
}
final Location base=ClusterManager.getClusterBottom(cluster);
final Location relative=plr.getLocation().subtract(base.getX(),0,base.getZ());
final BlockLoc blockloc=new BlockLoc(relative.getX(),relative.getY(),relative.getZ());
cluster.settings.setPosition(blockloc);
DBFunc.setPosition(cluster,relative.getX() + "String_Node_Str" + relative.getY()+ "String_Node_Str"+ relative.getZ());
return MainUtil.sendMessage(plr,C.POSITION_SET);
}
}
MainUtil.sendMessage(plr,C.CLUSTER_AVAILABLE_ARGS);
return false;
}