mirror of
https://github.com/BentoBoxWorld/Warps.git
synced 2024-11-25 20:16:11 +01:00
Sign Cache could get out of sync with signs.
https://github.com/BentoBoxWorld/Warps/issues/80
This commit is contained in:
parent
74675abce6
commit
94f0ff4e22
@ -72,8 +72,9 @@ public class SignCacheManager {
|
||||
* @param key - uuid of owner
|
||||
*/
|
||||
void removeWarp(World world, UUID key) {
|
||||
cachedSigns.putIfAbsent(world, new HashMap<>());
|
||||
cachedSigns.get(world).remove(key);
|
||||
if (cachedSigns.containsKey(world)) {
|
||||
cachedSigns.get(world).remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -245,9 +245,10 @@ public class WarpSignsManager {
|
||||
if (getWarpMap(world).containsKey(uuid)) {
|
||||
popSign(getWarpMap(world).get(uuid));
|
||||
getWarpMap(world).remove(uuid);
|
||||
// Remove sign from warp panel cache
|
||||
addon.getWarpPanelManager().removeWarp(world, uuid);
|
||||
|
||||
}
|
||||
// Remove sign from warp panel cache
|
||||
addon.getWarpPanelManager().removeWarp(world, uuid);
|
||||
saveWarpList();
|
||||
}
|
||||
|
||||
@ -255,7 +256,8 @@ public class WarpSignsManager {
|
||||
* Saves the warp lists to the database
|
||||
*/
|
||||
public void saveWarpList() {
|
||||
handler.saveObject(warpsData .save(worldsWarpList));
|
||||
handler.saveObject(warpsData.save(worldsWarpList));
|
||||
addon.getWarpPanelManager().saveCache();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user