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:
piexel committed 2026-11-10 11:26:49 +01:00
1 parent 76dcab175b
commit d28b9d13cc
8 files changed
+174 -25

No files matched your search

@@ -0,0 +1,44 @@
/*
* Iris is a World Generator for Minecraft Servers
* Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package art.arcane.iris.core.gui;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class GuiMarkerTest {
private static final float EXACT = 0F;
@Test
public void playerYawIsRoundedToTheStep() {
assertEquals(90F, GuiMarker.player("a", 0, 0, 91.4F).yaw(), EXACT);
assertEquals(95F, GuiMarker.player("a", 0, 0, 92.6F).yaw(), EXACT);
assertEquals(-45F, GuiMarker.player("a", 0, 0, -44F).yaw(), EXACT);
}
@Test
public void nearbyYawsCompareEqualSoTurningSlightlyResendsNothing() {
assertEquals(GuiMarker.player("a", 1, 2, 180.2F), GuiMarker.player("a", 1, 2, 181.9F));
}
@Test
public void entitiesHaveNoFacing() {
assertEquals(0F, GuiMarker.entity("zombie", 0, 64, 0, 20, 20).yaw(), EXACT);
}
}