mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-07-13 09:14:31 +00:00
merge
This commit is contained in:
parent
1c2a5a2f91
commit
64d81326aa
3 changed files with 42 additions and 23 deletions
|
@ -54,6 +54,28 @@ public class MainUtil {
|
|||
public static HashMap<String, PlotId> lastPlot = new HashMap<>();
|
||||
public static HashMap<String, Integer> worldBorder = new HashMap<>();
|
||||
|
||||
public static ArrayList<PlotId> getMaxPlotSelectionIds(final String world, PlotId pos1, PlotId pos2) {
|
||||
|
||||
final Plot plot1 = PlotSquared.getPlots(world).get(pos1);
|
||||
final Plot plot2 = PlotSquared.getPlots(world).get(pos2);
|
||||
|
||||
if (plot1 != null) {
|
||||
pos1 = getBottomPlot(plot1).id;
|
||||
}
|
||||
|
||||
if (plot2 != null) {
|
||||
pos2 = getTopPlot(plot2).id;
|
||||
}
|
||||
|
||||
final ArrayList<PlotId> myplots = new ArrayList<>();
|
||||
for (int x = pos1.x; x <= pos2.x; x++) {
|
||||
for (int y = pos1.y; y <= pos2.y; y++) {
|
||||
myplots.add(new PlotId(x, y));
|
||||
}
|
||||
}
|
||||
return myplots;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of plots for a player
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue