Fixed NBT issue with the new quest kill amounts.

This commit is contained in:
luisc committed 2022-01-27 06:14:03 -06:00
1 parent f876f13d77
commit fcaafe4b26
2 files changed
+17 -7

No files matched your search

+2 -1
View File
@@ -56,8 +56,9 @@ public class DataInventory implements IInventory{
for(int i = 0; i < oldDropChance.entrySet().size(); i++){
dropchance.put(i, Double.valueOf(oldDropChance.get(i)));
}
} else {
dropchance = NBTTags.getIntegerDoubleMap(nbttagcompound.getTagList("DoubleDropChance", 10));
}
dropchance = NBTTags.getIntegerDoubleMap(nbttagcompound.getTagList("DoubleDropChance", 10));
lootMode = nbttagcompound.getInteger("LootMode");
}
@@ -22,15 +22,24 @@ public class QuestKill extends QuestInterface implements IQuestKill {
public int targetType = 0;
@Override
public void readEntityFromNBT(NBTTagCompound compound) {
targets = NBTTags.getStringIntegerMap(compound.getTagList("QuestDialogs", 10));
targetType = compound.getInteger("TargetType");
public void writeEntityToNBT(NBTTagCompound compound) {
compound.setTag("QuestKills", NBTTags.nbtStringIntegerMap(targets));
//compound.setTag("QuestDialogs", NBTTags.nbtStringIntegerMap(targets));
compound.setInteger("TargetType",targetType);
}
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
compound.setTag("QuestDialogs", NBTTags.nbtStringIntegerMap(targets));
compound.setInteger("TargetType",targetType);
public void readEntityFromNBT(NBTTagCompound compound) {
if(!compound.hasKey("QuestKills")) {
targets.clear();
HashMap<String,Integer> oldTargets = NBTTags.getStringIntegerMap(compound.getTagList("QuestDialogs", 10));
targets.putAll(oldTargets);
} else {
targets = NBTTags.getStringIntegerMap(compound.getTagList("QuestKills", 10));
}
//targets = NBTTags.getStringIntegerMap(compound.getTagList("QuestDialogs", 10));
targetType = compound.getInteger("TargetType");
}
@Override