Class TeamSelection
java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.teamselection.TeamSelection
Keeps track of pre-battle team selection.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Consumer<BattleController>
protected Consumer<TeamSelection>
protected boolean
static final String
static final String
protected int
static final String
protected com.pixelmonmod.pixelmon.battles.api.rules.teamselection.ParticipantSelection[]
protected BattleRules
protected boolean
protected boolean
-
Constructor Summary
ConstructorDescriptionTeamSelection
(int id, BattleRules rules, boolean showRules, boolean showOpponentTeam, boolean closeable, PartyStorage... storages) Initializes a team select object.TeamSelection
(int id, BattleRules rules, boolean showRules, boolean showOpponentTeam, boolean closeable, Consumer<TeamSelection> cancelConsumer, Consumer<BattleController> battleStartConsumer, PartyStorage... storages) -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
Gets keywords that are reserved and cannot be used for battle clause IDs.void
boolean
hasPlayer
(net.minecraft.server.level.ServerPlayer player) Checks if the team selection contains a certain player.void
registerTeamSelect
(net.minecraft.server.level.ServerPlayer player, int[] selection, boolean force) Registers a selection that a player has made.void
unregisterTeamSelect
(net.minecraft.server.level.ServerPlayer player) Marks a player's selection as unconfirmed.
-
Field Details
-
FAINT_KEY
- See Also:
-
EGG_KEY
- See Also:
-
NONE_KEY
- See Also:
-
id
protected int id -
rules
-
participants
protected com.pixelmonmod.pixelmon.battles.api.rules.teamselection.ParticipantSelection[] participants -
showRules
protected boolean showRules -
showOpponentTeam
protected boolean showOpponentTeam -
closeable
protected boolean closeable -
cancelConsumer
-
battleStartConsumer
-
-
Constructor Details
-
TeamSelection
public TeamSelection(int id, BattleRules rules, boolean showRules, boolean showOpponentTeam, boolean closeable, PartyStorage... storages) Initializes a team select object.- Parameters:
id
- The ID of the team selection.rules
- The rules to be used for the battle.showRules
- Whether to show the rules before displaying the team select screen.
-
TeamSelection
public TeamSelection(int id, BattleRules rules, boolean showRules, boolean showOpponentTeam, boolean closeable, Consumer<TeamSelection> cancelConsumer, Consumer<BattleController> battleStartConsumer, PartyStorage... storages)
-
-
Method Details
-
hasPlayer
public boolean hasPlayer(net.minecraft.server.level.ServerPlayer player) Checks if the team selection contains a certain player.- Parameters:
player
- The player to check for.- Returns:
- Whether the team selection contains a certain player.
-
handleCancel
public void handleCancel() -
registerTeamSelect
public void registerTeamSelect(net.minecraft.server.level.ServerPlayer player, int[] selection, boolean force) Registers a selection that a player has made.- Parameters:
player
- The player making the selection.selection
- The selection the player made.force
- Whether to force the selection confirmation because the team select timer expired.
-
unregisterTeamSelect
public void unregisterTeamSelect(net.minecraft.server.level.ServerPlayer player) Marks a player's selection as unconfirmed.- Parameters:
player
- The player to mark as unconfirmed.
-
getReservedKeys
Gets keywords that are reserved and cannot be used for battle clause IDs.- Returns:
- Keywords that are reserved and cannot be used for battle clause IDs.
-