Class TeamSelectionRegistry.Builder

java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.teamselection.TeamSelectionRegistry.Builder
Enclosing class:
TeamSelectionRegistry

public static class TeamSelectionRegistry.Builder extends Object
Builder class for team selection UI
  • Field Details

    • battleRules

      protected BattleRules battleRules
    • members

      protected List<PartyStorage> members
    • showRules

      protected boolean showRules
    • showOpponentTeam

      protected boolean showOpponentTeam
    • closeable

      protected boolean closeable
    • cancelConsumer

      protected Consumer<TeamSelection> cancelConsumer
    • battleStartConsumer

      protected Consumer<BattleController> battleStartConsumer
  • Constructor Details

    • Builder

      protected Builder()
  • Method Details

    • battleRules

      public TeamSelectionRegistry.Builder battleRules(BattleRules battleRules)
      Sets the battle rules to be used in the battle
      Parameters:
      battleRules - The battle rules to use
      Returns:
      The builder instance
    • members

      public TeamSelectionRegistry.Builder members(net.minecraft.world.entity.Entity... entities)
      Adds the entities as members
      Parameters:
      entities - The entities added as members (none can be null)
      Returns:
      The builder
    • members

      public TeamSelectionRegistry.Builder members(PartyStorage... storage)
      Adds the storages as members
      Parameters:
      storage - The storages added as members (none can be null)
      Returns:
      The builder
    • showRules

      public TeamSelectionRegistry.Builder showRules()
      Proxy for showRules(boolean) setting it to true
      Returns:
      The builder
    • showRules

      public TeamSelectionRegistry.Builder showRules(boolean showRules)
      Sets the show rules setting
      Parameters:
      showRules - If the battle rules should be shown
      Returns:
      The builder
    • cancelConsumer

      public TeamSelectionRegistry.Builder cancelConsumer(Consumer<TeamSelection> cancelConsumer)
      Sets the handler for when the team selection is canceled (I believe this only happens if they have 0 valid Pokemon)
      Parameters:
      cancelConsumer - The cancel consumer
      Returns:
      The builder
    • battleStartConsumer

      public TeamSelectionRegistry.Builder battleStartConsumer(Consumer<BattleController> battleStartConsumer)
      Sets the handler for when the battle is started from the team selection UI
      Parameters:
      battleStartConsumer - The start consumer
      Returns:
      The builder
    • showOpponentTeam

      public TeamSelectionRegistry.Builder showOpponentTeam()
      Shows the opponent's team
      Returns:
      The builder
    • hideOpponentTeam

      public TeamSelectionRegistry.Builder hideOpponentTeam()
      Hides the opponent's team
      Returns:
      The builder
    • closeable

      public TeamSelectionRegistry.Builder closeable()
      Sets the GUI as closeable (via ESCAPE button)
      Returns:
      The builder
    • notCloseable

      public TeamSelectionRegistry.Builder notCloseable()
      Sets the GUI as not closeable (via ESCAPE button)
      Returns:
      The builder
    • closeable

      public TeamSelectionRegistry.Builder closeable(boolean closeable)
      Sets if the GUI can be closed or not (via ESCAPE button)
      Parameters:
      closeable - True if they can close it - false if not
      Returns:
      The builder
    • start

      public void start()
      Sends the team select screen to all entities