diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-06-10 18:31:28 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-06-10 18:31:28 +0100 |
commit | 024aff0af5a7b24dd540b0a3601d9d92a44c2687 (patch) | |
tree | 89f89cb50cc9055df76c6730627167dd76c59deb | |
parent | 57c1d75779c41fa49ca71b0ffae1facd23804ce0 (diff) | |
download | Essentials-024aff0af5a7b24dd540b0a3601d9d92a44c2687.tar Essentials-024aff0af5a7b24dd540b0a3601d9d92a44c2687.tar.gz Essentials-024aff0af5a7b24dd540b0a3601d9d92a44c2687.tar.lz Essentials-024aff0af5a7b24dd540b0a3601d9d92a44c2687.tar.xz Essentials-024aff0af5a7b24dd540b0a3601d9d92a44c2687.zip |
Remove dura command and merge into itemdb.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commanddurability.java | 41 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java | 12 | ||||
-rw-r--r-- | Essentials/src/plugin.yml | 6 |
3 files changed, 13 insertions, 46 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java b/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java deleted file mode 100644 index 130164443..000000000 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddurability.java +++ /dev/null @@ -1,41 +0,0 @@ -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.inventory.ItemStack;
-
-public class Commanddurability extends EssentialsCommand
-{
- public int durability;
- public int maxuses;
-
- public Commanddurability()
- {
- super("durability");
- }
-
- @Override
- protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
- {
- ItemStack itemStack = user.getItemInHand();
- maxuses = itemStack.getType().getMaxDurability();
- durability = ((itemStack.getType().getMaxDurability() + 1) - itemStack.getDurability());
- if (itemStack.getType() != Material.AIR)
- {
- if (maxuses != 0)
- {
- user.sendMessage(_("durability", Integer.toString(durability)));
- }
- else
- {
- user.sendMessage(_("noDurability"));
- }
- }
- else
- {
- user.sendMessage(_("nothingInHand"));
- }
- }
-}
\ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java index c35656c72..728a419a9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java @@ -1,5 +1,7 @@ package com.earth2me.essentials.commands; +import static com.earth2me.essentials.I18n._; +import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -33,5 +35,15 @@ public class Commanditemdb extends EssentialsCommand itemStack = ess.getItemDb().get(args[0]); } sender.sendMessage(itemStack.getType().toString() + "- " + itemStack.getTypeId() + ":" + Integer.toString(itemStack.getData().getData())); + + int maxuses = itemStack.getType().getMaxDurability(); + int durability = ((itemStack.getType().getMaxDurability() + 1) - itemStack.getDurability()); + if (itemStack.getType() != Material.AIR) + { + if (maxuses != 0) + { + sender.sendMessage(_("durability", Integer.toString(durability))); + } + } } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index c1af012d4..55fb38de0 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -79,10 +79,6 @@ commands: description: States current depth, relative to sea level. usage: /depth aliases: [edepth] - durability: - description: Shows the uses an item has left. - usage: /<command> - aliases: [edura,dura,edurability] eco: description: Manages the server economy. usage: /<command> <give|take|reset> <player> <amount> @@ -114,7 +110,7 @@ commands: itemdb: description: Searches for an item. usage: /<command> <item> - aliases: [eitemdb] + aliases: [eitemdb,itemno,eitemno,durability,dura,edura,edurability] fireball: description: Throw a fireball. usage: /<command> [small] |