A few fixes

This commit is contained in:
Aidan C. Brady committed 2014-07-21 21:33:43 -04:00
1 parent 076c5f7377
commit 25cf5236ea
14 files changed
+15 -38

No files matched your search

+9 -5
View File
@@ -54,14 +54,18 @@ public enum Upgrade
public static Map<Upgrade, Integer> buildMap(NBTTagCompound nbtTags)
{
Map<Upgrade, Integer> upgrades = new HashMap<Upgrade, Integer>();
NBTTagList list = nbtTags.getTagList("upgrades", NBT.TAG_COMPOUND);
for(int tagCount = 0; tagCount < list.tagCount(); tagCount++)
if(nbtTags.hasKey("upgrades"))
{
NBTTagCompound compound = (NBTTagCompound)list.getCompoundTagAt(tagCount);
NBTTagList list = nbtTags.getTagList("upgrades", NBT.TAG_COMPOUND);
Upgrade upgrade = Upgrade.values()[compound.getInteger("type")];
upgrades.put(upgrade, compound.getInteger("amount"));
for(int tagCount = 0; tagCount < list.tagCount(); tagCount++)
{
NBTTagCompound compound = (NBTTagCompound)list.getCompoundTagAt(tagCount);
Upgrade upgrade = Upgrade.values()[compound.getInteger("type")];
upgrades.put(upgrade, compound.getInteger("amount"));
}
}
return upgrades;