Skip to content

Commit 8f54479

Browse files
committed
add missing translation key
1 parent 6fe526a commit 8f54479

File tree

11 files changed

+36
-17
lines changed

11 files changed

+36
-17
lines changed

1.20/src/main/java/io/github/axolotlclient/waypoints/map/Minimap.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class Minimap extends MinimapCommon {
5454

5555
private static final ResourceLocation texLocation = AxolotlClientWaypoints.rl("minimap");
5656
public static final ResourceLocation arrowLocation = AxolotlClientWaypoints.rl("textures/gui/sprites/arrow.png");
57-
private final NativeImage pixels = new NativeImage(size, size, false);
57+
private final NativeImage pixels = new NativeImage(viewDistance, viewDistance, false);
5858
public long updateDuration = -1;
5959
private DynamicTexture tex;
6060
private int mapCenterX, mapCenterZ;
@@ -122,12 +122,12 @@ public void renderMap(GuiGraphics guiGraphics) {
122122
}
123123
guiGraphics.pose().scale((float) Math.sqrt(2), (float) Math.sqrt(2), 1);
124124
guiGraphics.pose().scale(mapScale.get(), mapScale.get(), 1);
125-
guiGraphics.pose().translate(-pixels.getWidth() / 2f, -pixels.getHeight() / 2f, 0);
125+
guiGraphics.pose().translate(-radius, -radius, 0);
126126
float offX, offZ;
127127
offX = -(float) (minecraft.player.getX() - mapCenterX);
128128
offZ = -(float) (minecraft.player.getZ() - mapCenterZ);
129-
guiGraphics.pose().translate(offX / mapScale.get(), offZ / mapScale.get(), 0);
130-
guiGraphics.blit(texLocation, 0, 0, 0, 0, pixels.getWidth(), pixels.getHeight(), pixels.getWidth(), pixels.getHeight());
129+
guiGraphics.pose().translate(offX, offZ, 0);
130+
guiGraphics.blit(texLocation, 0, 0, 0, 0, pixels.getWidth(), pixels.getHeight(), size, size);
131131
guiGraphics.pose().popPose();
132132
guiGraphics.disableScissor();
133133
}

1.20/src/main/java/io/github/axolotlclient/waypoints/waypoints/WaypointRenderer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, float tick,
180180
pose.pushPose();
181181
pose.translate(0, Math.max(height, projHeight + 4) / 2f + 4, 0);
182182
var pos = pose.last().pose().transformPosition(new Vector3f());
183+
if (_3dOnScreen) {
184+
pos.y = Math.min(pos.y, displayEnd.y()+6);
185+
}
183186
positionDrawn.set(() -> {
184187
var line1 = waypoint.name();
185188
pose.pushPose();

1.21.8/src/main/java/io/github/axolotlclient/waypoints/map/Minimap.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Minimap extends MinimapCommon {
5656

5757
private static final ResourceLocation texLocation = AxolotlClientWaypoints.rl("minimap");
5858
public static final ResourceLocation arrowLocation = AxolotlClientWaypoints.rl("arrow");
59-
private final NativeImage pixels = new NativeImage(size, size, false);
59+
private final NativeImage pixels = new NativeImage(viewDistance, viewDistance, false);
6060
public long updateDuration = -1;
6161
private DynamicTexture tex;
6262
private int mapCenterX, mapCenterZ;
@@ -121,12 +121,12 @@ public void renderMap(GuiGraphics guiGraphics) {
121121
}
122122
guiGraphics.pose().scale((float) Math.sqrt(2), (float) Math.sqrt(2));
123123
guiGraphics.pose().scale(mapScale.get(), mapScale.get());
124-
guiGraphics.pose().translate(-pixels.getWidth() / 2f, -pixels.getHeight() / 2f);
124+
guiGraphics.pose().translate(-radius, -radius);
125125
float offX, offZ;
126126
offX = -(float) (minecraft.player.getX() - mapCenterX);
127127
offZ = -(float) (minecraft.player.getZ() - mapCenterZ);
128-
guiGraphics.pose().translate(offX / mapScale.get(), offZ / mapScale.get());
129-
guiGraphics.blit(RenderPipelines.GUI_TEXTURED, texLocation, 0, 0, 0, 0, pixels.getWidth(), pixels.getHeight(), pixels.getWidth(), pixels.getHeight());
128+
guiGraphics.pose().translate(offX, offZ);
129+
guiGraphics.blit(RenderPipelines.GUI_TEXTURED, texLocation, 0, 0, 0, 0, pixels.getWidth(), pixels.getHeight(), size, size);
130130
guiGraphics.pose().popMatrix();
131131
guiGraphics.disableScissor();
132132
}

1.21.8/src/main/java/io/github/axolotlclient/waypoints/waypoints/WaypointRenderer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, DeltaTracke
205205
pose.pushMatrix();
206206
pose.translate(0, Math.max(height, projHeight + 4) / 2f + 4);
207207
var pos = pose.transformPosition(new Vector2f());
208+
if (_3dOnScreen) {
209+
pos.y = Math.min(pos.y, displayEnd.y()+6);
210+
}
208211
positionDrawn.set(() -> {
209212
var line1 = waypoint.name();
210213
pose.pushMatrix();

1.21/src/main/java/io/github/axolotlclient/waypoints/map/Minimap.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class Minimap extends MinimapCommon {
5656

5757
private static final ResourceLocation texLocation = AxolotlClientWaypoints.rl("minimap");
5858
public static final ResourceLocation arrowLocation = AxolotlClientWaypoints.rl("arrow");
59-
private final NativeImage pixels = new NativeImage(size, size, false);
59+
private final NativeImage pixels = new NativeImage(viewDistance, viewDistance, false);
6060
public long updateDuration = -1;
6161
private DynamicTexture tex;
6262
private int mapCenterX, mapCenterZ;
@@ -122,11 +122,11 @@ public void renderMap(GuiGraphics guiGraphics) {
122122
}
123123
guiGraphics.pose().scale((float) Math.sqrt(2), (float) Math.sqrt(2), 1);
124124
guiGraphics.pose().scale(mapScale.get(), mapScale.get(), 1);
125-
guiGraphics.pose().translate(-pixels.getWidth() / 2f, -pixels.getHeight() / 2f, 0);
125+
guiGraphics.pose().translate(-radius, -radius, 0);
126126
float offX, offZ;
127127
offX = -(float) (minecraft.player.getX() - mapCenterX);
128128
offZ = -(float) (minecraft.player.getZ() - mapCenterZ);
129-
guiGraphics.pose().translate(offX / mapScale.get(), offZ / mapScale.get(), 0);
129+
guiGraphics.pose().translate(offX, offZ, 0);
130130
guiGraphics.blit(texLocation, 0, 0, 0, 0, pixels.getWidth(), pixels.getHeight(), pixels.getWidth(), pixels.getHeight());
131131
guiGraphics.pose().popPose();
132132
guiGraphics.disableScissor();

1.21/src/main/java/io/github/axolotlclient/waypoints/waypoints/WaypointRenderer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ private void renderWaypoint(Waypoint waypoint, GuiGraphics graphics, DeltaTracke
186186
pose.pushPose();
187187
pose.translate(0, Math.max(height, projHeight + 4) / 2f + 4, 0);
188188
var pos = pose.last().pose().transformPosition(new Vector3f());
189+
if (_3dOnScreen) {
190+
pos.y = Math.min(pos.y, displayEnd.y()+6);
191+
}
189192
positionDrawn.set(() -> {
190193
var line1 = waypoint.name();
191194
pose.pushPose();

1.8.9/src/main/java/io/github/axolotlclient/waypoints/map/Minimap.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public boolean isEnabled() {
7575
}
7676

7777
public void setup() {
78-
minecraft.getTextureManager().register(texLocation, tex = new DynamicTexture(size, size));
78+
minecraft.getTextureManager().register(texLocation, tex = new DynamicTexture(viewDistance, viewDistance));
7979
pixels = tex.getPixels();
8080
this.x = new Window(minecraft).getWidth() - size - 10;
8181
this.y = 10;
@@ -121,13 +121,13 @@ public void renderMap() {
121121
}
122122
GlStateManager.scalef((float) Math.sqrt(2), (float) Math.sqrt(2), 1);
123123
GlStateManager.scalef(mapScale.get(), mapScale.get(), 1);
124-
GlStateManager.translatef(-size / 2f, -size / 2f, 0);
124+
GlStateManager.translatef(-radius, -radius, 0);
125125
float offX, offZ;
126126
offX = -(float) (minecraft.player.x - mapCenterX);
127127
offZ = -(float) (minecraft.player.z - mapCenterZ);
128-
GlStateManager.translatef(offX / mapScale.get(), offZ / mapScale.get(), 0);
128+
GlStateManager.translatef(offX, offZ, 0);
129129
minecraft.getTextureManager().bind(texLocation);
130-
GuiElement.drawTexture(0, 0, 0, 0, size, size, size, size);
130+
GuiElement.drawTexture(0, 0, 0, 0, viewDistance, viewDistance, size, size);
131131
GlStateManager.popMatrix();
132132
DrawUtil.popScissor();
133133
}

1.8.9/src/main/java/io/github/axolotlclient/waypoints/waypoints/WaypointRenderer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@ private void renderWaypoint(Waypoint waypoint, float tick, Entity camera, Atomic
209209
GlStateManager.pushMatrix();
210210
GlStateManager.translatef(result.x(), result.y(), 0);
211211
GlStateManager.translatef(0, Math.max(height, projHeight + 4) / 2f + 4, 0);
212+
if (_3dOnScreen) {
213+
float y = result.y()+Math.max(height, projHeight + 4) / 2f + 4;
214+
var y2 = Math.min(y, displayEnd.y()+6);
215+
GlStateManager.translatef(0, y2-y, 0);
216+
}
212217
int line1W = minecraft.textRenderer.getWidth(line1);
213218
GuiElement.fill(-line1W / 2 - 2, -2, line1W / 2 + 2, minecraft.textRenderer.fontHeight + 2, Colors.GRAY.withAlpha(100).toInt());
214219
DrawUtil.outlineRect(-line1W / 2 - 2, -2, line1W + 4, minecraft.textRenderer.fontHeight + 4, Colors.GRAY.toInt());

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### 0.0.1-beta.8
44

55
- Fix Minimap Hud scaling
6+
- Fix a few other bugs
7+
- Add missing translation key
68

79
### 0.0.1-beta.7
810

common/src/main/java/io/github/axolotlclient/waypoints/map/MinimapCommon.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
import lombok.Setter;
3333

3434
public abstract class MinimapCommon {
35-
public final int radius = 64, size = radius * 2;
35+
public final int radius = 64,
36+
size = radius * 2;
37+
public final int viewDistance = 128;
3638
@Getter
3739
@Setter
3840
protected int x,y;

0 commit comments

Comments
 (0)