Use the correct Map<String, Tag> when writing enchantments

This commit is contained in:
zml2008
2012-03-03 16:46:51 -08:00
parent 4e91f4e988
commit 40aa6aca60
4 changed files with 17 additions and 17 deletions

View File

@ -117,7 +117,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock, ContainerB
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
Map<String, Tag> enchantment = new HashMap<String, Tag>();
CompoundTag enchantcompound = new CompoundTag(null, ench);
CompoundTag enchantcompound = new CompoundTag(null, enchantment);
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
list.add(enchantcompound);
@ -178,7 +178,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock, ContainerB
itemstack.getEnchantments().put((int) enchid, (int)enchlvl);
}
}
newItems[slot] = itemstack;
}
}