This commit is contained in:
boy0001 2015-04-26 16:29:58 +10:00
parent c09c5b048e
commit ec80151cd9
25 changed files with 417 additions and 371 deletions

View file

@ -141,9 +141,9 @@ public class ClusterManager {
public static PlotCluster getCluster(final Plot plot) {
return getCluster(plot.world, plot.id);
}
public static PlotCluster getCluster(final Location loc) {
final String world = loc.getWorld();
public static PlotCluster getClusterAbs(final Location loc) {
String world = loc.getWorld();
if ((last != null) && last.world.equals(world)) {
if (contains(last, loc)) {
return last;
@ -164,6 +164,16 @@ public class ClusterManager {
}
return null;
}
public static PlotCluster getCluster(final Location loc) {
final String world = loc.getWorld();
PlotManager manager = PlotSquared.getPlotManager(world);
PlotId id = manager.getPlotIdAbs(PlotSquared.getPlotWorld(world), loc.getX(), loc.getY(), loc.getZ());
if (id != null) {
return getCluster(world, id);
}
return getClusterAbs(loc);
}
public static PlotCluster getCluster(final String world, final PlotId id) {
if ((last != null) && last.world.equals(world)) {