summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkukelekuuk00 <luuk3904@hotmail.com>2012-06-09 23:06:09 +0200
committerkukelekuuk00 <luuk3904@hotmail.com>2012-06-09 23:06:09 +0200
commita4d8d24f84ed9bec6a2c027e08a56b911d47b1ce (patch)
tree06f9433ff761bb5d98c6deb371b718e248728e17
parent4135c3ddf80334e125cdda99373c28f898aa5487 (diff)
downloadEssentials-a4d8d24f84ed9bec6a2c027e08a56b911d47b1ce.tar
Essentials-a4d8d24f84ed9bec6a2c027e08a56b911d47b1ce.tar.gz
Essentials-a4d8d24f84ed9bec6a2c027e08a56b911d47b1ce.tar.lz
Essentials-a4d8d24f84ed9bec6a2c027e08a56b911d47b1ce.tar.xz
Essentials-a4d8d24f84ed9bec6a2c027e08a56b911d47b1ce.zip
DERP
-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