Interface GameRule.Builder<V>
- All Superinterfaces:
AbstractBuilder<GameRule<V>>
,Builder<GameRule<V>,
,GameRule.Builder<V>> ResettableBuilder<GameRule<V>,
GameRule.Builder<V>>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theGameRule
.defaultValue
(V defaultValue) Sets the default value.Sets the name of the game rule.<NV> GameRule.Builder
<NV> valueType
(io.leangen.geantyref.TypeToken<NV> valueType) Sets the valuetype
.<NV> GameRule.Builder
<NV> Sets the value type.
-
Method Details
-
name
Sets the name of the game rule.- Parameters:
name
- The name- Returns:
- This builder for chaining
-
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
Sets the valuetype
.- Type Parameters:
NV
- The value type- Parameters:
valueType
- The value type- Returns:
- This builder, for chaining
-
defaultValue
Sets the default value.Must be called after
valueType(TypeToken)
.- Parameters:
defaultValue
- The default value- Returns:
- This builder, for chaining
-
build
Builds theGameRule
.- Specified by:
build
in interfaceAbstractBuilder<V>
- Returns:
- The built game rule
- Throws:
IllegalStateException
- If not all required options were specified;valueType(TypeToken)
,defaultValue(Object)
.
-