mirror of
https://git.webmc.xyz/Starlike-Client/Starlike-Client
synced 2025-06-05 18:32:01 -09:00
geepeetee saved me
This commit is contained in:
parent
a2073df120
commit
18d17c3969
@ -1340,24 +1340,19 @@ public class GuiIngame extends Gui {
|
||||
|
||||
int compassSize = 40;
|
||||
|
||||
// Calculate the position based on the screen dimensions and the compass size
|
||||
int x = screenWidth - compassSize - 10; // 10px from the right edge
|
||||
int y = screenHeight - compassSize - 10; // 10px from the bottom edge
|
||||
int x = screenWidth - compassSize - 10;
|
||||
int y = screenHeight - compassSize - 10;
|
||||
|
||||
// Draw the background rectangle for the compass
|
||||
drawRect(x, y, x + compassSize, y + compassSize, 0x80000000);
|
||||
|
||||
// Calculate the center position of the compass
|
||||
int centerX = x + compassSize / 2;
|
||||
int centerY = y + compassSize / 2;
|
||||
|
||||
// Draw the cardinal directions at their correct positions
|
||||
mc.fontRendererObj.drawStringWithShadow("N", centerX - 3, y + 2, 0xFFFFFF);
|
||||
mc.fontRendererObj.drawStringWithShadow("S", centerX - 3, y + compassSize - 10, 0xFFFFFF);
|
||||
mc.fontRendererObj.drawStringWithShadow("E", x + compassSize - 10, centerY - 3, 0xFFFFFF);
|
||||
mc.fontRendererObj.drawStringWithShadow("W", x + 2, centerY - 3, 0xFFFFFF);
|
||||
|
||||
// Draw the rotating needle
|
||||
drawRotatingNeedle(centerX, centerY, yaw, compassSize);
|
||||
}
|
||||
private void drawRotatingNeedle(int x, int y, float angle, int compassSize) {
|
||||
@ -1367,18 +1362,14 @@ public class GuiIngame extends Gui {
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
// Move to the center of the compass
|
||||
GlStateManager.translate(x, y, 0);
|
||||
|
||||
// Adjust yaw to correctly rotate the needle: OpenGL rotates clockwise, Minecraft counterclockwise
|
||||
GlStateManager.rotate(angle, 0, 0, 1); // Rotate by the player's yaw (in reverse direction)
|
||||
GlStateManager.rotate(angle, 0, 0, 1);
|
||||
|
||||
// Calculate the needle size and adjust the drawing position
|
||||
int needleSize = 20; // Adjust for image size
|
||||
int needleSize = 20;
|
||||
int offsetX = -needleSize / 2;
|
||||
int offsetY = -needleSize / 2;
|
||||
|
||||
// Draw the needle at the correct position
|
||||
drawModalRectWithCustomSizedTexture(offsetX, offsetY, 0, 0, needleSize, needleSize, needleSize, needleSize);
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
Loading…
x
Reference in New Issue
Block a user