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 theMapShadetoMapShades.BASE.default MapColor.BuilderbaseColor(Supplier<MapColorType> mapColorTypeSupplier) Method to ease usingMapColorTypesenumerations.baseColor(MapColorType mapColor) Sets theMapColorTypethat will form the basis of the builtMapColor.build()dark()Sets theMapShadetoMapShades.DARK.darker()Sets theMapShadetoMapShades.DARKER.darkest()Sets theMapShadetoMapShades.DARKEST.Copies all data from the givenMapColorand applies it to this builder.fromContainer(DataView container) Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer().Sets theMapShadeof the suppliedMapColor.color().Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
Method Details
-
shade
Sets theMapShadeof the suppliedMapColor.color().If this method is not called,
MapShades.BASEis used.- Parameters:
shade- TheMapShadeto use- Returns:
- This builder, for chaining
-
base
MapColor.Builder base()Sets theMapShadetoMapShades.BASE.- Returns:
- This builder, for chaining
-
dark
MapColor.Builder dark()Sets theMapShadetoMapShades.DARK.- Returns:
- This builder, for chaining
-
darker
MapColor.Builder darker()Sets theMapShadetoMapShades.DARKER.- Returns:
- This builder, for chaining
-
darkest
MapColor.Builder darkest()Sets theMapShadetoMapShades.DARKEST.- Returns:
- This builder, for chaining
-
baseColor
Sets theMapColorTypethat will form the basis of the builtMapColor.- Parameters:
mapColor- the MapColorType- Returns:
- This builder, for chaining
-
baseColor
Method to ease usingMapColorTypesenumerations. Unwraps then callsbaseColor(MapColorType)- Parameters:
mapColorTypeSupplier- Supplier to be unwrapped and applied- Returns:
- This builder, for chaining
-
from
Copies all data from the givenMapColorand 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-MapColorto 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 noMapColorTypewas provided
-