Profile Sync Quest Data Crash Fix

This commit is contained in:
Kam committed 2026-03-11 21:42:27 -04:00
1 parent 5cf9b26a2e
commit 15749c8ad7
10 files changed
+179 -8

No files matched your search

@@ -0,0 +1,34 @@
package noppes.npcs.controllers;
import kamkeel.npcs.controllers.ProfileController;
import kamkeel.npcs.controllers.data.profile.Profile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import noppes.npcs.config.ConfigMain;
import java.util.Map;
public class ProfileConfigSync {
public static NBTTagCompound writeToNBT(EntityPlayer player) {
NBTTagCompound compound = new NBTTagCompound();
if (!ConfigMain.ProfilesEnabled || ProfileController.Instance == null) {
return compound;
}
Profile profile = ProfileController.Instance.getProfile(player);
if (profile == null) {
return compound;
}
NBTTagList questList = new NBTTagList();
for (Map.Entry<Integer, Long> entry : profile.sharedQuestTimestamps.entrySet()) {
NBTTagCompound questEntry = new NBTTagCompound();
questEntry.setInteger("Quest", entry.getKey());
questEntry.setLong("Date", entry.getValue());
questList.appendTag(questEntry);
}
compound.setTag("SharedQuestTimestamps", questList);
return compound;
}
}