Fixed casting in ItemStack.deserialize.

By: starrynte <starrynte@gmail.com>
This commit is contained in:
Bukkit/Spigot 2012-02-01 21:30:01 -08:00
parent e423860f9f
commit 1749f26e03

View File

@ -356,18 +356,18 @@ public class ItemStack implements ConfigurationSerializable {
public static ItemStack deserialize(Map<String, Object> args) {
Material type = Material.getMaterial((String) args.get("type"));
int damage = 0;
short damage = 0;
int amount = 1;
if (args.containsKey("damage")) {
damage = (Integer) args.get("damage");
damage = (Short) args.get("damage");
}
if (args.containsKey("amount")) {
amount = (Integer) args.get("amount");
}
ItemStack result = new ItemStack(type, amount, (short) damage);
ItemStack result = new ItemStack(type, amount, damage);
if (args.containsKey("enchantments")) {
Object raw = args.get("enchantments");