Class TeamSelectionRegistry.Builder
java.lang.Object
com.pixelmonmod.pixelmon.battles.api.rules.teamselection.TeamSelectionRegistry.Builder
- Enclosing class:
- TeamSelectionRegistry
Builder class for team selection UI
-
Field Summary
Modifier and TypeFieldDescriptionprotected BattleRules
protected Consumer<BattleController>
protected Consumer<TeamSelection>
protected boolean
protected List<PartyStorage>
protected boolean
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbattleRules
(BattleRules battleRules) Sets the battle rules to be used in the battlebattleStartConsumer
(Consumer<BattleController> battleStartConsumer) Sets the handler for when the battle is started from the team selection UIcancelConsumer
(Consumer<TeamSelection> cancelConsumer) Sets the handler for when the team selection is canceled (I believe this only happens if they have 0 valid Pokemon)Sets the GUI as closeable (via ESCAPE button)closeable
(boolean closeable) Sets if the GUI can be closed or not (via ESCAPE button)Hides the opponent's teammembers
(PartyStorage... storage) Adds the storages as membersmembers
(net.minecraft.world.entity.Entity... entities) Adds the entities as membersSets the GUI as not closeable (via ESCAPE button)Shows the opponent's teamProxy forshowRules(boolean)
setting it to trueshowRules
(boolean showRules) Sets the show rules settingvoid
start()
Sends the team select screen to all entities
-
Field Details
-
battleRules
-
members
-
showRules
protected boolean showRules -
showOpponentTeam
protected boolean showOpponentTeam -
closeable
protected boolean closeable -
cancelConsumer
-
battleStartConsumer
-
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
battleRules
Sets the battle rules to be used in the battle- Parameters:
battleRules
- The battle rules to use- Returns:
- The builder instance
-
members
Adds the entities as members- Parameters:
entities
- The entities added as members (none can be null)- Returns:
- The builder
-
members
Adds the storages as members- Parameters:
storage
- The storages added as members (none can be null)- Returns:
- The builder
-
showRules
Proxy forshowRules(boolean)
setting it to true- Returns:
- The builder
-
showRules
Sets the show rules setting- Parameters:
showRules
- If the battle rules should be shown- Returns:
- The builder
-
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
Shows the opponent's team- Returns:
- The builder
-
hideOpponentTeam
Hides the opponent's team- Returns:
- The builder
-
closeable
Sets the GUI as closeable (via ESCAPE button)- Returns:
- The builder
-
notCloseable
Sets the GUI as not closeable (via ESCAPE button)- Returns:
- The builder
-
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
-