public class ClientBattleManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
afkActivate
The amount of time before the AFK handler takes over.
|
boolean |
afkActive
Whether the AFK handler is making moves.
|
boolean |
afkOn
Whether the AFK handler is enabled.
|
int |
afkTime
The time that the player has been AFK.
|
int |
afkTurn
The amount of time before the AFK handler makes a move.
|
BagSection |
bagSection
The player's battle bag.
|
int |
battleControllerIndex
The index of the battle controller for the battle the player is in.
|
boolean |
battleEnded
Whether the player's battle has ended.
|
ParticipantType[][] |
battleSetup
The layout of the battle's participants.
|
int |
battleTurn
Current turn.
|
BattleType |
battleType
The type of battle the player is involved in.
|
boolean |
canFlee
Whether the current Pokémon can flee from battle.
|
boolean |
canSwitch
Whether the current Pokémon can switch.
|
int |
catchCombo
The current catch combo.
|
boolean |
choosingPokemon
Whether the player is currently choosing a Pokémon.
|
int |
currentPokemon
The index of the Pokémon currently selecting a move.
|
PixelmonClientData[] |
displayedAllyPokemon
Pokémon owned by allies of the player that are displayed in the battle GUI.
|
PixelmonClientData[] |
displayedEnemyPokemon
The opposing Pokémon displayed in the battle GUI.
|
PixelmonClientData[] |
displayedOurPokemon
Pokémon owned by the player that are displayed in the battle GUI.
|
java.util.UUID |
dynamax |
boolean |
dynamaxDisabled |
boolean |
dynamaxing
Whether the player has chosen to Dynamax the current Pokémon.
|
int |
dynamaxTurnsLeft |
boolean |
enforcedFleeFailed
Whether a flee attempt has failed in this switch.
|
java.util.List<EvoInfo> |
evolveList
The Pokémon owned by the player that will evolve.
|
java.util.List<PixelmonClientData> |
fullOurPokemon
All the Pokémon on the player's team while in a battle.
|
boolean |
gigantamax |
boolean |
hasDynamaxed |
boolean |
hasUltraBurst |
int |
healAmount
The amount to heal the player's Pokémon by.
|
boolean |
healFinished
Whether the player's Pokémon has finished healing.
|
boolean |
isHealing
Whether the player's Pokémon is healing.
|
boolean |
isSpectating
Whether the player is spectating a battle.
|
ItemData |
itemToUse
The item to be used by the player.
|
org.apache.commons.lang3.tuple.Pair<BagSection,ItemData> |
lastItem |
java.util.ArrayList<LevelUpPacket> |
levelUpList
Pokémon owned by the player that have leveled up.
|
java.util.UUID |
megaEvolution
The ID of the currently Mega Evolved/Ultra Burst/Dynamaxed Pokémon.
|
boolean |
megaEvolving
Whether the player has chosen to Mega Evolve or Ultra Burst the current Pokémon.
|
protected java.util.concurrent.atomic.AtomicReference<BattleMode> |
mode |
java.util.ArrayList<AttackData> |
newAttackList
Attacks to be learned by the player's Pokémon.
|
Quadstate |
oldGen |
protected BattleMode |
oldMode |
java.util.ArrayList<java.util.UUID> |
pokemonToChoose
A list of Pokémon to choose actions for.
|
boolean |
preventFleeOnSwitch
Whether the player can flee (click the "Run" button) when they need to switch Pokémon.
|
BattleRules |
rules
The rules currently in effect for the battle.
|
java.util.Map<BagSection,java.util.List<ItemData>> |
sections |
java.util.ArrayList<AbstractPixelmonPacket> |
selectedActions
The actions that the player has currently selected for the battle turn.
|
int |
selectedAttack
The index of the attack selected by the player.
|
AbstractPixelmonPacket |
sendPacket
Sends packets to the server.
|
boolean |
showZMoves |
java.util.UUID |
spectatingUUID
The UUID of the player being spectated.
|
int |
startIndex
The index of the bag to begin displaying items at.
|
boolean[][] |
targetted
The Pokémon being targeted by an attack.
|
java.util.UUID[] |
teamPokemon
The Pokémon on the player's team that are on the field while in a battle.
|
StatusType |
terrain
Current terrain.
|
static java.util.Timer |
TIMER |
java.util.UUID |
ultraBurst |
boolean |
usedZMove |
boolean |
waitingText
Whether the "waiting" text is visible.
|
StatusType |
weather
Current weather.
|
BattleMode |
yesNoOrigin
The mode of the battle where the yes/no GUI was triggered from.
|
Constructor and Description |
---|
ClientBattleManager() |
Modifier and Type | Method and Description |
---|---|
void |
addBattleMessage(BattleTaskPacket message)
Adds a battle message that will be displayed to the player.
|
void |
addMessage(java.lang.String s)
Adds a battle message to the player's message list.
|
void |
addMessage(java.lang.String key,
java.lang.Object... arguments)
Adds a battle message to the player's message list.
|
void |
afkSelectMove()
Chooses a move with the AFK handler.
|
boolean |
canCatchOpponent()
Checks if the opponent can be caught in a Poké Ball.
|
boolean |
canDynamax()
Checks if the player is allowed to Dynamax.
|
boolean |
canDynamax(PixelmonClientData pig) |
boolean |
canForfeit()
Checks if the player can forfeit the battle.
|
boolean |
canMegaEvolve()
Checks if the player is allowed to Mega Evolve.
|
boolean |
canMegaEvolve(PixelmonClientData pig)
Checks if the player is allowed to Mega Evolve.
|
boolean |
canRunFromBattle()
Checks if the player can run from battle.
|
boolean |
canUltraBurst() |
boolean |
canUltraBurst(PixelmonClientData pig) |
boolean |
canUseZMove() |
boolean |
canUseZMove(PixelmonClientData pig) |
void |
checkClearedMessages()
Checks if the player has cleared all messages, and triggers the cleared message event if so.
|
void |
endSpectate()
Causes the player to stop spectating a battle.
|
void |
finishSelection()
Ends the move selection phase and sends the decisions to the server.
|
java.util.List<ItemData> |
getBagItems(BagSection section) |
PixelmonClientData |
getCurrentPokemon()
Gets the Pokémon currently awaiting action.
|
PixelmonEntity |
getEntity(java.util.UUID uuid)
Gets the Pokémon entity corresponding to a Pokémon UUID
|
java.util.Optional<ItemData> |
getLastUsedItemIfStillAvailable() |
BattleMode |
getMode() |
BattleTaskPacket |
getNextBattleTask() |
BattleMode |
getOldMode() |
java.util.Optional<net.minecraft.entity.Entity> |
getPokeballEntity() |
PixelmonClientData |
getPokemon(java.util.UUID uuid)
Gets a Pokémon in the battle the player is in.
|
PixelmonClientData |
getUncontrolledTeamPokemon(java.util.UUID uuid)
Gets an allied Pokémon not owned by the player.
|
PixelmonEntity |
getUserPokemon() |
PixelmonEntity |
getUserPokemon(CameraMode mode)
Gets the Pokémon currently awaiting action.
|
net.minecraft.entity.Entity |
getViewEntity()
Gets the entity the camera is focused on.
|
net.minecraft.entity.player.PlayerEntity |
getViewPlayer()
Gets the player being spectated.
|
boolean |
hasLevelUps()
Checks if any of the player's Pokémon have leveled up.
|
boolean |
hasMoreMessages()
Checks if the player has any more messages to be displayed.
|
boolean |
hasMoreTasks()
Checks if the player has any more tasks to be run.
|
boolean |
hasNewAttacks()
Checks if any of the player's Pokémon are learning new attacks.
|
boolean |
isBattling()
Checks if the player is battling in a battle (not including spectating).
|
boolean |
isEnemyPokemon(PixelmonClientData pokemon)
Checks if the Pokémon is on the opposing side.
|
boolean |
isOpponentWildNotBoss() |
boolean |
isProcessingTask()
Does not include tasks that are running parallel.
|
void |
onTick(net.minecraftforge.event.TickEvent.ClientTickEvent event)
Ticks the battle.
|
void |
processBattleTasks() |
void |
removeBattleTask() |
void |
resetAFKTime()
Resets the AFK time limit.
|
void |
resetViewEntity()
Resets the camera to focus on the player.
|
void |
restoreSettingsAndClose()
Marks the battle as ended.
|
void |
selectedMove()
Handles the selection of an action by the player.
|
void |
selectedMove(boolean isEnforcedSwitch)
Handles the selection of an action by the player.
|
void |
selectRunAction(java.util.UUID pokemonUUID)
Attempts to forfeit or flee the battle.
|
void |
sendParticipantReady()
Triggers when the player's battle messages are emptied.
|
void |
setCameraToPixelmon()
Keeps the Pokémon camera in third-person mode.
|
void |
setCameraToPlayer()
Keeps the player camera in first-person mode.
|
void |
setFullTeamData(PixelmonClientData[] data,
boolean useOldPokemonHealth)
Sets the data for all our available Pokémon in battle.
|
void |
setMode(BattleMode mode) |
void |
setMode(BattleMode mode,
BattleMode oldMode) |
void |
setOpponents(PixelmonClientData[] data)
Sets the Pokémon on the opposing side of the battle.
|
void |
setPokeballEntityId(int pokeballEntityId) |
void |
setTeamData(PixelmonClientData[] data)
Sets the data for allied Pokémon in battle.
|
void |
setTeamPokemon(PixelmonClientData[] data)
Sets the Pokémon on the player's side of the battle.
|
void |
setTeamPokemon(java.util.UUID[] pokemon)
Sets the Pokémon on the player's side of the battle.
|
void |
setTeamSelectTime()
Enables the team select timer if it is active.
|
void |
setViewEntity(net.minecraft.entity.Entity entity)
Sets the camera's focus to an entity.
|
void |
startBattle(int battleControllerIndex,
ParticipantType[][] battleSetup,
int afkActivate,
int afkTurn,
BattleRules rules)
Starts a battle involving the player.
|
void |
startPicking(java.util.List<java.lang.Boolean> canSwitch,
boolean canFlee,
java.util.ArrayList<java.util.UUID> pokemonToChoose)
Begins the move picking phase of battle.
|
void |
startSpectate(BattleType battleType)
Sets up the player to spectate a battle.
|
public static final java.util.Timer TIMER
public int battleControllerIndex
protected java.util.concurrent.atomic.AtomicReference<BattleMode> mode
protected BattleMode oldMode
public BagSection bagSection
public boolean battleEnded
public boolean isSpectating
public java.util.UUID[] teamPokemon
public PixelmonClientData[] displayedEnemyPokemon
public PixelmonClientData[] displayedOurPokemon
public PixelmonClientData[] displayedAllyPokemon
public java.util.List<PixelmonClientData> fullOurPokemon
public java.util.ArrayList<LevelUpPacket> levelUpList
public java.util.ArrayList<AttackData> newAttackList
public int startIndex
public ItemData itemToUse
public org.apache.commons.lang3.tuple.Pair<BagSection,ItemData> lastItem
public java.util.Map<BagSection,java.util.List<ItemData>> sections
public AbstractPixelmonPacket sendPacket
public BattleMode yesNoOrigin
public java.util.List<EvoInfo> evolveList
public boolean isHealing
public boolean enforcedFleeFailed
public boolean preventFleeOnSwitch
public int healAmount
public int selectedAttack
public int currentPokemon
public boolean[][] targetted
public boolean choosingPokemon
public int battleTurn
public StatusType weather
public StatusType terrain
public int catchCombo
public java.util.ArrayList<AbstractPixelmonPacket> selectedActions
public BattleType battleType
public boolean afkOn
public boolean afkActive
public int afkActivate
public int afkTurn
public int afkTime
public boolean waitingText
public boolean megaEvolving
public boolean dynamaxing
public java.util.UUID megaEvolution
public java.util.UUID ultraBurst
public java.util.UUID dynamax
public boolean hasUltraBurst
public boolean hasDynamaxed
public int dynamaxTurnsLeft
public boolean dynamaxDisabled
public boolean gigantamax
public boolean showZMoves
public boolean usedZMove
public Quadstate oldGen
public BattleRules rules
public boolean canSwitch
public boolean canFlee
public ParticipantType[][] battleSetup
public boolean healFinished
public java.util.ArrayList<java.util.UUID> pokemonToChoose
public java.util.UUID spectatingUUID
public boolean isBattling()
public void addMessage(java.lang.String s)
s
- The message to add.public void addMessage(java.lang.String key, java.lang.Object... arguments)
@Nullable public BattleTaskPacket getNextBattleTask()
public void removeBattleTask()
public boolean hasMoreMessages()
public boolean hasMoreTasks()
public void addBattleMessage(BattleTaskPacket message)
message
- The message to add.public void processBattleTasks()
public boolean isProcessingTask()
public void sendParticipantReady()
public void checkClearedMessages()
public PixelmonClientData getCurrentPokemon()
public PixelmonEntity getUserPokemon()
public PixelmonEntity getUserPokemon(CameraMode mode)
mode
- public PixelmonEntity getEntity(java.util.UUID uuid)
uuid
- The UUID of the Pokémonpublic boolean hasLevelUps()
public boolean hasNewAttacks()
public void startBattle(int battleControllerIndex, ParticipantType[][] battleSetup, int afkActivate, int afkTurn, BattleRules rules)
battleControllerIndex
- The index of the battle controller for the battle.battleSetup
- The layout of the battle's participants.afkActivate
- The amount of allotted time on the AFK handler.public void startSpectate(BattleType battleType)
battleType
- The type of battle the player is spectating.public void endSpectate()
public void onTick(net.minecraftforge.event.TickEvent.ClientTickEvent event)
event
- The triggering tick event.public void restoreSettingsAndClose()
public boolean canCatchOpponent()
public boolean isOpponentWildNotBoss()
public boolean canRunFromBattle()
public boolean canForfeit()
public net.minecraft.entity.player.PlayerEntity getViewPlayer()
public void startPicking(java.util.List<java.lang.Boolean> canSwitch, boolean canFlee, java.util.ArrayList<java.util.UUID> pokemonToChoose)
canSwitch
- Whether the Pokémon can switch.canFlee
- Whether the player can flee from battle.pokemonToChoose
- A list of Pokémon to choose actions for.public void selectedMove()
public void selectedMove(boolean isEnforcedSwitch)
isEnforcedSwitch
- Whether the action was an enforced switch.public void afkSelectMove()
public void finishSelection()
public void setTeamPokemon(java.util.UUID[] pokemon)
pokemon
- The Pokémon on the player's side of the battle.public void setTeamPokemon(PixelmonClientData[] data)
data
- The Pokémon on the player's side of the battle.public void setOpponents(PixelmonClientData[] data)
data
- The Pokémon on the opposing side of the battle.public void setTeamData(PixelmonClientData[] data)
data
- The allied Pokémon.public void setFullTeamData(PixelmonClientData[] data, boolean useOldPokemonHealth)
data
- Our available Pokémon.useOldPokemonHealth
- If true, updates the Pokémon health values of data with the values
the client already has, presumably as a workaround for the HPUpdateTask
(which handles the animation of health going down).public PixelmonClientData getUncontrolledTeamPokemon(java.util.UUID uuid)
uuid
- The UUID of the allied Pokémon.public PixelmonClientData getPokemon(java.util.UUID uuid)
uuid
- The UUID of the Pokémon.public boolean isEnemyPokemon(PixelmonClientData pokemon)
pokemon
- The Pokémon to check.public java.util.List<ItemData> getBagItems(BagSection section)
public void setCameraToPixelmon()
public void setCameraToPlayer()
public void setViewEntity(net.minecraft.entity.Entity entity)
entity
- The entity to focus the camera at.public net.minecraft.entity.Entity getViewEntity()
public void resetViewEntity()
public void resetAFKTime()
public void setTeamSelectTime()
public java.util.Optional<ItemData> getLastUsedItemIfStillAvailable()
public void selectRunAction(java.util.UUID pokemonUUID)
public boolean canMegaEvolve()
public boolean canDynamax()
public boolean canMegaEvolve(PixelmonClientData pig)
public boolean canUltraBurst()
public boolean canUltraBurst(PixelmonClientData pig)
public boolean canDynamax(PixelmonClientData pig)
public boolean canUseZMove()
public boolean canUseZMove(PixelmonClientData pig)
public java.util.Optional<net.minecraft.entity.Entity> getPokeballEntity()
public void setPokeballEntityId(int pokeballEntityId)
public void setMode(BattleMode mode)
public void setMode(BattleMode mode, BattleMode oldMode)
public BattleMode getMode()
public BattleMode getOldMode()