mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 09:44:24 +00:00
Draw players as facing arrows on the map
The studio map showed players as plain dots. A blue arrow with a white edge and dark outline now points where the player looks, with the name in a pill above, readable on any terrain. Markers carry a yaw (rounded to 5 degrees so head turns do not flood the players event); entities keep their dot. v3: 3914c4667
This commit is contained in:
1 parent
76dcab175b
commit
d28b9d13cc
8 files changed
+174
-25
No files matched your search
@@ -18,12 +18,18 @@
|
||||
|
||||
package art.arcane.iris.core.gui;
|
||||
|
||||
public record GuiMarker(String label, double worldX, double worldY, double worldZ, double health, double maxHealth) {
|
||||
public static GuiMarker player(String name, double worldX, double worldZ) {
|
||||
return new GuiMarker(name, worldX, 0, worldZ, 0, 0);
|
||||
/**
|
||||
* @param yaw the way it faces, in Minecraft's degrees: 0 is south, 90 is west
|
||||
*/
|
||||
public record GuiMarker(String label, double worldX, double worldY, double worldZ, float yaw, double health, double maxHealth) {
|
||||
static final float YAW_STEP_DEGREES = 5F;
|
||||
|
||||
/** The yaw is rounded to {@link #YAW_STEP_DEGREES}, so a turning head does not resend the player every poll. */
|
||||
public static GuiMarker player(String name, double worldX, double worldZ, float yaw) {
|
||||
return new GuiMarker(name, worldX, 0, worldZ, Math.round(yaw / YAW_STEP_DEGREES) * YAW_STEP_DEGREES, 0, 0);
|
||||
}
|
||||
|
||||
public static GuiMarker entity(String label, double worldX, double worldY, double worldZ, double health, double maxHealth) {
|
||||
return new GuiMarker(label, worldX, worldY, worldZ, health, maxHealth);
|
||||
return new GuiMarker(label, worldX, worldY, worldZ, 0F, health, maxHealth);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user