Fix nested command configuration

This commit is contained in:
Jesse Boyd
2016-03-30 04:47:47 +11:00
parent 560ebf412b
commit bbe43f782c
3 changed files with 21 additions and 17 deletions

View File

@@ -147,7 +147,7 @@ public class MainCommand extends Command {
if (EconHandler.manager != null) {
PlotArea area = player.getApplicablePlotArea();
if (area != null) {
Double price = area.PRICES.get(cmd.getId());
Double price = area.PRICES.get(cmd.getFullId());
if (price != null && EconHandler.manager.getMoney(player) < price) {
failure.run();
return;
@@ -162,7 +162,7 @@ public class MainCommand extends Command {
if (EconHandler.manager != null) {
PlotArea area = player.getApplicablePlotArea();
if (area != null) {
Double price = area.PRICES.get(cmd.getId());
Double price = area.PRICES.get(cmd.getFullId());
if (price != null && EconHandler.manager.getMoney(player) < price) {
failure.run();
return;

View File

@@ -18,15 +18,15 @@ public abstract class SetCommand extends SubCommand {
return !sendMessage(plr, C.NOT_IN_PLOT);
}
if (!plot.hasOwner()) {
if (!Permissions.hasPermission(plr, "plots.admin.command." + getId())) {
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command." + getId());
if (!Permissions.hasPermission(plr, "plots.admin.command." + getFullId())) {
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command." + getFullId());
MainUtil.sendMessage(plr, C.PLOT_NOT_CLAIMED);
return false;
}
}
if (!plot.isOwner(plr.getUUID())) {
if (!Permissions.hasPermission(plr, "plots.admin.command." + getId())) {
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command." + getId());
if (!Permissions.hasPermission(plr, "plots.admin.command." + getFullId())) {
MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command." + getFullId());
MainUtil.sendMessage(plr, C.NO_PLOT_PERMS);
return false;
}