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(PokemonSpec spec) |
java.util.List<Pokemon> |
findAll(java.util.function.Predicate<Pokemon> condition) |
Pokemon |
findOne(PokemonSpec spec) |
Pokemon |
findOne(java.util.function.Predicate<Pokemon> condition) |
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.EntityPlayerMP> |
getPlayersToUpdate() |
abstract StoragePosition |
getPosition(Pokemon pokemon) |
boolean |
getShouldSave() |
boolean |
getShouldSendUpdates() |
boolean |
hasSpace() |
void |
notifyListener(net.minecraft.entity.player.EntityPlayerMP player,
StoragePosition position,
Pokemon pokemon,
EnumUpdateType... dataTypes) |
void |
notifyListeners(StoragePosition position,
Pokemon pokemon,
EnumUpdateType... dataTypes) |
abstract PokemonStorage |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt) |
void |
retrieveAll() |
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.NBTTagCompound |
writeToNBT(net.minecraft.nbt.NBTTagCompound 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 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.NBTTagCompound writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
public abstract PokemonStorage readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
public abstract StoragePosition getPosition(Pokemon pokemon)
public abstract java.util.List<net.minecraft.entity.player.EntityPlayerMP> 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(PokemonSpec spec)
public java.util.List<Pokemon> findAll(PokemonSpec 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 notifyListener(net.minecraft.entity.player.EntityPlayerMP player, StoragePosition position, Pokemon pokemon, 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()
public int[] getCurryData()
public void updateSingleCurryData(EnumCurryKey curryKey, EnumBerryFlavor cookingFlavor, EnumCurryRating rating)