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 MapDecorationbuild()Creates a newMapDecorationbased on the current builder state.MapDecoration.BuildercustomName(Component customName)MapDecoration.Builderfrom(MapDecoration mapDecoration)MapDecoration.BuilderfromContainer(DataView container)Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer().MapDecoration.Builderposition(Vector2i position)Sets the position of the decoration.default MapDecoration.Builderrotation(Supplier<MapDecorationOrientation> rotSupplier)MapDecoration.Builderrotation(MapDecorationOrientation rot)Sets the orientation of the symbol when displayed on aMapInfo.default MapDecoration.Buildertype(Supplier<MapDecorationType> type)MapDecoration.Buildertype(MapDecorationType type)Sets theMapDecorationTypethat the builtMapDecorationwill display.-
Methods inherited from interface org.spongepowered.api.util.ResettableBuilder
reset
-
-
-
-
Method Detail
-
type
MapDecoration.Builder type(MapDecorationType type)
Sets theMapDecorationTypethat the builtMapDecorationwill 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- TheMapDecorationOrientationthe- 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-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:
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 newMapDecorationbased on the current builder state.- Returns:
- A
MapDecoration - Throws:
IllegalStateException- if aMapDecorationTypehas not been supplied
-
-