diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-08-10 10:45:24 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-08-10 10:45:24 +0100 |
commit | 47c82175112f3b221d019b06f6049fa8295e622f (patch) | |
tree | 0a45a172ede671f15c6c86aa75d913e497645a67 | |
parent | db50d455df2c3accec9cf97e3698df2323949959 (diff) | |
download | Essentials-47c82175112f3b221d019b06f6049fa8295e622f.tar Essentials-47c82175112f3b221d019b06f6049fa8295e622f.tar.gz Essentials-47c82175112f3b221d019b06f6049fa8295e622f.tar.lz Essentials-47c82175112f3b221d019b06f6049fa8295e622f.tar.xz Essentials-47c82175112f3b221d019b06f6049fa8295e622f.zip |
Merge diff from krnlyng:
Adjust item spawn, to allow for match native names.
3 files changed, 7 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/ItemDb.java b/Essentials/src/com/earth2me/essentials/ItemDb.java index d7e534341..8e05b17fb 100644 --- a/Essentials/src/com/earth2me/essentials/ItemDb.java +++ b/Essentials/src/com/earth2me/essentials/ItemDb.java @@ -163,6 +163,11 @@ public class ItemDb implements IConf metaData = durabilities.get(itemname); } } + else if(Material.getMaterial(itemname) != null) + { + itemid = Material.getMaterial(itemname).getId(); + metaData = 0; + } else { throw new Exception(Util.format("unknownItemName", id)); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index b029df098..21eea2c70 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -50,7 +50,7 @@ public class Commandgive extends EssentialsCommand } User giveTo = getPlayer(server, args, 0); - String itemName = stack.getType().name().toLowerCase().replace('_', ' '); + String itemName = stack.getType().toString().toLowerCase().replace('_', ' '); charge(sender); sender.sendMessage(ChatColor.BLUE + "Giving " + stack.getAmount() + " of " + itemName + " to " + giveTo.getDisplayName() + "."); giveTo.getInventory().addItem(stack); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index 4961f714d..79e8344f1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -46,7 +46,7 @@ public class Commanditem extends EssentialsCommand return; } - String itemName = stack.getType().name().toLowerCase().replace('_', ' '); + String itemName = stack.getType().toString().toLowerCase().replace('_', ' '); charge(user); user.sendMessage(Util.format("itemSpawn", stack.getAmount(), itemName)); user.getInventory().addItem(stack); |