Player.Commands.Builder


@UnstableApi
class Player.Commands.Builder


A builder for Commands instances.

Summary

Public constructors

Creates a builder.

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.

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.