mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +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);
|
final double price = priceExr == null ? 0d : priceExr.evaluate(size);
|
||||||
|
|
||||||
UUID uuid = player.getUUID();
|
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) {
|
if (direction == Direction.ALL) {
|
||||||
boolean terrain = true;
|
boolean terrain = true;
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
@ -185,14 +194,6 @@ public class Merge extends SubCommand {
|
|||||||
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
player.sendMessage(TranslatableCaption.of("merge.no_available_automerge"));
|
||||||
return false;
|
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
|
if (!force && this.econHandler.isEnabled(plotArea) && price > 0d
|
||||||
&& this.econHandler.getMoney(player) < price) {
|
&& this.econHandler.getMoney(player) < price) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
|
Loading…
Reference in New Issue
Block a user