Klasse RewardCache
java.lang.Object
de.delinkedde.mobarenareborn.reward.RewardCache
A persistent hold-back store ("cache") for reward items that could not be delivered immediately.
When a player's inventory is full at reward time the overflow is kept here instead of being
dropped, and delivered later - on their next join or via /ma claim - once they have space.
The store is persisted to rewardcache.yml so it survives restarts and disconnects.
Item stacks are stored with Bukkit's built-in configuration serialization. This store is kept separate from the SQLite progression database so it never contends with the progression background thread.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
-
Konstruktordetails
-
RewardCache
- Parameter:
plugin- the owning plugin, used for the data folder and logging
-
-
Methodendetails
-
load
public void load()Loads the cache from disk. Call once on start-up. -
save
public void save()Writes the cache to disk. -
add
Adds items to a player's cache and persists.- Parameter:
uuid- the player's unique iditems- the items to hold back
-
hasItems
- Parameter:
uuid- the player's unique id- Gibt zurück:
- whether the player has any cached reward items
-
deliver
Delivers as many cached items as fit into the player's inventory and keeps the rest cached.- Parameter:
player- the player- Gibt zurück:
-1if nothing was cached; otherwise the number of item stacks still cached afterwards (0meaning everything was delivered)
-