Interface CustomWaypointStyle
Identifier in a resourcepack,
and Bedrock Edition allows specifying custom textures for waypoints through packets.
This interface may be implemented by developers if they wish to display custom textures on the locator
bar on Bedrock Edition. Implementations must always implement both texturePath(Identifier, float) and
textureSize(Identifier, float), and should be registered for one or more waypoint style identifiers
in the SessionDefineCustomWaypointsEvent. For implementation details, see the Javadocs at the respective methods.
If you wish to define a custom waypoint style that acts like custom waypoint styles on Java Edition, use vanillaLike(int, int).
- Since:
- 2.11.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThis builder can be used to create an implementation ofCustomWaypointStylethat acts like the vanilla Java Edition custom waypoint styles. -
Method Summary
Modifier and TypeMethodDescriptiontexturePath(Identifier style, float distance) Returns the path of the texture to display on the locator bar for a waypoint with thisstyleidentifier, at the specifieddistance.org.cloudburstmc.math.vector.Vector2ftextureSize(Identifier style, float distance) Returns the size of the texture to display on the locator bar for a waypoint with thisstyleidentifier, at the specifieddistance.Creates a newCustomWaypointStyle.VanillaBuilderwith the default values of128fornearDistanceand332forfar.vanillaLike(@org.checkerframework.checker.index.qual.NonNegative int nearDistance, @org.checkerframework.checker.index.qual.Positive int farDistance) Creates a newCustomWaypointStyle.VanillaBuilderwith the givennearDistanceandfarDistancevalues.
-
Method Details
-
texturePath
Returns the path of the texture to display on the locator bar for a waypoint with thisstyleidentifier, at the specifieddistance. This method will be called whenever the position of a waypoint changes.Please note that the
distanceparameter may not represent an accurate distance between the waypoint and the player:- For
coordinatewaypoints, the accuracy will be within 1 block. - For
chunkwaypoints, the accuracy will be within 8 blocks. - For
azimuthwaypoints, the distance is fixed atInteger.MAX_VALUE.
- Parameters:
style- theIdentifierof the waypoint's custom style on Java Editiondistance- the distance between theGeyserConnectionand the waypoint- Returns:
- the path of the texture to display on the locator bar
- Since:
- 2.11.0
- See Also:
- For
-
textureSize
Returns the size of the texture to display on the locator bar for a waypoint with thisstyleidentifier, at the specifieddistance. This method will be called whenever the position of a waypoint changes.Please note that the
distanceparameter may not represent an accurate distance between the waypoint and the player:- For
coordinatewaypoints, the accuracy will be within 1 block. - For
chunkwaypoints, the accuracy will be within 8 blocks. - For
azimuthwaypoints, the distance is fixed atInteger.MAX_VALUE.
- Parameters:
style- theIdentifierof the waypoint's custom style on Java Editiondistance- the distance between theGeyserConnectionand the waypoint- Returns:
- the size of the texture to display on the locator bar
- Since:
- 2.11.0
- See Also:
- For
-
vanillaLike
static CustomWaypointStyle.VanillaBuilder vanillaLike(@org.checkerframework.checker.index.qual.NonNegative int nearDistance, @org.checkerframework.checker.index.qual.Positive int farDistance) Creates a newCustomWaypointStyle.VanillaBuilderwith the givennearDistanceandfarDistancevalues.In Java Edition, the default value for
nearDistanceis128, and forfarDistanceis332.Please see
CustomWaypointStyle.VanillaBuilderfor a throughout description ofCustomWaypointStyle.VanillaBuilders and thenearDistanceandfarDistancevalues.- Parameters:
nearDistance- the nearDistance to be usedfarDistance- the farDistance to be used- Returns:
- the created
CustomWaypointStyle.VanillaBuilder - Throws:
IllegalArgumentException- when thenearDistanceis below 0, or at or above thefarDistance- Since:
- 2.11.0
- See Also:
-
vanillaLike
Creates a newCustomWaypointStyle.VanillaBuilderwith the default values of128fornearDistanceand332forfar.Please see
CustomWaypointStyle.VanillaBuilderfor a throughout description ofCustomWaypointStyle.VanillaBuilders and thenearDistanceandfarDistancevalues.- Returns:
- the created
CustomWaypointStyle.VanillaBuilder - Throws:
IllegalArgumentException- when thenearDistanceis below 0, or at or above thefarDistance- Since:
- 2.11.0
- See Also:
-