mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Fixes #1691
This commit is contained in:
parent
5f9bd853ec
commit
613d79fb39
3 changed files with 16 additions and 1 deletions
|
@ -1077,6 +1077,13 @@ public class PS{
|
|||
return new HashSet<>(myPlots);
|
||||
}
|
||||
|
||||
public boolean hasPlot(final UUID uuid) {
|
||||
for (PlotArea area : manager.getAllPlotAreas()) {
|
||||
if (area.hasPlot(uuid)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Set<Plot> getBasePlots(final UUID uuid) {
|
||||
final ArrayList<Plot> myplots = new ArrayList<>();
|
||||
foreachBasePlot(new RunnableVal<Plot>() {
|
||||
|
|
|
@ -76,7 +76,8 @@ public class Visit extends Command {
|
|||
}
|
||||
page = Integer.parseInt(args[1]);
|
||||
case 1:
|
||||
UUID user = (args.length == 2 || (page != Integer.MIN_VALUE || !MathMan.isInteger(args[0]))) ? UUIDHandler.getUUIDFromString(args[0]) : null;
|
||||
UUID user = UUIDHandler.getUUIDFromString(args[0]);
|
||||
if (user != null && !PS.get().hasPlot(user)) user = null;
|
||||
if (page == Integer.MIN_VALUE && user == null && MathMan.isInteger(args[0])) {
|
||||
page = Integer.parseInt(args[0]);
|
||||
unsorted = PS.get().getBasePlots(player);
|
||||
|
|
|
@ -536,6 +536,13 @@ public abstract class PlotArea {
|
|||
return getPlotsAbs(uuid).size();
|
||||
}
|
||||
|
||||
public boolean hasPlot(UUID uuid) {
|
||||
for (Entry<PlotId, Plot> entry : this.plots.entrySet()) {
|
||||
if (entry.getValue().isOwner(uuid)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getPlotCount(PlotPlayer player) {
|
||||
return player != null ? getPlotCount(player.getUUID()) : 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue