summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddurability.java13
1 files 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