mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixed purge in offline mode servers + typo
This commit is contained in:
parent
1f8702f072
commit
a1d476321f
@ -107,17 +107,6 @@ public class Purge extends SubCommand {
|
|||||||
DBFunc.purgeIds(worldname, ids);
|
DBFunc.purgeIds(worldname, ids);
|
||||||
return finishPurge(DBid == Integer.MAX_VALUE ? 1 : 0);
|
return finishPurge(DBid == Integer.MAX_VALUE ? 1 : 0);
|
||||||
}
|
}
|
||||||
final UUID uuid = UUIDHandler.getUUID(args[0]);
|
|
||||||
if (uuid != null) {
|
|
||||||
final Set<Plot> plots = PlotSquared.getPlots(worldname, uuid);
|
|
||||||
final Set<PlotId> ids = new HashSet<>();
|
|
||||||
for (final Plot plot : plots) {
|
|
||||||
ids.add(plot.id);
|
|
||||||
}
|
|
||||||
int length = ids.size();
|
|
||||||
DBFunc.purge(worldname, ids);
|
|
||||||
return finishPurge(length);
|
|
||||||
}
|
|
||||||
if (arg.equals("all")) {
|
if (arg.equals("all")) {
|
||||||
final Set<PlotId> ids = PlotSquared.getPlots(worldname).keySet();
|
final Set<PlotId> ids = PlotSquared.getPlots(worldname).keySet();
|
||||||
int length = ids.size();
|
int length = ids.size();
|
||||||
@ -160,6 +149,17 @@ public class Purge extends SubCommand {
|
|||||||
DBFunc.purge(worldname, ids);
|
DBFunc.purge(worldname, ids);
|
||||||
return finishPurge(length);
|
return finishPurge(length);
|
||||||
}
|
}
|
||||||
|
final UUID uuid = UUIDHandler.getUUID(args[0]);
|
||||||
|
if (uuid != null) {
|
||||||
|
final Set<Plot> plots = PlotSquared.getPlots(worldname, uuid);
|
||||||
|
final Set<PlotId> ids = new HashSet<>();
|
||||||
|
for (final Plot plot : plots) {
|
||||||
|
ids.add(plot.id);
|
||||||
|
}
|
||||||
|
int length = ids.size();
|
||||||
|
DBFunc.purge(worldname, ids);
|
||||||
|
return finishPurge(length);
|
||||||
|
}
|
||||||
MainUtil.sendMessage(plr, C.PURGE_SYNTAX);
|
MainUtil.sendMessage(plr, C.PURGE_SYNTAX);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ public enum C {
|
|||||||
* purge
|
* purge
|
||||||
*/
|
*/
|
||||||
PURGE_SYNTAX("Use /plot purge <x;z|player|unowned|unknown|all> <world>"),
|
PURGE_SYNTAX("Use /plot purge <x;z|player|unowned|unknown|all> <world>"),
|
||||||
PURGE_SUCCESS("$4Successfully purge %s plots"),
|
PURGE_SUCCESS("$4Successfully purged %s plots"),
|
||||||
/*
|
/*
|
||||||
* trim
|
* trim
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user