From a4d8d24f84ed9bec6a2c027e08a56b911d47b1ce Mon Sep 17 00:00:00 2001 From: kukelekuuk00 Date: Sat, 9 Jun 2012 23:06:09 +0200 Subject: DERP --- .../com/earth2me/essentials/commands/Commanddurability.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java b/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java index 548499c9d..873f6f259 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java @@ -1,10 +1,9 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; import org.bukkit.Material; import org.bukkit.Server; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; public class Commanddurability extends EssentialsCommand @@ -18,25 +17,25 @@ public class Commanddurability extends EssentialsCommand } @Override - protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - ItemStack itemStack = ((Player)sender).getItemInHand(); + ItemStack itemStack = user.getItemInHand(); maxuses = itemStack.getType().getMaxDurability(); durability = ((itemStack.getType().getMaxDurability() + 1) - itemStack.getDurability()); if (itemStack.getType() != Material.AIR) { if (maxuses != 0) { - sender.sendMessage(_("durability", Integer.toString(durability))); + user.sendMessage(_("durability", Integer.toString(durability))); } else { - sender.sendMessage(_("notATool")); + user.sendMessage(_("notATool")); } } else { - sender.sendMessage(_("nothingInHand")); + user.sendMessage(_("nothingInHand")); } } } \ No newline at end of file -- cgit v1.2.3