cluster create feedback

This commit is contained in:
boy0001 2015-01-31 19:22:53 +11:00
parent 27da7070b2
commit debc7f6ab3
3 changed files with 30 additions and 0 deletions

View file

@ -215,6 +215,33 @@ public class ClusterManager {
return null;
}
public static PlotId estimatePlotId(Location loc) {
PlotId a = new PlotId(0, 0);
PlotId b = new PlotId(1, 1);
int xw;
int zw;
String world = loc.getWorld().getName();
PlotWorld plotworld = PlotMain.getWorldSettings(world);
if (plotworld == null) {
xw = 39;
zw = 39;
}
else {
PlotManager manager = PlotMain.getPlotManager(world);
Location al = manager.getPlotBottomLocAbs(plotworld, a);
Location bl = manager.getPlotBottomLocAbs(plotworld, b);
xw = bl.getBlockX() - al.getBlockX();
zw = bl.getBlockZ() - al.getBlockZ();
}
int x = loc.getBlockX();
int z = loc.getBlockZ();
return new PlotId((x/xw) + 1,(z/zw) + 1);
}
public static void regenCluster(final PlotCluster cluster) {
if (regenerating.contains(cluster.world + ":" + cluster.getName())) {
return;