mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-07 21:13:11 +00:00
Added cluster regeneration
This commit is contained in:
parent
d0fd8f09c1
commit
25355f4906
13 changed files with 390 additions and 188 deletions
|
@ -177,14 +177,14 @@ public class Auto extends SubCommand {
|
|||
PlotId top = cluster.getP2();
|
||||
PlotId origin = new PlotId((bot.x + top.x) / 2, (bot.y + top.y) / 2);
|
||||
PlotId id = new PlotId(0, 0);
|
||||
int width = Math.max(top.x - bot.x, top.y - bot.y);
|
||||
int width = Math.max(top.x - bot.x + 1, top.y - bot.y + 1);
|
||||
int max = width * width;
|
||||
//
|
||||
for (int i = 0; i <= max; i++) {
|
||||
PlotId currentId = new PlotId(origin.x + id.x, origin.y + id.y);
|
||||
Plot current = PlotHelper.getPlot(world, currentId);
|
||||
if (current != null && !current.hasOwner() && cluster.equals(ClusterManager.getCluster(current))) {
|
||||
Claim.claimPlot(plr, plot, true, true);
|
||||
if (current != null && (current.hasOwner() == false) && (current.settings.isMerged() == false) && cluster.equals(ClusterManager.getCluster(current))) {
|
||||
Claim.claimPlot(plr, current, true, true);
|
||||
return true;
|
||||
}
|
||||
id = getNextPlot(id, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue