mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Check plot ownership/event before handling Direction.ALL
This commit is contained in:
parent
2e64ac6d25
commit
31522b6502
@ -157,6 +157,15 @@ public class Merge extends SubCommand {
|
||||
final double price = priceExr == null ? 0d : priceExr.evaluate(size);
|
||||
|
||||
UUID uuid = player.getUUID();
|
||||
|
||||
if (!force && !plot.isOwner(uuid)) {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||
return false;
|
||||
} else {
|
||||
uuid = plot.getOwnerAbs();
|
||||
}
|
||||
}
|
||||
if (direction == Direction.ALL) {
|
||||
boolean terrain = true;
|
||||
if (args.length == 2) {
|
||||
@ -185,14 +194,6 @@ public class Merge extends SubCommand {
|
||||
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
||||
return false;
|
||||
}
|
||||
if (!force && !plot.isOwner(uuid)) {
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMMAND_MERGE)) {
|
||||
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
|
||||
return false;
|
||||
} else {
|
||||
uuid = plot.getOwnerAbs();
|
||||
}
|
||||
}
|
||||
if (!force && this.econHandler.isEnabled(plotArea) && price > 0d
|
||||
&& this.econHandler.getMoney(player) < price) {
|
||||
player.sendMessage(
|
||||
|
Loading…
Reference in New Issue
Block a user