summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-06-10 18:31:28 +0100
committerKHobbits <rob@khobbits.co.uk>2012-06-10 18:31:28 +0100
commit35135e8c63cffec5407bde69f518e5d5d74d54d8 (patch)
tree9eb0f2f425e18868d9c292450d562b92c119c938
parentbd83ec0d31b3894f8941b0d6571f1e836f9f4689 (diff)
downloadEssentials-35135e8c63cffec5407bde69f518e5d5d74d54d8.tar
Essentials-35135e8c63cffec5407bde69f518e5d5d74d54d8.tar.gz
Essentials-35135e8c63cffec5407bde69f518e5d5d74d54d8.tar.lz
Essentials-35135e8c63cffec5407bde69f518e5d5d74d54d8.tar.xz
Essentials-35135e8c63cffec5407bde69f518e5d5d74d54d8.zip
Remove dura command and merge into itemdb.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanddurability.java41
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java12
-rw-r--r--Essentials/src/plugin.yml6
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]