mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 05:35:38 +00:00
Profile Sync Quest Data Crash Fix
This commit is contained in:
1 parent
5cf9b26a2e
commit
15749c8ad7
10 files changed
+179
-8
No files matched your search
@@ -124,6 +124,7 @@ public class ClientCacheHandler {
|
||||
ClientCacheHandler.customOverlays.clear();
|
||||
ClientCacheHandler.skinOverlays.clear();
|
||||
ClientCacheHandler.playerAnimations.clear();
|
||||
ProfileClientConfig.reset();
|
||||
|
||||
// Clear Texture Caches
|
||||
GuiSoundSelection.cachedDomains.clear();
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package noppes.npcs.client;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ProfileClientConfig {
|
||||
private static volatile Map<Integer, Long> sharedQuestTimestamps = new HashMap<>();
|
||||
|
||||
public static void readFromNBT(NBTTagCompound compound) {
|
||||
if (compound == null) return;
|
||||
|
||||
Map<Integer, Long> timestamps = new HashMap<>();
|
||||
if (compound.hasKey("SharedQuestTimestamps")) {
|
||||
NBTTagList list = compound.getTagList("SharedQuestTimestamps", 10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound entry = list.getCompoundTagAt(i);
|
||||
timestamps.put(entry.getInteger("Quest"), entry.getLong("Date"));
|
||||
}
|
||||
}
|
||||
sharedQuestTimestamps = timestamps;
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
sharedQuestTimestamps = new HashMap<>();
|
||||
}
|
||||
|
||||
public static Map<Integer, Long> getSharedQuestTimestamps() {
|
||||
return sharedQuestTimestamps;
|
||||
}
|
||||
|
||||
public static boolean hasSharedQuest(int questId) {
|
||||
return sharedQuestTimestamps.containsKey(questId);
|
||||
}
|
||||
|
||||
public static Long getSharedQuestTimestamp(int questId) {
|
||||
return sharedQuestTimestamps.get(questId);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user