Package org.spongepowered.api.map.color
Interface MapColor.Builder
- All Superinterfaces:
ResettableBuilder<MapColor,
MapColor.Builder>
- Enclosing interface:
- MapColor
Builds a
MapColor
-
Method Summary
Modifier and TypeMethodDescriptionbase()
Sets theMapShade
toMapShades.BASE
.default MapColor.Builder
baseColor
(Supplier<MapColorType> mapColorTypeSupplier) Method to ease usingMapColorTypes
enumerations.baseColor
(MapColorType mapColor) Sets theMapColorType
that will form the basis of the builtMapColor
.build()
dark()
Sets theMapShade
toMapShades.DARK
.darker()
Sets theMapShade
toMapShades.DARKER
.darkest()
Sets theMapShade
toMapShades.DARKEST
.Copies all data from the givenMapColor
and applies it to this builder.fromContainer
(DataView container) Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.Sets theMapShade
of the suppliedMapColor.color()
.Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
Method Details
-
shade
Sets theMapShade
of the suppliedMapColor.color()
.If this method is not called,
MapShades.BASE
is used.- Parameters:
shade
- TheMapShade
to use- Returns:
- This builder, for chaining
-
base
MapColor.Builder base()Sets theMapShade
toMapShades.BASE
.- Returns:
- This builder, for chaining
-
dark
MapColor.Builder dark()Sets theMapShade
toMapShades.DARK
.- Returns:
- This builder, for chaining
-
darker
MapColor.Builder darker()Sets theMapShade
toMapShades.DARKER
.- Returns:
- This builder, for chaining
-
darkest
MapColor.Builder darkest()Sets theMapShade
toMapShades.DARKEST
.- Returns:
- This builder, for chaining
-
baseColor
Sets theMapColorType
that will form the basis of the builtMapColor
.- Parameters:
mapColor
- the MapColorType- Returns:
- This builder, for chaining
-
baseColor
Method to ease usingMapColorTypes
enumerations. Unwraps then callsbaseColor(MapColorType)
- Parameters:
mapColorTypeSupplier
- Supplier to be unwrapped and applied- Returns:
- This builder, for chaining
-
from
Copies all data from the givenMapColor
and applies it to this builder. Therefore, ifbuild()
is called directly after, the result ofObjects.equals(Object, Object)
between them will betrue
. Any aspect of this builder could then be modified to produce similar but not identical MapColors.- Parameters:
mapColor
-MapColor
to copy data from.- Returns:
- This builder, for chaining
-
fromContainer
Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.- Parameters:
container
- The container to translate- Returns:
- This builder, for chaining
-
build
- Returns:
- The
MapColor
- Throws:
IllegalStateException
- if noMapColorType
was provided
-