Annotation Interface PlayerCache


@Target(FIELD) @Retention(RUNTIME) public @interface PlayerCache
Marks a Map<UUID, ?> field for automatic cleanup when a player quits.

When a player disconnects, the framework automatically calls remove(uuid) on all annotated maps across all registered service beans.

标记一个 Map<UUID, ?> 字段,当玩家退出时自动清理。

Since:
6.2.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, the framework will call the bean's savePlayerData(UUID) method (if it implements PlayerCacheSaver) before removing the entry.
  • Element Details

    • saveBeforeRemove

      boolean saveBeforeRemove
      If true, the framework will call the bean's savePlayerData(UUID) method (if it implements PlayerCacheSaver) before removing the entry.
      Returns:
      whether to save before removing
      Default:
      false