Add merge permission changes from master

This commit is contained in:
dordsor21 2019-01-18 19:02:12 +00:00
parent 330ab83ece
commit ca883c211a
2 changed files with 13 additions and 3 deletions

View File

@ -96,6 +96,10 @@ public class Merge extends SubCommand {
if (args.length == 2) {
terrain = "true".equalsIgnoreCase(args[1]);
}
if(!terrain && !Permissions.hasPermission(player, C.PERMISSION_MERGE_KEEPROAD)) {
MainUtil.sendMessage(player, C.NO_PERMISSION, C.PERMISSION_MERGE_KEEPROAD.s());
return true;
}
if (plot.autoMerge(-1, maxSize, uuid, terrain)) {
if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d) {
EconHandler.manager.withdrawMoney(player, price);
@ -128,6 +132,10 @@ public class Merge extends SubCommand {
} else {
terrain = true;
}
if(!terrain && !Permissions.hasPermission(player, C.PERMISSION_MERGE_KEEPROAD)) {
MainUtil.sendMessage(player, C.NO_PERMISSION, C.PERMISSION_MERGE_KEEPROAD.s());
return true;
}
if (plot.autoMerge(direction, maxSize - size, uuid, terrain)) {
if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d) {
EconHandler.manager.withdrawMoney(player, price);

View File

@ -46,7 +46,8 @@ public enum C {
"plots.admin.entry.denied", "static.permissions"), PERMISSION_ADMIN_ENTRY_FORCEFIELD(
"plots.admin.entry.forcefield", "static.permissions"), PERMISSION_COMMANDS_CHAT(
"plots.admin.command.chat", "static.permissions"), PERMISSION_MERGE_OTHER(
"plots.merge.other", "static.permissions"), PERMISSION_ADMIN_DESTROY_UNOWNED(
"plots.merge.other", "static.permissions"), PERMISSION_MERGE_KEEPROAD(
"plots.merge.keeproad", "static.permissions"), PERMISSION_ADMIN_DESTROY_UNOWNED(
"plots.admin.destroy.unowned", "static.permissions"), PERMISSION_ADMIN_DESTROY_GROUNDLEVEL(
"plots.admin.destroy.groundlevel", "static.permissions"), PERMISSION_ADMIN_DESTROY_OTHER(
"plots.admin.destroy.other", "static.permissions"), PERMISSION_ADMIN_DESTROY_ROAD(
@ -141,8 +142,9 @@ public enum C {
PERMISSION_SET_COMPONENT("plots.set.%s0", "static.permissions"), PERMISSION_ADMIN_COMMAND(
"plots.admin.command.%s0", "static.permissions"),
PERMISSION_ADMIN_COMMAND_UNLINK("plots.admin.command.unlink", "static.permissions"), PERMISSION_VISIT_UNOWNED(
"plots.visit.unowned", "static.permissions"),
PERMISSION_ADMIN_COMMAND_UNLINK("plots.admin.command.unlink",
"static.permissions"), PERMISSION_VISIT_UNOWNED("plots.visit.unowned",
"static.permissions"),
PERMISSION_VISIT_OWNED("plots.visit.owned", "static.permissions"), PERMISSION_SHARED(
"plots.visit.shared", "static.permissions"),