mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixes #1691
This commit is contained in:
parent
5f9bd853ec
commit
613d79fb39
@ -1077,6 +1077,13 @@ public class PS{
|
|||||||
return new HashSet<>(myPlots);
|
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) {
|
public Set<Plot> getBasePlots(final UUID uuid) {
|
||||||
final ArrayList<Plot> myplots = new ArrayList<>();
|
final ArrayList<Plot> myplots = new ArrayList<>();
|
||||||
foreachBasePlot(new RunnableVal<Plot>() {
|
foreachBasePlot(new RunnableVal<Plot>() {
|
||||||
|
@ -76,7 +76,8 @@ public class Visit extends Command {
|
|||||||
}
|
}
|
||||||
page = Integer.parseInt(args[1]);
|
page = Integer.parseInt(args[1]);
|
||||||
case 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])) {
|
if (page == Integer.MIN_VALUE && user == null && MathMan.isInteger(args[0])) {
|
||||||
page = Integer.parseInt(args[0]);
|
page = Integer.parseInt(args[0]);
|
||||||
unsorted = PS.get().getBasePlots(player);
|
unsorted = PS.get().getBasePlots(player);
|
||||||
|
@ -536,6 +536,13 @@ public abstract class PlotArea {
|
|||||||
return getPlotsAbs(uuid).size();
|
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) {
|
public int getPlotCount(PlotPlayer player) {
|
||||||
return player != null ? getPlotCount(player.getUUID()) : 0;
|
return player != null ? getPlotCount(player.getUUID()) : 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user