mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Invalidate home/warp list caches when deleting all homes/warps
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -255,6 +255,10 @@ public class HomesManager {
|
|||||||
});
|
});
|
||||||
publicHomes.removeIf(h -> h.getOwner().getUuid().equals(owner.getUuid()));
|
publicHomes.removeIf(h -> h.getOwner().getUuid().equals(owner.getUuid()));
|
||||||
plugin.getMapHook().ifPresent(hook -> hook.clearHomes(owner));
|
plugin.getMapHook().ifPresent(hook -> hook.clearHomes(owner));
|
||||||
|
plugin.getCommands().stream()
|
||||||
|
.filter(command -> command instanceof ListCommand)
|
||||||
|
.map(command -> (ListCommand) command)
|
||||||
|
.forEach(ListCommand::invalidateCaches);
|
||||||
plugin.getManager().propagateCacheUpdate();
|
plugin.getManager().propagateCacheUpdate();
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
@@ -268,6 +272,10 @@ public class HomesManager {
|
|||||||
if (plugin.getSettings().doCrossServer() && serverName.equals(plugin.getServerName())) {
|
if (plugin.getSettings().doCrossServer() && serverName.equals(plugin.getServerName())) {
|
||||||
plugin.getMapHook().ifPresent(hook -> hook.clearHomes(worldName));
|
plugin.getMapHook().ifPresent(hook -> hook.clearHomes(worldName));
|
||||||
}
|
}
|
||||||
|
plugin.getCommands().stream()
|
||||||
|
.filter(command -> command instanceof ListCommand)
|
||||||
|
.map(command -> (ListCommand) command)
|
||||||
|
.forEach(ListCommand::invalidateCaches);
|
||||||
plugin.getManager().propagateCacheUpdate();
|
plugin.getManager().propagateCacheUpdate();
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,6 +158,10 @@ public class WarpsManager {
|
|||||||
final int deleted = plugin.getDatabase().deleteAllWarps();
|
final int deleted = plugin.getDatabase().deleteAllWarps();
|
||||||
warps.clear();
|
warps.clear();
|
||||||
plugin.getMapHook().ifPresent(MapHook::clearWarps);
|
plugin.getMapHook().ifPresent(MapHook::clearWarps);
|
||||||
|
plugin.getCommands().stream()
|
||||||
|
.filter(command -> command instanceof ListCommand)
|
||||||
|
.map(command -> (ListCommand) command)
|
||||||
|
.forEach(ListCommand::invalidateCaches);
|
||||||
plugin.getManager().propagateCacheUpdate();
|
plugin.getManager().propagateCacheUpdate();
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
@@ -168,6 +172,10 @@ public class WarpsManager {
|
|||||||
if (plugin.getSettings().doCrossServer() && plugin.getServerName().equals(serverName)) {
|
if (plugin.getSettings().doCrossServer() && plugin.getServerName().equals(serverName)) {
|
||||||
plugin.getMapHook().ifPresent(hook -> hook.clearWarps(worldName));
|
plugin.getMapHook().ifPresent(hook -> hook.clearWarps(worldName));
|
||||||
}
|
}
|
||||||
|
plugin.getCommands().stream()
|
||||||
|
.filter(command -> command instanceof ListCommand)
|
||||||
|
.map(command -> (ListCommand) command)
|
||||||
|
.forEach(ListCommand::invalidateCaches);
|
||||||
plugin.getManager().propagateCacheUpdate();
|
plugin.getManager().propagateCacheUpdate();
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user