public abstract class PokemonStorage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
hasChanged |
boolean |
shouldSendUpdates |
java.util.UUID |
uuid |
Constructor and Description |
---|
PokemonStorage(java.util.UUID uuid) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Pokemon pokemon)
Adds the given Pokemon to this storage in the first available position.
|
boolean |
canTransfer(StoragePosition from,
StoragePosition to) |
int |
countAll() |
int |
countEggs() |
int |
countPokemon() |
void |
doWithoutSendingUpdates(java.lang.Runnable process) |
Pokemon |
find(java.util.UUID uuid) |
java.util.List<Pokemon> |
findAll(PokemonSpecification spec) |
java.util.List<Pokemon> |
findAll(java.util.function.Predicate<Pokemon> condition) |
Pokemon |
findOne(PokemonSpecification spec) |
Pokemon |
findOne(java.util.function.Predicate<Pokemon> condition) |
abstract void |
forEach(java.util.function.BiConsumer<Pokemon,StoragePosition> action) |
abstract Pokemon |
get(StoragePosition position) |
abstract Pokemon[] |
getAll()
Gets a array of all pokemon within this storage.
|
int[] |
getCurryData() |
abstract java.io.File |
getFile() |
abstract StoragePosition |
getFirstEmptyPosition() |
abstract java.util.List<net.minecraft.entity.player.ServerPlayerEntity> |
getPlayersToUpdate() |
abstract StoragePosition |
getPosition(Pokemon pokemon) |
boolean |
getShouldSave() |
boolean |
getShouldSendUpdates() |
boolean |
hasSpace() |
void |
notifyListener(net.minecraft.entity.player.ServerPlayerEntity player,
StoragePosition position,
Pokemon pokemon,
EnumUpdateType... dataTypes) |
void |
notifyListenerAll(net.minecraft.entity.player.ServerPlayerEntity player,
EnumUpdateType... dataTypes) |
void |
notifyListeners(StoragePosition position,
Pokemon pokemon,
EnumUpdateType... dataTypes) |
void |
notifyListenersAll(EnumUpdateType... dataTypes) |
abstract PokemonStorage |
readFromNBT(net.minecraft.nbt.CompoundNBT nbt) |
void |
retrieveAll(java.lang.String pokemonRetrievedEventReason) |
abstract void |
set(StoragePosition position,
Pokemon pokemon) |
void |
setHasChanged(boolean hasChanged) |
void |
setNeedsSaving() |
abstract void |
swap(StoragePosition position1,
StoragePosition position2) |
java.lang.String |
toString() |
boolean |
transfer(PokemonStorage from,
StoragePosition fromPosition,
StoragePosition toPosition) |
void |
updateSingleCurryData(EnumCurryKey curryKey,
EnumBerryFlavor cookingFlavor,
EnumCurryRating rating) |
boolean |
validate(StoragePosition position,
java.util.UUID pokemonUUID) |
abstract net.minecraft.nbt.CompoundNBT |
writeToNBT(net.minecraft.nbt.CompoundNBT nbt) |
public java.util.UUID uuid
public transient boolean shouldSendUpdates
protected transient boolean hasChanged
public abstract Pokemon[] getAll()
@Nullable public abstract StoragePosition getFirstEmptyPosition()
public abstract void forEach(java.util.function.BiConsumer<Pokemon,StoragePosition> action)
public abstract void set(StoragePosition position, Pokemon pokemon)
@Nullable public abstract Pokemon get(StoragePosition position)
public abstract void swap(StoragePosition position1, StoragePosition position2)
public abstract net.minecraft.nbt.CompoundNBT writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
public abstract PokemonStorage readFromNBT(net.minecraft.nbt.CompoundNBT nbt)
public abstract StoragePosition getPosition(Pokemon pokemon)
public abstract java.util.List<net.minecraft.entity.player.ServerPlayerEntity> getPlayersToUpdate()
public abstract java.io.File getFile()
public boolean add(Pokemon pokemon)
PlayerPartyStorage
then it will attempt to add to the PC and pass back the return value from there.pokemon
- The Pokemon to add to the storage.true
if it was able to add to this storage, or in the case of this being a full PlayerPartyStorage
,
true
if there was an empty space in the PC. Otherwise false
public boolean transfer(PokemonStorage from, StoragePosition fromPosition, StoragePosition toPosition)
public boolean hasSpace()
public boolean canTransfer(StoragePosition from, StoragePosition to)
public int countPokemon()
public int countEggs()
public int countAll()
public boolean getShouldSendUpdates()
public Pokemon findOne(PokemonSpecification spec)
public java.util.List<Pokemon> findAll(PokemonSpecification spec)
public Pokemon find(java.util.UUID uuid)
public boolean validate(StoragePosition position, java.util.UUID pokemonUUID)
public void notifyListeners(StoragePosition position, Pokemon pokemon, EnumUpdateType... dataTypes)
public void notifyListenersAll(EnumUpdateType... dataTypes)
public void notifyListener(net.minecraft.entity.player.ServerPlayerEntity player, StoragePosition position, Pokemon pokemon, EnumUpdateType... dataTypes)
public void notifyListenerAll(net.minecraft.entity.player.ServerPlayerEntity player, EnumUpdateType... dataTypes)
public boolean getShouldSave()
public void setHasChanged(boolean hasChanged)
public void setNeedsSaving()
public void doWithoutSendingUpdates(java.lang.Runnable process)
public java.lang.String toString()
toString
in class java.lang.Object
public void retrieveAll(java.lang.String pokemonRetrievedEventReason)
public int[] getCurryData()
public void updateSingleCurryData(EnumCurryKey curryKey, EnumBerryFlavor cookingFlavor, EnumCurryRating rating)