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 creates
MapDecoration
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a newMapDecoration
based on the current builder state.customName
(Component customName) from
(MapDecoration mapDecoration) fromContainer
(DataView container) Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()
.Sets the position of the decoration.default MapDecoration.Builder
rotation
(Supplier<MapDecorationOrientation> rotSupplier) Sets the orientation of the symbol when displayed on aMapInfo
.default MapDecoration.Builder
type
(Supplier<MapDecorationType> type) type
(MapDecorationType type) Sets theMapDecorationType
that the builtMapDecoration
will display.Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
Method Details
-
type
Sets theMapDecorationType
that the builtMapDecoration
will display.- Parameters:
type
- TheMapDecorationType
- Returns:
- This builder, for chaining
-
type
-
rotation
Sets the orientation of the symbol when displayed on aMapInfo
.- Parameters:
rot
- TheMapDecorationOrientation
the- Returns:
- This builder, for chaining
-
rotation
-
position
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:
-
customName
-
from
-
fromContainer
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
Creates a newMapDecoration
based on the current builder state.- Returns:
- A
MapDecoration
- Throws:
IllegalStateException
- if aMapDecorationType
has not been supplied
-