mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Add -f override for plot move
This commit is contained in:
parent
5d04c64d48
commit
ae1e58c0ac
@ -31,15 +31,23 @@ public class Move extends SubCommand {
|
|||||||
MainUtil.sendMessage(player, C.NO_PLOT_PERMS);
|
MainUtil.sendMessage(player, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
boolean override = false;
|
||||||
|
if (args.length == 2 && args[1].equalsIgnoreCase("-f")) {
|
||||||
|
args = new String[]{ args[0] };
|
||||||
|
override = true;
|
||||||
|
}
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
C.COMMAND_SYNTAX.send(player, getUsage());
|
C.COMMAND_SYNTAX.send(player, getUsage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Plot plot2 = MainUtil.getPlotFromString(player, args[0], true);
|
PlotArea area = PS.get().getPlotAreaByString(args[0]);
|
||||||
if (plot2 == null) {
|
Plot plot2;
|
||||||
PlotArea area = PS.get().getPlotAreaByString(args[0]);
|
if (area == null) {
|
||||||
if (area == null)
|
plot2 = MainUtil.getPlotFromString(player, args[0], true);
|
||||||
|
if (plot2 == null) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
plot2 = area.getPlotAbs(plot1.getId());
|
plot2 = area.getPlotAbs(plot1.getId());
|
||||||
}
|
}
|
||||||
if (plot1.equals(plot2)) {
|
if (plot1.equals(plot2)) {
|
||||||
@ -47,7 +55,7 @@ public class Move extends SubCommand {
|
|||||||
MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot copy <X;Z>");
|
MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot copy <X;Z>");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot1.getArea().isCompatible(plot2.getArea())) {
|
if (!plot1.getArea().isCompatible(plot2.getArea()) && (!override || !Permissions.hasPermission(player, C.PERMISSION_ADMIN.s()))) {
|
||||||
C.PLOTWORLD_INCOMPATIBLE.send(player);
|
C.PLOTWORLD_INCOMPATIBLE.send(player);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user