Interface GameRule.Builder<V>

All Superinterfaces:
AbstractBuilder<GameRule<V>>, Builder<GameRule<V>,GameRule.Builder<V>>, ResettableBuilder<GameRule<V>,GameRule.Builder<V>>
Enclosing interface:
GameRule<V>

public static interface GameRule.Builder<V> extends Builder<GameRule<V>,GameRule.Builder<V>>
  • Method Details

    • name

      GameRule.Builder<V> name(String name)
      Sets the name of the game rule.
      Parameters:
      name - The name
      Returns:
      This builder for chaining
    • valueType

      <NV> GameRule.Builder<NV> valueType(Class<NV> valueType)
      Sets the value type.

      This must not be a raw parameterized type.

      Type Parameters:
      NV - The value type
      Parameters:
      valueType - The value type
      Returns:
      This builder, for chaining
    • valueType

      <NV> GameRule.Builder<NV> valueType(io.leangen.geantyref.TypeToken<NV> valueType)
      Sets the value type.
      Type Parameters:
      NV - The value type
      Parameters:
      valueType - The value type
      Returns:
      This builder, for chaining
    • defaultValue

      GameRule.Builder<V> defaultValue(V defaultValue)
      Sets the default value.

      Must be called after valueType(TypeToken).

      Parameters:
      defaultValue - The default value
      Returns:
      This builder, for chaining
    • build

      Builds the GameRule.
      Specified by:
      build in interface AbstractBuilder<V>
      Returns:
      The built game rule
      Throws:
      IllegalStateException - If not all required options were specified; valueType(TypeToken), defaultValue(Object).