Some more waypoint style wiki and other small things
This commit is contained in:
3 files changed
+15
-7
No files matched your search
@@ -12,5 +12,5 @@ Geyser supports custom resource packs for use with custom items, blocks, and sku
|
|||||||
|
|
||||||
:::info
|
:::info
|
||||||
Geyser does not convert resource packs from Java Edition automatically.
|
Geyser does not convert resource packs from Java Edition automatically.
|
||||||
However, you can use automatic tools such as [Rainbow](/wiki/other/rainbow/) to make converting content simpler.
|
However, you can use automatic tools such as [Rainbow](/wiki/other/rainbow/) or [Thunder](/wiki/other/thunder) to make converting content simpler.
|
||||||
:::
|
:::
|
||||||
@@ -85,7 +85,7 @@ the same format as Java's custom waypoint styles and should feel very familiar.
|
|||||||
Since namespaces do not exist in Bedrock Edition's resource packs, Geyser must flatten the texture sprite identifier
|
Since namespaces do not exist in Bedrock Edition's resource packs, Geyser must flatten the texture sprite identifier
|
||||||
to be used in the resource pack on Bedrock Edition. Geyser does this using the following format:
|
to be used in the resource pack on Bedrock Edition. Geyser does this using the following format:
|
||||||
|
|
||||||
> `textures/ui/<namespace&rt;/locator_bar_dot/<path&rt;`
|
> `textures/ui/<namespace>/locator_bar_dot/<path>`
|
||||||
|
|
||||||
As such, in the example above, the `geyser:my_first_waypoint` waypoint style refers to the following textures in the Bedrock resource pack:
|
As such, in the example above, the `geyser:my_first_waypoint` waypoint style refers to the following textures in the Bedrock resource pack:
|
||||||
|
|
||||||
@@ -101,6 +101,9 @@ the same format as Java's custom waypoint styles and should feel very familiar.
|
|||||||
and as such you can check the `GeyserConnection` before registering a custom waypoint style. If a custom waypoint
|
and as such you can check the `GeyserConnection` before registering a custom waypoint style. If a custom waypoint
|
||||||
style is used across multiple connections, it can be useful to only create it once to save memory.
|
style is used across multiple connections, it can be useful to only create it once to save memory.
|
||||||
|
|
||||||
|
`VanillaBuilder` instances are created by using `CustomWaypointStyle#vanillaLike(int nearDistance, int farDistance)`.
|
||||||
|
When not specifying a near- and far-distance, the Java defaults of 128 and 332 are used.
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onSessionDefineCustomWaypoints(SessionDefineCustomWaypointsEvent event) {
|
public void onSessionDefineCustomWaypoints(SessionDefineCustomWaypointsEvent event) {
|
||||||
@@ -109,7 +112,7 @@ the same format as Java's custom waypoint styles and should feel very familiar.
|
|||||||
.withTexture(Identifier.of("geyser:custom_waypoint_1"))
|
.withTexture(Identifier.of("geyser:custom_waypoint_1"))
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
event.register(Identifier.of("geyser:my_second_waypoint"), CustomWaypointStyle.vanillaLike(128, 332)
|
event.register(Identifier.of("geyser:my_second_waypoint"), CustomWaypointStyle.vanillaLike()
|
||||||
.withTexture(Identifier.of("geyser:second_waypoint/texture_1"))
|
.withTexture(Identifier.of("geyser:second_waypoint/texture_1"))
|
||||||
.withTexture(Identifier.of("geyser:second_waypoint/texture_2"))
|
.withTexture(Identifier.of("geyser:second_waypoint/texture_2"))
|
||||||
.withTexture(Identifier.of("geyser:second_waypoint/texture_3"))
|
.withTexture(Identifier.of("geyser:second_waypoint/texture_3"))
|
||||||
@@ -125,7 +128,7 @@ the same format as Java's custom waypoint styles and should feel very familiar.
|
|||||||
|
|
||||||
As with JSON mappings, Geyser flattens the texture identifier into a string using the following format:
|
As with JSON mappings, Geyser flattens the texture identifier into a string using the following format:
|
||||||
|
|
||||||
> `textures/ui/<namespace&rt;/locator_bar_dot/<path&rt;`
|
> `textures/ui/<namespace>/locator_bar_dot/<path>`
|
||||||
|
|
||||||
However, you can also pass a literal texture string to `withTexture`. This string must not be prefixed with
|
However, you can also pass a literal texture string to `withTexture`. This string must not be prefixed with
|
||||||
`textures/` and must also not be suffixed with the texture extension (e.g. `.png`).
|
`textures/` and must also not be suffixed with the texture extension (e.g. `.png`).
|
||||||
@@ -179,7 +182,6 @@ the same format as Java's custom waypoint styles and should feel very familiar.
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
## Advanced icons
|
## Advanced icons
|
||||||
|
|
||||||
Geyser API users may write custom implementations of `CustomWaypointStyle`, to run custom checks for waypoint textures
|
Geyser API users may write custom implementations of `CustomWaypointStyle`, to run custom checks for waypoint textures
|
||||||
@@ -206,7 +208,12 @@ public final class MyCustomWaypointStyle implements CustomWaypointStyle {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
It can then be registered through the `SessionDefineCustomWaypointsEvent` as follows:
|
Implementations must always implement `texturePath(Identifier, float)` and `textureSize(Identifier, float)`. The first
|
||||||
|
returns the texture path to use for that waypoint style and distance (not prefixed with `textures/`), and the second
|
||||||
|
returns the size of the texture to use (where a size of `[1, 1]` is the size icons normally appear as when the waypoint
|
||||||
|
is close to the player).
|
||||||
|
|
||||||
|
Implementations can then be registered through the `SessionDefineCustomWaypointsEvent` as follows:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ However, many things that are possible with add-ons or behavior packs can be don
|
|||||||
or [custom blocks](/wiki/geyser/custom-blocks).
|
or [custom blocks](/wiki/geyser/custom-blocks).
|
||||||
|
|
||||||
- **Does Geyser convert Java edition resource packs?** <br />
|
- **Does Geyser convert Java edition resource packs?** <br />
|
||||||
Not currently. For now, you need to manually create a Bedrock edition resource pack equivalent.
|
Not currently. For now, you need to manually create a Bedrock edition resource pack equivalent. You can however
|
||||||
|
use automatic tools such as [Rainbow](/wiki/other/rainbow/) or [Thunder](/wiki/other/thunder) to make converting content simpler.
|
||||||
|
|
||||||
- **Can I allow players to choose resource packs themselves?** <br />
|
- **Can I allow players to choose resource packs themselves?** <br />
|
||||||
On most Bedrock platforms (except consoles), players are able to download and install resource packs on the client.
|
On most Bedrock platforms (except consoles), players are able to download and install resource packs on the client.
|
||||||
|
|||||||
Reference in new issue
Block a user