public class TeamSelection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.function.Consumer<BattleController> |
battleStartConsumer |
protected java.util.function.Consumer<TeamSelection> |
cancelConsumer |
protected boolean |
closeable |
static java.lang.String |
EGG_KEY |
static java.lang.String |
FAINT_KEY |
protected int |
id |
static java.lang.String |
NONE_KEY |
protected com.pixelmonmod.pixelmon.battles.api.rules.teamselection.ParticipantSelection[] |
participants |
protected BattleRules |
rules |
protected boolean |
showOpponentTeam |
protected boolean |
showRules |
Constructor and Description |
---|
TeamSelection(int id,
BattleRules rules,
boolean showRules,
boolean showOpponentTeam,
boolean closeable,
java.util.function.Consumer<TeamSelection> cancelConsumer,
java.util.function.Consumer<BattleController> battleStartConsumer,
PartyStorage... storages) |
TeamSelection(int id,
BattleRules rules,
boolean showRules,
boolean showOpponentTeam,
boolean closeable,
PartyStorage... storages)
Initializes a team select object.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
getReservedKeys()
Gets keywords that are reserved and cannot be used for battle clause IDs.
|
void |
handleCancel() |
boolean |
hasPlayer(net.minecraft.entity.player.ServerPlayerEntity player)
Checks if the team selection contains a certain player.
|
void |
registerTeamSelect(net.minecraft.entity.player.ServerPlayerEntity player,
int[] selection,
boolean force)
Registers a selection that a player has made.
|
void |
unregisterTeamSelect(net.minecraft.entity.player.ServerPlayerEntity player)
Marks a player's selection as unconfirmed.
|
public static final java.lang.String FAINT_KEY
public static final java.lang.String EGG_KEY
public static final java.lang.String NONE_KEY
protected int id
protected BattleRules rules
protected com.pixelmonmod.pixelmon.battles.api.rules.teamselection.ParticipantSelection[] participants
protected boolean showRules
protected boolean showOpponentTeam
protected boolean closeable
protected java.util.function.Consumer<TeamSelection> cancelConsumer
protected java.util.function.Consumer<BattleController> battleStartConsumer
public TeamSelection(int id, BattleRules rules, boolean showRules, boolean showOpponentTeam, boolean closeable, PartyStorage... storages)
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.public TeamSelection(int id, BattleRules rules, boolean showRules, boolean showOpponentTeam, boolean closeable, java.util.function.Consumer<TeamSelection> cancelConsumer, java.util.function.Consumer<BattleController> battleStartConsumer, PartyStorage... storages)
public boolean hasPlayer(net.minecraft.entity.player.ServerPlayerEntity player)
player
- The player to check for.public void handleCancel()
public void registerTeamSelect(net.minecraft.entity.player.ServerPlayerEntity player, int[] selection, boolean force)
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.public void unregisterTeamSelect(net.minecraft.entity.player.ServerPlayerEntity player)
player
- The player to mark as unconfirmed.public static java.lang.String[] getReservedKeys()