Skip to content

Commit 255708f

Browse files
committed
Better Map Arrow
1 parent 17c1ce7 commit 255708f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/main/java/dev/xpple/seedmapper/seedmap/SeedMapScreen.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,23 +1211,24 @@ protected void renderSeedMap(GuiGraphics guiGraphics, int mouseX, int mouseY, fl
12111211
int playerMaxX = playerMinX + 20;
12121212
int playerMaxY = playerMinY + 20;
12131213
if (playerMinX >= HORIZONTAL_PADDING && playerMaxX <= HORIZONTAL_PADDING + this.seedMapWidth && playerMinY >= VERTICAL_PADDING && playerMaxY <= VERTICAL_PADDING + this.seedMapHeight) {
1214-
PlayerFaceRenderer.draw(guiGraphics, this.minecraft.player.getSkin(), playerMinX, playerMinY, 20);
1214+
PlayerFaceRenderer.draw(guiGraphics, this.minecraft.player.getSkin(), playerMinX, playerMinY, 16);
12151215

1216-
// draw player direction arrow
1216+
// draw player direction arrow (smaller and slightly closer)
12171217
guiGraphics.pose().pushMatrix();
12181218
Matrix3x2f transform = guiGraphics.pose() // transformations are applied in reverse order
1219-
.translate(10, 10)
1219+
.translate(8, 8)
12201220
.translate(playerMinX, playerMinY)
12211221
.rotate((float) (Math.toRadians(this.playerRotation.y) + Math.PI))
1222-
.translate(-10, -10)
1223-
.translate(0, -30)
1222+
.translate(-8, -8)
1223+
// move the arrow closer to the player icon (was -30)
1224+
.translate(0, -18)
12241225
;
1225-
boolean withinBounds = Stream.of(new Vector2f(20, 0), new Vector2f(20, 20), new Vector2f(0, 20), new Vector2f(0, 0))
1226+
boolean withinBounds = Stream.of(new Vector2f(16, 0), new Vector2f(16, 16), new Vector2f(0, 16), new Vector2f(0, 0))
12261227
.map(transform::transformPosition)
12271228
.allMatch(v -> v.x >= HORIZONTAL_PADDING && v.x <= HORIZONTAL_PADDING + this.seedMapWidth &&
12281229
v.y >= VERTICAL_PADDING && v.y <= VERTICAL_PADDING + this.seedMapHeight);
12291230
if (withinBounds) {
1230-
drawIcon(guiGraphics, DIRECTION_ARROW_TEXTURE, 0, 0, 20, 20, 0xFF_FFFFFF);
1231+
drawIcon(guiGraphics, DIRECTION_ARROW_TEXTURE, 0, 0, 16, 16, 0xFF_FFFFFF);
12311232
}
12321233
guiGraphics.pose().popMatrix();
12331234
}
2.32 KB
Loading

0 commit comments

Comments
 (0)