Add permission to create an admin shop

This commit is contained in:
Eric 2016-04-13 21:05:21 +02:00
parent ecf48629e5
commit 8d190f93c0
4 changed files with 17 additions and 3 deletions

View File

@ -288,6 +288,9 @@ messages:
# Set the message when a not permitted player tries to create an infinite shop.
create-infinite: "&cYou don't have permission to create an infinite shop."
# Set the message when a not permitted player tries to create an admin shop.
create-admin: "&cYou don't have permission to create an admin shop."
# Set the message when a not permitted player tries to open another players' shop.
open-others: "&cYou don't have permission to open this chest."

View File

@ -30,6 +30,11 @@ permissions:
children:
shopchest.create: true
default: op
shopchest.create.admin:
description: Allows you to create an admin shop.
children:
shopchest.create: true
default: op
shopchest.create.protected:
description: Allows you to create a shop on a protected chest.
children:

View File

@ -89,8 +89,13 @@ public class Commands extends BukkitCommand {
} else if (args[4].equalsIgnoreCase("admin")) {
create(args, ShopType.ADMIN, p);
return true;
if (perm.has(p, "shopchest.create.admin")) {
create(args, ShopType.ADMIN, p);
return true;
} else {
p.sendMessage(Config.noPermission_createAdmin());
return true;
}
} else {

View File

@ -53,6 +53,7 @@ public class Config {
public static String shopInfo_isAdmin() { return plugin.getConfig().getString("messages.shop-info.is-admin").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");};
public static String noPermission_create() { return plugin.getConfig().getString("messages.no-permission.create").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");}
public static String noPermission_createInfinite() { return plugin.getConfig().getString("messages.no-permission.create-infinite").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");}
public static String noPermission_createAdmin() { return plugin.getConfig().getString("messages.no-permission.create-admin").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");}
public static String noPermission_openOthers() { return plugin.getConfig().getString("messages.no-permission.open-others").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");}
public static String noPermission_removeOthers() { return plugin.getConfig().getString("messages.no-permission.remove-others").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");}
public static String noPermission_buy() { return plugin.getConfig().getString("messages.no-permission.buy").replaceAll("(&([a-f0-9k-or]))", "\u00A7$2");}