java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.teamselection.TeamSelection

public class TeamSelection extends Object
Keeps track of pre-battle team selection.
  • Field Details

    • FAINT_KEY

      public static final String FAINT_KEY
      See Also:
    • EGG_KEY

      public static final String EGG_KEY
      See Also:
    • NONE_KEY

      public static final String NONE_KEY
      See Also:
    • id

      protected int id
    • rules

      protected BattleRules 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

      protected Consumer<TeamSelection> cancelConsumer
    • battleStartConsumer

      protected Consumer<BattleController> 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

      public static String[] 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.