Player.Commands.Builder


@UnstableApi
class Player.Commands.Builder


A builder for Commands instances.

Summary

Public constructors

Creates a builder.

Public functions

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!

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!

Removes a Command if the provided condition is true.

Public constructors

Builder

Builder()

Creates a builder.

Public functions

add

@CanIgnoreReturnValue
fun add(@Player.Command command: Int): Player.Commands.Builder!

Adds a Command.

Parameters
@Player.Command command: Int

A Command.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
fun addAll(@Player.Command commands: IntArray!): Player.Commands.Builder!

Adds commands.

Parameters
@Player.Command commands: IntArray!

The commands to add.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAll

@CanIgnoreReturnValue
fun addAll(commands: Player.Commands!): Player.Commands.Builder!

Adds Commands.

Parameters
commands: Player.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
fun addAllCommands(): Player.Commands.Builder!

Adds all existing commands.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addAllReadOnlyCommands

@CanIgnoreReturnValue
fun addAllReadOnlyCommands(): 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.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

addIf

@CanIgnoreReturnValue
fun addIf(@Player.Command command: Int, condition: Boolean): Player.Commands.Builder!

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

Parameters
@Player.Command command: Int

A Command.

condition: Boolean

A condition.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

build

fun build(): Player.Commands!

Builds a Commands instance.

Throws
java.lang.IllegalStateException

If this method has already been called.

remove

@CanIgnoreReturnValue
fun remove(@Player.Command command: Int): Player.Commands.Builder!

Removes a Command.

Parameters
@Player.Command command: Int

A Command.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeAll

@CanIgnoreReturnValue
fun removeAll(@Player.Command commands: IntArray!): Player.Commands.Builder!

Removes commands.

Parameters
@Player.Command commands: IntArray!

The commands to remove.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.

removeIf

@CanIgnoreReturnValue
fun removeIf(@Player.Command command: Int, condition: Boolean): Player.Commands.Builder!

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

Parameters
@Player.Command command: Int

A Command.

condition: Boolean

A condition.

Returns
Player.Commands.Builder!

This builder.

Throws
java.lang.IllegalStateException

If build has already been called.