public class PixelmonStorageManager extends java.lang.Object implements StorageManager, BankAccountManager
StorageManager
for Pixelmon. Alternative implementations
that are not extensions of this class are only necessary in exceedingly rare cases. Modifier and Type | Field and Description |
---|---|
protected StorageSaveAdapter |
adapter |
protected java.util.Map<java.util.UUID,PlayerPartyStorage> |
parties |
protected java.util.Map<java.util.UUID,PCStorage> |
pcs |
protected java.util.List<java.util.UUID> |
playersWithSyncedPCs |
protected StorageSaveScheduler |
scheduler |
Constructor and Description |
---|
PixelmonStorageManager(StorageSaveScheduler scheduler,
StorageSaveAdapter adapter) |
Modifier and Type | Method and Description |
---|---|
void |
clearAll() |
java.lang.Iterable<PokemonStorage> |
getAllCachedStorages() |
java.util.Optional<? extends BankAccount> |
getBankAccount(net.minecraft.entity.player.ServerPlayerEntity player)
Attempts to get the bank account for the given
ServerPlayerEntity |
java.util.Optional<? extends BankAccount> |
getBankAccount(java.util.UUID uuid)
Attempts to get the bank account for the given
UUID , presumably a player's UUID |
PlayerPartyStorage |
getParty(java.util.UUID uuid) |
PCStorage |
getPCForPlayer(java.util.UUID uuid) |
StorageSaveAdapter |
getSaveAdapter() |
StorageSaveScheduler |
getSaveScheduler() |
void |
onPlayerLogin(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent event) |
void |
onPlayerLogout(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent event) |
void |
onStorageSaved(PokemonStorage storage) |
void |
setSaveAdapter(StorageSaveAdapter adapter) |
void |
setSaveScheduler(StorageSaveScheduler scheduler) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParty, getPC, getPCForPlayer, getPokemon, getStorage, initializePCForPlayer
getBankAccountUnsafe, getBankAccountUnsafe
protected final java.util.Map<java.util.UUID,PlayerPartyStorage> parties
protected final java.util.Map<java.util.UUID,PCStorage> pcs
protected final java.util.List<java.util.UUID> playersWithSyncedPCs
protected StorageSaveScheduler scheduler
protected StorageSaveAdapter adapter
public PixelmonStorageManager(StorageSaveScheduler scheduler, StorageSaveAdapter adapter)
public StorageSaveScheduler getSaveScheduler()
getSaveScheduler
in interface StorageManager
public StorageSaveAdapter getSaveAdapter()
getSaveAdapter
in interface StorageManager
public void setSaveScheduler(StorageSaveScheduler scheduler)
public void setSaveAdapter(StorageSaveAdapter adapter)
public PlayerPartyStorage getParty(java.util.UUID uuid)
getParty
in interface StorageManager
public PCStorage getPCForPlayer(java.util.UUID uuid)
getPCForPlayer
in interface StorageManager
public java.lang.Iterable<PokemonStorage> getAllCachedStorages()
getAllCachedStorages
in interface StorageManager
public void onStorageSaved(PokemonStorage storage)
onStorageSaved
in interface StorageManager
public void clearAll()
clearAll
in interface StorageManager
public java.util.Optional<? extends BankAccount> getBankAccount(java.util.UUID uuid)
BankAccountManager
UUID
, presumably a player's UUID
getBankAccount
in interface BankAccountManager
uuid
- The owner of the accountpublic java.util.Optional<? extends BankAccount> getBankAccount(net.minecraft.entity.player.ServerPlayerEntity player)
BankAccountManager
ServerPlayerEntity
getBankAccount
in interface BankAccountManager
player
- The owner of the accountpublic void onPlayerLogin(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent event)
public void onPlayerLogout(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent event)