Player.Commands.Builder


@UnstableApi
public final class Player.Commands.Builder


A builder for Commands instances.

Summary

Public constructors

Creates a builder.

Public methods

Player.Commands.Builder

Adds a Command.

Player.Commands.Builder

Adds commands.

Player.Commands.Builder

Adds Commands.

Player.Commands.Builder

Adds all existing commands.

Player.Commands.Builder

Adds all existing commands that provide read access to the Player, excluding all commands that allow to modify the state of the player.

Player.Commands.Builder
@CanIgnoreReturnValue
addIf(@Player.Command int command, boolean condition)

Adds a Command if the provided condition is true.

Player.Commands

Builds a Commands instance.

Player.Commands.Builder

Removes a Command.

Player.Commands.Builder

Removes commands.

Player.Commands.Builder
@CanIgnoreReturnValue
removeIf(@Player.Command int command, boolean condition)

Removes a Command if the provided condition is true.

Public constructors

Builder

public Builder()

Creates a builder.

Public methods

add

@CanIgnoreReturnValue
public Player.Commands.Builder add(@Player.Command int command)

Adds a Command.

Parameters
@Player.Command int command

A Command.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
public Player.Commands.Builder addAll(@Player.Command int[] commands)

Adds commands.

Parameters
@Player.Command int[] commands

The commands to add.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
public Player.Commands.Builder addAll(Player.Commands commands)

Adds Commands.

Parameters
Player.Commands commands

The set of commands to add.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAllCommands

@CanIgnoreReturnValue
public Player.Commands.Builder addAllCommands()

Adds all existing commands.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAllReadOnlyCommands

@CanIgnoreReturnValue
public Player.Commands.Builder addAllReadOnlyCommands()

Adds all existing commands that provide read access to the Player, excluding all commands that allow to modify the state of the player.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addIf

@CanIgnoreReturnValue
public Player.Commands.Builder addIf(@Player.Command int command, boolean condition)

Adds a Command if the provided condition is true. Does nothing otherwise.

Parameters
@Player.Command int command

A Command.

boolean condition

A condition.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

build

public Player.Commands build()

Builds a Commands instance.

Throws
java.lang.IllegalStateException

If this method has already been called.

remove

@CanIgnoreReturnValue
public Player.Commands.Builder remove(@Player.Command int command)

Removes a Command.

Parameters
@Player.Command int command

A Command.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeAll

@CanIgnoreReturnValue
public Player.Commands.Builder removeAll(@Player.Command int[] commands)

Removes commands.

Parameters
@Player.Command int[] commands

The commands to remove.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeIf

@CanIgnoreReturnValue
public Player.Commands.Builder removeIf(@Player.Command int command, boolean condition)

Removes a Command if the provided condition is true. Does nothing otherwise.

Parameters
@Player.Command int command

A Command.

boolean condition

A condition.

Returns
Player.Commands.Builder

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.