Upgrades should now transition between v7 and v8
This commit is contained in:
parent
061c84d586
commit
6bea59ab5e
1 changed files with 15 additions and 7 deletions
|
@ -123,16 +123,24 @@ public enum Upgrade
|
|||
{
|
||||
Map<Upgrade, Integer> upgrades = new HashMap<Upgrade, Integer>();
|
||||
|
||||
if(nbtTags != null && nbtTags.hasKey("upgrades"))
|
||||
if(nbtTags != null)
|
||||
{
|
||||
NBTTagList list = nbtTags.getTagList("upgrades", NBT.TAG_COMPOUND);
|
||||
|
||||
for(int tagCount = 0; tagCount < list.tagCount(); tagCount++)
|
||||
if(nbtTags.hasKey("upgrades"))
|
||||
{
|
||||
NBTTagCompound compound = 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 = list.getCompoundTagAt(tagCount);
|
||||
|
||||
Upgrade upgrade = Upgrade.values()[compound.getInteger("type")];
|
||||
upgrades.put(upgrade, compound.getInteger("amount"));
|
||||
}
|
||||
}
|
||||
else if(nbtTags.hasKey("energyMultiplier") && nbtTags.hasKey("speedMultiplier")) //TODO remove soon
|
||||
{
|
||||
upgrades.put(Upgrade.ENERGY, nbtTags.getInteger("energyMultiplier"));
|
||||
upgrades.put(Upgrade.SPEED, nbtTags.getInteger("speedMultiplier"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue