summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandgive.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgive.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
index 68bfe8a30..065b76d03 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java
@@ -36,8 +36,7 @@ public class Commandgive extends EssentialsCommand
: (!ess.getUser(sender).isAuthorized("essentials.itemspawn.exempt")
&& !ess.getUser(sender).canSpawnItem(stack.getTypeId()))))
{
- sender.sendMessage(ChatColor.RED + "You are not allowed to spawn the item " + itemname);
- return;
+ throw new Exception(ChatColor.RED + "You are not allowed to spawn the item " + itemname);
}
if (args.length > 2 && Integer.parseInt(args[2]) > 0)
{
@@ -46,13 +45,11 @@ public class Commandgive extends EssentialsCommand
if (stack.getType() == Material.AIR)
{
- sender.sendMessage(ChatColor.RED + "You can't give air.");
- return;
+ throw new Exception(ChatColor.RED + "You can't give air.");
}
User giveTo = getPlayer(server, args, 0);
String itemName = stack.getType().toString().toLowerCase().replace('_', ' ');
- charge(sender);
sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + ".");
giveTo.getInventory().addItem(stack);
giveTo.updateInventory();