Package org.geysermc.geyser.api.waypoint
Interface CustomWaypointStyle.VanillaBuilder
- All Superinterfaces:
GenericBuilder<CustomWaypointStyle>
- Enclosing interface:
CustomWaypointStyle
@NonExtendable
public static interface CustomWaypointStyle.VanillaBuilder
extends GenericBuilder<CustomWaypointStyle>
This builder can be used to create an implementation of
CustomWaypointStyle that acts like the vanilla Java Edition
custom waypoint styles.
When creating an instance of this builder, a nearDistance and farDistance have to be specified,
which act the same as their Java Edition counterparts. Then, 1 or multiple textures must be added. The builder uses these textures as follows:
- The first texture is shown for any distance below the
nearDistance. - The last texture is shown for any distance at or above the
farDistance. - Any textures between the first and last are spaced out equally between
nearDistanceandfarDistance, and will be used as such.
This behaviour matches the Java Edition custom waypoint styles, which also allow specifying a list of textures. For convenience,
a shorthand withTexture(Identifier) method exists, which takes a texture Identifier and turns it into a texture string.
- Since:
- 2.11.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates an implementation ofCustomWaypointStyle, using the specifiednearDistanceandfarDistance, and the textures added to this builder.withTexture(String texture) Adds a new texture to thisCustomWaypointStyle.withTexture(Identifier texture) Adds a new texture to thisCustomWaypointStylein the form of a textureIdentifier.
-
Method Details
-
withTexture
Adds a new texture to thisCustomWaypointStylein the form of a textureIdentifier.This
Identifieris turned into a texture string using the following format:"ui/<namespace>/locator_bar_dot/<path>".- Parameters:
texture- the texture to add- Returns:
- this builder
- Since:
- 2.11.0
-
withTexture
Adds a new texture to thisCustomWaypointStyle.- Parameters:
texture- the texture to add- Returns:
- this builder
- Since:
- 2.11.0
-
build
CustomWaypointStyle build()Creates an implementation ofCustomWaypointStyle, using the specifiednearDistanceandfarDistance, and the textures added to this builder.- Specified by:
buildin interfaceGenericBuilder<CustomWaypointStyle>- Returns:
- the created
CustomWaypointStyle - Throws:
IllegalArgumentException- when no textures were added to this builder- Since:
- 2.11.0
-