Interface PlayerCacheSaver

All Known Implementing Classes:
CooldownValidator, UsageLockValidator

public interface PlayerCacheSaver
Optional interface for services with @PlayerCache(saveBeforeRemove = true). Called before the cache entry is removed on player quit.
Since:
6.2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    savePlayerData(UUID playerId)
    Save any pending data for the given player before cache eviction.
  • Method Details

    • savePlayerData

      void savePlayerData(UUID playerId)
      Save any pending data for the given player before cache eviction.

      Called once per @PlayerCache(saveBeforeRemove = true) field of the implementing bean. An exception or Error thrown here is logged as a WARNING by the framework and does not keep the entry: it is removed anyway, and the cleanup of every other field continues (as of 6.3.0, #643; maintainer decision, 2026-10-08). The framework does not retry the save; a module that must not lose the data retries or persists it itself, here.

      Parameters:
      playerId - the UUID of the player quitting