summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-08-27 17:01:01 +0200
committersnowleo <schneeleo@gmail.com>2011-08-27 17:01:01 +0200
commit087e600d6d6d9e6192f62d25d76f541fd14740b5 (patch)
treed6dacd4132e7ea8b6a79c8c1cea94633edf46884
parentf18c3c7e1de14beffb85bcf45840a64c9544b282 (diff)
downloadEssentials-087e600d6d6d9e6192f62d25d76f541fd14740b5.tar
Essentials-087e600d6d6d9e6192f62d25d76f541fd14740b5.tar.gz
Essentials-087e600d6d6d9e6192f62d25d76f541fd14740b5.tar.lz
Essentials-087e600d6d6d9e6192f62d25d76f541fd14740b5.tar.xz
Essentials-087e600d6d6d9e6192f62d25d76f541fd14740b5.zip
Prevent that wrong ids are used in /kit
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkit.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
index 849ec2398..7f9a91590 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
@@ -9,6 +9,7 @@ import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.GregorianCalendar;
+import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@@ -124,7 +125,7 @@ public class Commandkit extends EssentialsCommand
for (String d : items)
{
String[] parts = d.split("[^0-9]+", 3);
- int id = Integer.parseInt(parts[0]);
+ int id = Material.getMaterial(Integer.parseInt(parts[0])).getId();
int amount = parts.length > 1 ? Integer.parseInt(parts[parts.length > 2 ? 2 : 1]) : 1;
short data = parts.length > 2 ? Short.parseShort(parts[1]) : 0;
HashMap<Integer,ItemStack> overfilled = user.getInventory().addItem(new ItemStack(id, amount, data));