Interface MapDecoration.Builder
-
- All Superinterfaces:
ResettableBuilder<MapDecoration,MapDecoration.Builder>
- Enclosing interface:
- MapDecoration
public static interface MapDecoration.Builder extends ResettableBuilder<MapDecoration,MapDecoration.Builder>
A builder that createsMapDecoration
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MapDecoration
build()
Creates a newMapDecoration
based on the current builder state.MapDecoration.Builder
customName(Component customName)
MapDecoration.Builder
from(MapDecoration mapDecoration)
MapDecoration.Builder
fromContainer(DataView container)
Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.MapDecoration.Builder
position(Vector2i position)
Sets the position of the decoration.default MapDecoration.Builder
rotation(Supplier<MapDecorationOrientation> rotSupplier)
MapDecoration.Builder
rotation(MapDecorationOrientation rot)
Sets the orientation of the symbol when displayed on aMapInfo
.default MapDecoration.Builder
type(Supplier<MapDecorationType> type)
MapDecoration.Builder
type(MapDecorationType type)
Sets theMapDecorationType
that the builtMapDecoration
will display.-
Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
-
-
-
Method Detail
-
type
MapDecoration.Builder type(MapDecorationType type)
Sets theMapDecorationType
that the builtMapDecoration
will display.- Parameters:
type
- TheMapDecorationType
- Returns:
- This builder, for chaining
-
type
default MapDecoration.Builder type(Supplier<MapDecorationType> type)
-
rotation
MapDecoration.Builder rotation(MapDecorationOrientation rot)
Sets the orientation of the symbol when displayed on aMapInfo
.- Parameters:
rot
- TheMapDecorationOrientation
the- Returns:
- This builder, for chaining
-
rotation
default MapDecoration.Builder rotation(Supplier<MapDecorationOrientation> rotSupplier)
-
position
MapDecoration.Builder position(Vector2i position) throws IllegalArgumentException
Sets the position of the decoration. Valid co-ordinates are between-128
and127
, with (-128, -128) being the bottom left corner of a map.- Returns:
- This builder, for chaining
- Throws:
IllegalArgumentException
- if a position outside of the map is specified.- See Also:
for further descrption of the co-ordinate system
-
customName
MapDecoration.Builder customName(Component customName)
-
from
MapDecoration.Builder from(MapDecoration mapDecoration)
-
fromContainer
MapDecoration.Builder fromContainer(DataView container)
Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.If the given DataView was from a persistent
MapDecoration
, i.e,MapDecoration.isPersistent()
returned true, it will create a custom MapDecoration that mimics it, which will be persistent- Parameters:
container
- The container to translate- Returns:
- This builder, for chaining
-
build
MapDecoration build() throws IllegalStateException
Creates a newMapDecoration
based on the current builder state.- Returns:
- A
MapDecoration
- Throws:
IllegalStateException
- if aMapDecorationType
has not been supplied
-
-