mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Fix Cache not clearing on PlayerDataRemove request
This commit is contained in:
1 parent
45ba8c5c06
commit
13ca5ebc21
2 files changed
+12
-4
No files matched your search
@@ -501,15 +501,17 @@ public class NoppesUtilServer {
|
||||
if(file.exists())
|
||||
file.delete();
|
||||
if(pl != null){
|
||||
PlayerDataController.Instance.removePlayerDataCache(pl.getUniqueID().toString());
|
||||
|
||||
PlayerDataController.Instance.nameUUIDs.remove(name);
|
||||
PlayerDataController.Instance.savePlayerDataMap();
|
||||
|
||||
playerdata.setNBT(new NBTTagCompound());
|
||||
sendPlayerData(type, player, name);
|
||||
playerdata.save();
|
||||
|
||||
return;
|
||||
}
|
||||
else {
|
||||
PlayerDataController.Instance.nameUUIDs.remove(name);
|
||||
PlayerDataController.Instance.savePlayerDataMap();
|
||||
}
|
||||
}
|
||||
if(type == EnumPlayerData.Quest){
|
||||
PlayerQuestData data = playerdata.questData;
|
||||
|
||||
@@ -260,6 +260,12 @@ public class PlayerDataController {
|
||||
}
|
||||
}
|
||||
|
||||
public void removePlayerDataCache(final String uuid) {
|
||||
synchronized (playerDataCache) {
|
||||
playerDataCache.remove(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearCache() {
|
||||
synchronized (playerDataCache) {
|
||||
playerDataCache.clear();
|
||||
|
||||
Reference in new issue
Block a user