Package org.spongepowered.api.map.color
Interface MapColor.Builder
-
- All Superinterfaces:
ResettableBuilder<MapColor,MapColor.Builder>
- Enclosing interface:
- MapColor
public static interface MapColor.Builder extends ResettableBuilder<MapColor,MapColor.Builder>
Builds aMapColor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MapColor.Builderbase()Sets theMapShadetoMapShades.BASE.default MapColor.BuilderbaseColor(java.util.function.Supplier<MapColorType> mapColorTypeSupplier)Method to ease usingMapColorTypesenumerations.MapColor.BuilderbaseColor(MapColorType mapColor)Sets theMapColorTypethat will form the basis of the builtMapColor.MapColorbuild()MapColor.Builderdark()Sets theMapShadetoMapShades.DARK.MapColor.Builderdarker()Sets theMapShadetoMapShades.DARKER.MapColor.Builderdarkest()Sets theMapShadetoMapShades.DARKEST.MapColor.Builderfrom(MapColor mapColor)Copies all data from the givenMapColorand applies it to this builder.MapColor.BuilderfromContainer(DataView container)Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer().MapColor.Buildershade(MapShade shade)Sets theMapShadeof the suppliedMapColor.color().-
Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
-
-
-
Method Detail
-
shade
MapColor.Builder shade(MapShade 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
MapColor.Builder baseColor(MapColorType mapColor)
Sets theMapColorTypethat will form the basis of the builtMapColor.- Parameters:
mapColor- the MapColorType- Returns:
- This builder, for chaining
-
baseColor
default MapColor.Builder baseColor(java.util.function.Supplier<MapColorType> mapColorTypeSupplier)
Method to ease usingMapColorTypesenumerations. Unwraps then callsbaseColor(MapColorType)- Parameters:
mapColorTypeSupplier- Supplier to be unwrapped and applied- Returns:
- This builder, for chaining
-
from
MapColor.Builder from(MapColor mapColor)
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
MapColor.Builder fromContainer(DataView container)
Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer().- Parameters:
container- The container to translate- Returns:
- This builder, for chaining
-
build
MapColor build() throws java.lang.IllegalStateException
- Returns:
- The
MapColor - Throws:
java.lang.IllegalStateException- if noMapColorTypewas provided
-
-