public class PlayerPartyStorage extends PartyStorage implements BankAccount, RarityTweak
Modifier and Type | Field and Description |
---|---|
boolean |
battleEnabled
Whether the owner of the storage can battle.
|
boolean |
guiOpened
Whether the player is looking at a GUI.
|
protected BattleLog |
lastBattle |
boolean |
oldGen
Whether the player is in Mega/Z mode or not.
|
PlayerData |
playerData |
protected java.lang.String |
playerName
The name of the player whose storage this is.
|
PlayerPokedex |
playerPokedex
The player's Pokédex.
|
protected java.math.BigDecimal |
pokeDollars
The amount of money the player has.
|
boolean |
starterPicked
Whether the player has picked a starter yet
|
PlayerStats |
stats
The player's battle stats.
|
TeleportPosition |
teleportPos
The player's current teleport position with the Teleport/Fly external moves.
|
EnumTrainerCardColor |
trainerCardColor
The color of the players Trainer Card.
|
TransientData |
transientData |
MAX_PARTY, party, tempParty, tempPartyColor
hasChanged, shouldSendUpdates, uuid
Constructor and Description |
---|
PlayerPartyStorage(java.util.UUID uuid) |
PlayerPartyStorage(java.util.UUID uuid,
boolean shouldSendUpdates) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.math.BigDecimal amount)
Adds the amount to the current balance
Returns false if the transaction fails for any given reason (check console logs)
DO NOT PASS NEGATIVE VALUES
|
boolean |
add(Pokemon pokemon)
Adds the given Pokemon to this storage in the first available position.
|
TriBoolean |
addSilently(Pokemon pokemon)
Advanced method for adding Pokémon to player storage.
|
BattleEndTaskResult |
addTaskForBattleEnd(BattleEndTaskType type,
java.util.function.Consumer<java.util.Optional<BattleController>> consumer)
Add a task to be executed once the client has left the battle UI.
|
boolean |
canEquipMegaItem() |
void |
checkPokerus()
NOTE: I could probably make this more optimized, thanks to the new storage
|
void |
closeBattleSafely()
Safely shuts down battles on the client.
|
void |
deregisterKeyListener() |
void |
dropLureInLureSlot(net.minecraft.entity.player.ServerPlayerEntity player)
If the player has a lure in their lureSlot make it drop from their inventory.
|
void |
fillEntireCurryDex(int curryDexRating)
Fills in the entire curry dex with the given rating.
|
void |
fillOneCurryDexFlavor(int curryDexPage,
int curryDexFlavor,
int curryDexRating)
Fills in one flavor entry for one curry dish with the given rating.
|
void |
fillOneCurryDexPage(int curryDexPage,
int curryDexRating)
Fills in one page of the curry dex with the given rating.
|
java.math.BigDecimal |
getBalance()
Gets balance of the account
|
EnumFeatureState |
getCatchingCharm() |
int[] |
getCurryData() |
PlayerDayCare |
getDayCare() |
EnumFeatureState |
getExpCharm() |
EnumFeatureState |
getHweenRobe()
Deprecated.
|
java.util.UUID |
getIdentifier()
Gets the unique identifier of the given entity
|
BattleLog |
getLastBattle() |
LureItem |
getLure() |
net.minecraft.item.ItemStack |
getLureStack() |
EnumFeatureState |
getMarkCharm() |
EnumMegaItem |
getMegaItem() |
EnumMegaItemsUnlocked |
getMegaItemsUnlocked() |
float |
getMultiplier(AbstractSpawner spawner,
SpawnInfo spawnInfo,
float sum,
float rarity) |
EnumFeatureState |
getOvalCharm() |
net.minecraft.entity.player.ServerPlayerEntity |
getPlayer() |
java.lang.String |
getPlayerName() |
java.util.List<net.minecraft.entity.player.ServerPlayerEntity> |
getPlayersToUpdate() |
java.util.UUID |
getPlayerUUID() |
QuestData |
getQuestData() |
QuestData |
getQuestData(boolean update)
Quest storage getter.
|
Pokemon |
getSelectedPokemon() |
int |
getSelectedSlot() |
java.util.Set<ServerCosmetics> |
getServerCosmetics() |
EnumFeatureState |
getShinyCharm() |
boolean |
getShouldSave() |
int |
getTicksTillEncounter()
Gets the number of ticks until Pixelmon grass spawns a Pokémon against
the player.
|
void |
grantServerCosmetics(ServerCosmetics... cosmetics) |
boolean |
hasBalance(java.math.BigDecimal amount)
Checks if the account has more than the given amount
|
boolean |
isMegaItemObtained(Species pokemon,
Stats form) |
void |
lockDynamax() |
void |
lockMega() |
void |
obtainedItem(Species pokemon,
Stats form,
net.minecraft.entity.player.ServerPlayerEntity player) |
void |
queryResourceLocationExistence(net.minecraft.util.ResourceLocation resource,
java.util.function.Consumer<java.lang.Boolean> result)
Query existence of a ResourceLocation on the client.
|
PlayerPartyStorage |
readFromNBT(net.minecraft.nbt.CompoundNBT nbt) |
void |
receiveKeyInput(int keyCode,
int scanCode,
int modifiers) |
void |
receiveResourceLocationQueryResult(java.util.UUID query,
boolean result) |
void |
registerKeyListener(java.lang.Object instance,
java.lang.reflect.Method callback) |
void |
resetQuestData() |
void |
revokeServerCosmetics(ServerCosmetics... cosmetics) |
void |
sendClientUpdatePacket() |
void |
sendClientUpdateSelectedPacket() |
void |
set(StoragePosition position,
Pokemon pokemon) |
void |
setBalance(java.math.BigDecimal amount)
Sets the balance of the account
|
void |
setCatchingCharm(EnumFeatureState catchingCharm) |
void |
setDayCare(PlayerDayCare dayCare) |
void |
setExpCharm(EnumFeatureState expCharm) |
void |
setHweenRobe(EnumFeatureState hweenRobe)
Deprecated.
|
void |
setLastBattle(BattleLog lastBattle) |
void |
setLure(LureItem lure) |
void |
setLureStack(net.minecraft.item.ItemStack stack) |
void |
setMarkCharm(EnumFeatureState markCharm) |
void |
setMegaItem(EnumMegaItem megaItem,
boolean giveChoice) |
void |
setMegaItemsUnlocked(EnumMegaItemsUnlocked megaItemsUnlocked) |
void |
setOvalCharm(EnumFeatureState ovalCharm) |
void |
setSelectedSlot(int selectedSlot) |
void |
setSelectedSlot(int selectedSlot,
boolean sendPacket) |
void |
setServerCosmetics(java.util.Set<ServerCosmetics> cosmetics) |
void |
setShinyCharm(EnumFeatureState shinyCharm) |
boolean |
take(java.math.BigDecimal amount)
Take the amount to the current balance
Returns false if the transaction fails for any given reason (check console logs)
DO NOT PASS NEGATIVE VALUES
|
void |
tryUpdatePlayerName() |
void |
unlockDynamax(boolean giveChoice) |
void |
unlockMega(boolean giveChoice) |
void |
updatePartyCache()
Updates the cache of pokemonLevel data in the storage.
|
void |
updateSingleCurryData(EnumCurryKey curryKey,
EnumBerryFlavor cookingFlavor,
EnumCurryRating rating) |
void |
updateTicksTillEncounter()
Ticks the number of ticks until Pixelmon grass spawns a Pokémon against
the player.
|
net.minecraft.nbt.CompoundNBT |
writeToNBT(net.minecraft.nbt.CompoundNBT nbt) |
copyToTemporaryMode, countAblePokemon, enterTemporaryMode, enterTemporaryMode, forEach, get, get, get, getAll, getAndSendOutFirstAblePokemon, getAverageLevel, getFile, getFirstAblePokemon, getFirstBattleReadyPokemon, getFirstEmptyPosition, getHighestLevel, getLowestLevel, getOriginalParty, getPosition, getSlot, getSlot, getTeam, getTempPartyColor, heal, inTemporaryMode, isOldGen, set, setInTemporaryMode, setInTemporaryModeClient, setOriginal, setOriginal, setTempPartyColor, swap, swap
canTransfer, countAll, countEggs, countPokemon, doWithoutSendingUpdates, find, findAll, findAll, findOne, findOne, getShouldSendUpdates, hasSpace, notifyListener, notifyListenerAll, notifyListeners, notifyListenersAll, retrieveAll, setHasChanged, setNeedsSaving, toString, transfer, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, add, add, hasBalance, hasBalance, hasBalance, setBalance, setBalance, setBalance, take, take, take, updatePlayer, updatePlayer
protected java.lang.String playerName
public EnumTrainerCardColor trainerCardColor
public TeleportPosition teleportPos
protected java.math.BigDecimal pokeDollars
public PlayerPokedex playerPokedex
public PlayerStats stats
public boolean guiOpened
public boolean battleEnabled
public boolean starterPicked
public boolean oldGen
public PlayerData playerData
protected BattleLog lastBattle
public transient TransientData transientData
public PlayerPartyStorage(java.util.UUID uuid, boolean shouldSendUpdates)
public PlayerPartyStorage(java.util.UUID uuid)
public java.util.UUID getIdentifier()
BankAccount
getIdentifier
in interface BankAccount
public boolean add(Pokemon pokemon)
PokemonStorage
PlayerPartyStorage
then it will attempt to add to the PC and pass back the return value from there.add
in class PokemonStorage
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 TriBoolean addSilently(Pokemon pokemon)
pokemon
- Pokémon object to add to storage.public void tryUpdatePlayerName()
@Nullable public net.minecraft.entity.player.ServerPlayerEntity getPlayer()
@Nullable public java.lang.String getPlayerName()
public java.util.UUID getPlayerUUID()
public void set(StoragePosition position, Pokemon pokemon)
set
in class PartyStorage
public net.minecraft.nbt.CompoundNBT writeToNBT(net.minecraft.nbt.CompoundNBT nbt)
writeToNBT
in class PartyStorage
public PlayerPartyStorage readFromNBT(net.minecraft.nbt.CompoundNBT nbt)
readFromNBT
in class PartyStorage
public java.util.List<net.minecraft.entity.player.ServerPlayerEntity> getPlayersToUpdate()
getPlayersToUpdate
in class PartyStorage
public boolean getShouldSave()
getShouldSave
in class PokemonStorage
public int[] getCurryData()
getCurryData
in class PokemonStorage
public void updateSingleCurryData(EnumCurryKey curryKey, EnumBerryFlavor cookingFlavor, EnumCurryRating rating)
updateSingleCurryData
in class PokemonStorage
public void fillOneCurryDexFlavor(int curryDexPage, int curryDexFlavor, int curryDexRating)
curryDexPage
- The page number the desired curry dish is on.curryDexFlavor
- The position of the desired flavor on a page.curryDexRating
- The rating to be given to the desired flavor.public void fillOneCurryDexPage(int curryDexPage, int curryDexRating)
curryDexPage
- The page number of the curry dish to be filled in.curryDexRating
- The rating to be given to the entire page.public void fillEntireCurryDex(int curryDexRating)
curryDexRating
- The rating to be given to the entire dex.public void obtainedItem(Species pokemon, Stats form, net.minecraft.entity.player.ServerPlayerEntity player)
public void setMegaItem(EnumMegaItem megaItem, boolean giveChoice)
public void unlockMega(boolean giveChoice)
public void lockMega()
public void unlockDynamax(boolean giveChoice)
public void lockDynamax()
public void setMegaItemsUnlocked(EnumMegaItemsUnlocked megaItemsUnlocked)
public void setShinyCharm(EnumFeatureState shinyCharm)
public void setOvalCharm(EnumFeatureState ovalCharm)
public void setExpCharm(EnumFeatureState expCharm)
public void setCatchingCharm(EnumFeatureState catchingCharm)
public void setMarkCharm(EnumFeatureState markCharm)
@Deprecated public void setHweenRobe(EnumFeatureState hweenRobe)
public boolean canEquipMegaItem()
public EnumMegaItem getMegaItem()
public EnumMegaItemsUnlocked getMegaItemsUnlocked()
public EnumFeatureState getShinyCharm()
public EnumFeatureState getOvalCharm()
public EnumFeatureState getExpCharm()
public EnumFeatureState getCatchingCharm()
public EnumFeatureState getMarkCharm()
@Deprecated public EnumFeatureState getHweenRobe()
public java.util.Set<ServerCosmetics> getServerCosmetics()
public void setServerCosmetics(java.util.Set<ServerCosmetics> cosmetics)
public void grantServerCosmetics(ServerCosmetics... cosmetics)
public void revokeServerCosmetics(ServerCosmetics... cosmetics)
public net.minecraft.item.ItemStack getLureStack()
@Nullable public LureItem getLure()
public void setLureStack(net.minecraft.item.ItemStack stack)
public void setLure(LureItem lure)
public void dropLureInLureSlot(net.minecraft.entity.player.ServerPlayerEntity player)
public boolean hasBalance(java.math.BigDecimal amount)
BankAccount
hasBalance
in interface BankAccount
amount
- Amount to checkpublic java.math.BigDecimal getBalance()
BankAccount
getBalance
in interface BankAccount
public void setBalance(java.math.BigDecimal amount)
BankAccount
setBalance
in interface BankAccount
amount
- The new balancepublic boolean add(java.math.BigDecimal amount)
BankAccount
add
in interface BankAccount
amount
- The amount being addedpublic boolean take(java.math.BigDecimal amount)
BankAccount
take
in interface BankAccount
amount
- The amount being takenpublic void updatePartyCache()
public int getTicksTillEncounter()
public void updateTicksTillEncounter()
public void checkPokerus()
public float getMultiplier(AbstractSpawner spawner, SpawnInfo spawnInfo, float sum, float rarity)
getMultiplier
in interface RarityTweak
public QuestData getQuestData(boolean update)
public QuestData getQuestData()
public void resetQuestData()
public void closeBattleSafely()
public BattleEndTaskResult addTaskForBattleEnd(BattleEndTaskType type, java.util.function.Consumer<java.util.Optional<BattleController>> consumer)
public void queryResourceLocationExistence(net.minecraft.util.ResourceLocation resource, java.util.function.Consumer<java.lang.Boolean> result)
resource
- ResourceLocation to be queried.result
- Consumer to be executed with the result of the query.public void receiveResourceLocationQueryResult(java.util.UUID query, boolean result)
public void registerKeyListener(java.lang.Object instance, java.lang.reflect.Method callback)
public void receiveKeyInput(int keyCode, int scanCode, int modifiers)
public void deregisterKeyListener()
public int getSelectedSlot()
public void setSelectedSlot(int selectedSlot)
public void setSelectedSlot(int selectedSlot, boolean sendPacket)
public Pokemon getSelectedPokemon()
public void sendClientUpdatePacket()
public void sendClientUpdateSelectedPacket()
public PlayerDayCare getDayCare()
public void setDayCare(PlayerDayCare dayCare)
public BattleLog getLastBattle()
public void setLastBattle(BattleLog lastBattle)