From fe1dd0d0f3d4caf3862eff2cc4322707d024384d Mon Sep 17 00:00:00 2001 From: drtshock Date: Fri, 7 Aug 2015 16:53:20 -0500 Subject: [PATCH] Add separate permission for bulk sell and hand sell. --- .../src/com/earth2me/essentials/commands/Commandsell.java | 7 +++++++ Essentials/src/messages.properties | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 5390e2b7f..2257ae5a4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -26,6 +26,13 @@ public class Commandsell extends EssentialsCommand { if (args.length < 1) { throw new NotEnoughArgumentsException(); } + + if (args[0].equalsIgnoreCase("hand") && !user.isAuthorized("essentials.sell.hand")) { + throw new Exception(tl("sellHandPermission")); + } else if (args[0].equalsIgnoreCase("inventory") || args[0].equalsIgnoreCase("invent") || args[0].equalsIgnoreCase("all") && !user.isAuthorized("essentials.sell.bulk")) { + throw new Exception(tl("sellBulkPermission")); + } + List is = ess.getItemDb().getMatching(user, args); int count = 0; diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index c931aaddd..477748054 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -386,6 +386,8 @@ second=second seconds=seconds seenOffline=\u00a76Player\u00a7c {0} \u00a76has been \u00a74offline\u00a76 since \u00a7c{1}\u00a76. seenOnline=\u00a76Player\u00a7c {0} \u00a76has been \u00a7aonline\u00a76 since \u00a7c{1}\u00a76. +sellBulkPermission=\u00a76You do not have permission to bulk sell. +sellHandPermission=\u00a76You do not have permission to bulk sell. serverFull=Server is full\! serverTotal=\u00a76Server Total\:\u00a7c {0} setBal=\u00a7aYour balance was set to {0}.