mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-09-07 01:08:40 +02:00
Fixed plot cluster creation
This commit is contained in:
parent
83bdcbfb97
commit
d8561d278f
@ -98,8 +98,8 @@ public class Cluster extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
// check pos1 / pos2
|
||||
final PlotId pos1 = MainUtil.parseId(args[2]);
|
||||
final PlotId pos2 = MainUtil.parseId(args[3]);
|
||||
PlotId pos1 = MainUtil.parseId(args[2]);
|
||||
PlotId pos2 = MainUtil.parseId(args[3]);
|
||||
if ((pos1 == null) || (pos2 == null)) {
|
||||
MainUtil.sendMessage(plr, C.NOT_VALID_PLOT_ID);
|
||||
return false;
|
||||
@ -115,10 +115,14 @@ public class Cluster extends SubCommand {
|
||||
//check if overlap
|
||||
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)) {
|
||||
if ((intersects.size() > 0)) {
|
||||
MainUtil.sendMessage(plr, C.CLUSTER_INTERSECTION, intersects.size() + "");
|
||||
return false;
|
||||
}
|
||||
if ((pos2.x < pos1.x) || (pos2.y < pos1.y) ) {
|
||||
pos1 = new PlotId(Math.min(pos1.x, pos2.x), Math.min(pos1.y, pos2.y));
|
||||
pos2 = new PlotId(Math.max(pos1.x, pos2.x), Math.max(pos1.y, pos2.y));
|
||||
}
|
||||
// create cluster
|
||||
final String world = plr.getLocation().getWorld();
|
||||
final PlotCluster cluster = new PlotCluster(world, pos1, pos2, UUIDHandler.getUUID(plr));
|
||||
|
Loading…
Reference in New Issue
Block a user