Annotation Interface PlayerCache
Marks a field for automatic cleanup when a player quits.
Three field shapes are accepted, and PlayerCacheManager
refuses (throws at registration) any other shape rather than silently ignoring it:
Map<UUID, ?>-- the whole entry (key and value, including a nested value such asMap<UUID, Map<String, Long>>) is removed viaremove(uuid).Set<UUID>-- the UUID itself is removed viaremove(uuid).Map<?, UUID>-- every entry whose VALUE equals the quitting player's UUID is removed; entries belonging to other players are left intact.
- Since:
- 6.2.0
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanIf true, the framework will call the bean'ssavePlayerData(UUID)method (if it implementsPlayerCacheSaver) before removing the entry.
-
Element Details
-
saveBeforeRemove
boolean saveBeforeRemoveIf true, the framework will call the bean'ssavePlayerData(UUID)method (if it implementsPlayerCacheSaver) before removing the entry.- Returns:
- whether to save before removing
- Default:
false
-