Class PlayerLoader
java.lang.Object
studio.magemonkey.fusion.data.player.PlayerLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic FusionPlayerstatic FusionPlayergetPlayer(org.bukkit.entity.Player player) static FusionPlayergetPlayerBlocking(UUID uuid, long timeoutMs) Blocks (polling) until the player's DB lock is cleared or until timeoutMs is reached.static FusionPlayergetPlayerBlocking(org.bukkit.entity.Player player, long timeoutMs) static FusionPlayergetPlayerIfReady(UUID uuid) Returns the FusionPlayer if it is not currently locked for saving, otherwise returns null.static FusionPlayergetPlayerIfReady(org.bukkit.entity.Player player) static voidloadPlayer(org.bukkit.entity.Player player) static voidunloadPlayer(org.bukkit.entity.Player player)
-
Constructor Details
-
PlayerLoader
public PlayerLoader()
-
-
Method Details
-
getPlayer
-
getPlayer
-
getPlayerIfReady
Returns the FusionPlayer if it is not currently locked for saving, otherwise returns null. This provides an explicit, safe way for call sites that cannot proceed during a save window. -
getPlayerIfReady
-
getPlayerBlocking
Blocks (polling) until the player's DB lock is cleared or until timeoutMs is reached. Returns the FusionPlayer if the lock cleared within the timeout, otherwise returns null. Note: Blocking the main server thread is dangerous; call this from an async thread or keep timeout small. -
getPlayerBlocking
-
loadPlayer
public static void loadPlayer(org.bukkit.entity.Player player) -
unloadPlayer
public static void unloadPlayer(org.bukkit.entity.Player player) -
clearCache
public static void clearCache()
-