From 7458b09a175fddb5fe626497b37a0843c2b43caf Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Sun, 26 Feb 2012 10:53:40 +0100 Subject: [PATCH] Fix for 1.1-R4 fallback load of old inventories --- .../minecraft/limitedcreative/store/Fallback.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/de/jaschastarke/minecraft/limitedcreative/store/Fallback.java b/src/de/jaschastarke/minecraft/limitedcreative/store/Fallback.java index f817c15..7835c75 100644 --- a/src/de/jaschastarke/minecraft/limitedcreative/store/Fallback.java +++ b/src/de/jaschastarke/minecraft/limitedcreative/store/Fallback.java @@ -78,9 +78,11 @@ public class Fallback { return section.getItemStack(path); } else { ConfigurationSection s = section.getConfigurationSection(path); - Map serialize = s.getValues(false); - serialize.remove("enchantments"); - ItemStack result = ItemStack.deserialize(serialize); + Material type = Material.getMaterial(s.getString("type")); + short damage = new Integer(s.getInt("damage", 0)).shortValue(); + int amount = s.getInt("amaount", 1); + + ItemStack result = new ItemStack(type, amount, damage); Map item = section.getConfigurationSection(path).getValues(false); item.remove("enchantments"); if (s.contains("enchantments")) {