Class PixelmonStorageManager
java.lang.Object
com.pixelmonmod.pixelmon.api.storage.PixelmonStorageManager
- All Implemented Interfaces:
BankAccountManager
,StorageManager
The default
StorageManager
for Pixelmon. Alternative implementations
that are not extensions of this class are only necessary in exceedingly rare cases. - Since:
- September 9, 2018 (Pixelmon 7.0.0)
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Map<UUID,
LoadingData<PlayerPartyStorage>> protected final Map<UUID,
LoadingData<PCStorage>> protected final Map<UUID,
PlayerPartyStorage> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearAll()
Clears the cache of all storagesGets all the cachedPokemonStorage
this implementation is storingCompletableFuture<? extends BankAccount>
getBankAccount
(UUID uuid) CompletableFuture<? extends BankAccount>
getBankAccount
(net.minecraft.server.level.ServerPlayer player) Attempts to get the bank account for the givenServerPlayer
Gets the player's party waiting until it is loaded from the file if necessarygetPCForPlayer
(UUID uuid) Gets the PC for the player waiting until it is loaded from file, if necessaryvoid
invalidateCache
(PokemonStorage storage) Removes the cache of the given storageprotected LoadingData<PlayerPartyStorage>
protected LoadingData<PCStorage>
void
onPlayerLoad
(net.minecraftforge.event.entity.player.PlayerEvent.LoadFromFile event) void
onPlayerLogin
(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent event) void
onPlayerLogout
(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent event) void
onWorldSave
(net.minecraftforge.event.level.LevelEvent.Save event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.pixelmonmod.pixelmon.api.economy.BankAccountManager
getBankAccountNow, getBankAccountNow
Methods inherited from interface com.pixelmonmod.pixelmon.api.storage.StorageManager
getParty, getPartyNow, getPartyNow, getPC, getPCForPlayer, getPCForPlayerNow, getPCForPlayerNow, getPCNow, getPokemon, getStorage, getStorageNow
-
Field Details
-
parties
-
pcs
-
loadingPCs
-
loadingParties
-
-
Constructor Details
-
PixelmonStorageManager
public PixelmonStorageManager()
-
-
Method Details
-
invalidateCache
Description copied from interface:StorageManager
Removes the cache of the given storage- Specified by:
invalidateCache
in interfaceStorageManager
- Parameters:
storage
- The storage to remove
-
getParty
Description copied from interface:StorageManager
Gets the player's party waiting until it is loaded from the file if necessary- Specified by:
getParty
in interfaceStorageManager
- Parameters:
uuid
- The player- Returns:
- The future party
-
loadParty
-
getPCForPlayer
Description copied from interface:StorageManager
Gets the PC for the player waiting until it is loaded from file, if necessary- Specified by:
getPCForPlayer
in interfaceStorageManager
- Parameters:
uuid
- The UUID of the player- Returns:
- The future PC storage
-
loadPC
-
getAllCachedStorages
Description copied from interface:StorageManager
Gets all the cachedPokemonStorage
this implementation is storing- Specified by:
getAllCachedStorages
in interfaceStorageManager
- Returns:
- The cached storages
-
clearAll
public void clearAll()Description copied from interface:StorageManager
Clears the cache of all storages- Specified by:
clearAll
in interfaceStorageManager
-
getBankAccount
Description copied from interface:BankAccountManager
- Specified by:
getBankAccount
in interfaceBankAccountManager
- Parameters:
uuid
- The owner of the account- Returns:
- The future bank account
-
getBankAccount
public CompletableFuture<? extends BankAccount> getBankAccount(net.minecraft.server.level.ServerPlayer player) Description copied from interface:BankAccountManager
Attempts to get the bank account for the givenServerPlayer
- Specified by:
getBankAccount
in interfaceBankAccountManager
- Parameters:
player
- The owner of the account- Returns:
- The future bank account
-
onPlayerLogin
public void onPlayerLogin(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent event) -
onPlayerLoad
public void onPlayerLoad(net.minecraftforge.event.entity.player.PlayerEvent.LoadFromFile event) -
onPlayerLogout
public void onPlayerLogout(net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent event) -
onWorldSave
public void onWorldSave(net.minecraftforge.event.level.LevelEvent.Save event)
-