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 newMapDecorationbased 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.Builderrotation(Supplier<MapDecorationOrientation> rotSupplier) Sets the orientation of the symbol when displayed on aMapInfo.default MapDecoration.Buildertype(Supplier<MapDecorationType> type) type(MapDecorationType type) Sets theMapDecorationTypethat the builtMapDecorationwill display.Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
Method Details
-
type
Sets theMapDecorationTypethat the builtMapDecorationwill display.- Parameters:
type- TheMapDecorationType- Returns:
- This builder, for chaining
-
type
-
rotation
Sets the orientation of the symbol when displayed on aMapInfo.- Parameters:
rot- TheMapDecorationOrientationthe- Returns:
- This builder, for chaining
-
rotation
-
position
Sets the position of the decoration. Valid co-ordinates are between-128and127, 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 newMapDecorationbased on the current builder state.- Returns:
- A
MapDecoration - Throws:
IllegalStateException- if aMapDecorationTypehas not been supplied
-