From 67e15e72fee3a78b10361b200dcf5d7e119af79c Mon Sep 17 00:00:00 2001 From: Boxadactle Date: Sun, 27 Oct 2024 14:36:15 -0700 Subject: [PATCH] add compass rendering --- CHANGELOG.md | 7 +- .../coordinatesdisplay/Bindings.java | 9 +++ .../coordinatesdisplay/CompassRenderer3D.java | 64 +++++++++++++++++++ .../CoordinatesDisplay.java | 4 ++ .../coordinatesdisplay/ModConfig.java | 2 + .../command/CoordinatesCommand.java | 13 ++++ .../hud/renderer/DirectionRenderer.java | 6 ++ .../screen/ConfigScreen.java | 7 ++ .../assets/coordinatesdisplay/lang/en_us.json | 6 +- .../assets/coordinatesdisplay/lang/es_es.json | 6 +- .../assets/coordinatesdisplay/lang/ja_jp.json | 6 +- .../assets/coordinatesdisplay/lang/ko_kr.json | 6 +- .../assets/coordinatesdisplay/lang/ru_ru.json | 6 +- .../assets/coordinatesdisplay/lang/uk_ua.json | 6 +- .../assets/coordinatesdisplay/lang/zh_tw.json | 6 +- .../fabric/CoordinatesDisplayFabric.java | 1 + .../forge/CoordinatesDisplayForge.java | 1 + gradle.properties | 4 +- .../neoforge/CoordinatesDisplayNeoforge.java | 1 + 19 files changed, 151 insertions(+), 10 deletions(-) create mode 100644 common/src/main/java/dev/boxadactle/coordinatesdisplay/CompassRenderer3D.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d17b8..0ff4c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,7 @@ ## Changes -- Added forge support \ No newline at end of file +- Added 3d compass rendering to config gui +- Added toggle3dCompass subcommand +- Added 3d compass toggle keybind + +## New Features +- It is now possible to render a 3d compass client-side in the world \ No newline at end of file diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/Bindings.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/Bindings.java index d85b8e3..e7392d6 100644 --- a/common/src/main/java/dev/boxadactle/coordinatesdisplay/Bindings.java +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/Bindings.java @@ -24,6 +24,8 @@ public class Bindings { public static final KeyMapping changeHudPosition = new KeyMapping("key.coordinatesdisplay.changeHudPos", GLFW.GLFW_KEY_F9, "category.coordinatesdisplay"); public static final KeyMapping cycleDisplayMode = new KeyMapping("key.coordinatesdisplay.cycleDisplayMode", GLFW.GLFW_KEY_M, "category.coordinatesdisplay"); + public static final KeyMapping toggle3DCompass = new KeyMapping("key.coordinatesdisplay.toggle3DCompass", GLFW.GLFW_KEY_F8, "category.coordinatesdisplay"); + public static void toggleHud() { CoordinatesDisplay.LOGGER.info("Toggling HUD visibility"); CoordinatesDisplay.CONFIG.get().enabled = !CoordinatesDisplay.CONFIG.get().enabled; @@ -61,6 +63,11 @@ public static void cycleDisplayMode() { CoordinatesDisplay.CONFIG.save(); } + + public static void toggle3DCompass() { + CoordinatesDisplay.getConfig().render3dCompass = !CoordinatesDisplay.getConfig().render3dCompass; + CoordinatesDisplay.CONFIG.save(); + } public static void checkBindings(Position pos) { if (hudEnabled.consumeClick()) toggleHud(); @@ -76,6 +83,8 @@ public static void checkBindings(Position pos) { if (changeHudPosition.consumeClick()) openHudPositionGui(); if (cycleDisplayMode.consumeClick()) cycleDisplayMode(); + + if (toggle3DCompass.consumeClick()) toggle3DCompass(); } } diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/CompassRenderer3D.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/CompassRenderer3D.java new file mode 100644 index 0000000..18c1abc --- /dev/null +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/CompassRenderer3D.java @@ -0,0 +1,64 @@ +package dev.boxadactle.coordinatesdisplay; + +import com.mojang.blaze3d.vertex.PoseStack; +import dev.boxadactle.boxlib.math.geometry.Vec3; +import dev.boxadactle.boxlib.rendering.Renderer3D; +import dev.boxadactle.boxlib.rendering.renderers.TextRenderer; +import dev.boxadactle.boxlib.util.ClientUtils; +import dev.boxadactle.boxlib.util.GuiUtils; +import dev.boxadactle.boxlib.util.WorldUtils; +import net.minecraft.client.Camera; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.network.chat.Component; + +public class CompassRenderer3D extends Renderer3D { + public CompassRenderer3D() { + super(false); + } + + @Override + public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, double v, double v1, double v2) { + if (WorldUtils.getCamera() != null && CoordinatesDisplay.getConfig().render3dCompass) { + float size = 0.15f; + + Camera camera = ClientUtils.getClient().gameRenderer.getMainCamera(); + net.minecraft.world.phys.Vec3 cameraPos = camera.getPosition(); + + TextRenderer north = new TextRenderer(false) + .setPos(new Vec3<>(cameraPos.x, cameraPos.y + 1.0, cameraPos.z - 10.0)) + .setText(Component.literal("N")) + .setSize(size) + .setColor(GuiUtils.RED) + .setCentered(true) + .setXray(true); + north.render(poseStack, multiBufferSource, v, v1, v2); + + TextRenderer east = new TextRenderer(false) + .setPos(new Vec3<>(cameraPos.x + 10.0, cameraPos.y + 1.0, cameraPos.z)) + .setText(Component.literal("E")) + .setSize(size) + .setColor(GuiUtils.GREEN) + .setCentered(true) + .setXray(true); + east.render(poseStack, multiBufferSource, v, v1, v2); + + TextRenderer south = new TextRenderer(false) + .setPos(new Vec3<>(cameraPos.x, cameraPos.y + 1.0, cameraPos.z + 10.0)) + .setText(Component.literal("S")) + .setSize(size) + .setColor(GuiUtils.YELLOW) + .setCentered(true) + .setXray(true); + south.render(poseStack, multiBufferSource, v, v1, v2); + + TextRenderer west = new TextRenderer(false) + .setPos(new Vec3<>(cameraPos.x - 10.0, cameraPos.y + 1.0, cameraPos.z)) + .setText(Component.literal("W")) + .setSize(size) + .setColor(GuiUtils.WHITE) + .setCentered(true) + .setXray(true); + west.render(poseStack, multiBufferSource, v, v1, v2); + } + } +} diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/CoordinatesDisplay.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/CoordinatesDisplay.java index 1034ea0..70cf0ba 100644 --- a/common/src/main/java/dev/boxadactle/coordinatesdisplay/CoordinatesDisplay.java +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/CoordinatesDisplay.java @@ -3,6 +3,7 @@ import dev.boxadactle.boxlib.command.BCommandManager; import dev.boxadactle.boxlib.config.BConfigClass; import dev.boxadactle.boxlib.config.BConfigHandler; +import dev.boxadactle.boxlib.rendering.RenderQueue; import dev.boxadactle.boxlib.util.ModLogger; import dev.boxadactle.coordinatesdisplay.command.CoordinatesCommand; import dev.boxadactle.coordinatesdisplay.hud.Hud; @@ -48,6 +49,9 @@ public static void init() { // initialize HUD HUD = new Hud(); + + // register 3d compass renderer + RenderQueue.addRenderer(new CompassRenderer3D()); } public static ModConfig getConfig() { diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/ModConfig.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/ModConfig.java index 1f68c72..a384a01 100644 --- a/common/src/main/java/dev/boxadactle/coordinatesdisplay/ModConfig.java +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/ModConfig.java @@ -48,6 +48,8 @@ public class ModConfig implements BConfig { public boolean includeDecimalsWhenCopying = true; public TeleportMode teleportMode = TeleportMode.EXECUTE; + public boolean render3dCompass = false; + public static void checkValidity(ModConfig config) throws NullPointerException { Class clazz = config.getClass(); diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/command/CoordinatesCommand.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/command/CoordinatesCommand.java index eef089a..f72c5c0 100644 --- a/common/src/main/java/dev/boxadactle/coordinatesdisplay/command/CoordinatesCommand.java +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/command/CoordinatesCommand.java @@ -6,17 +6,21 @@ import dev.boxadactle.boxlib.command.api.subcommand.BasicSubcommand; import dev.boxadactle.boxlib.scheduling.Scheduling; import dev.boxadactle.boxlib.util.ClientUtils; +import dev.boxadactle.boxlib.util.GuiUtils; import dev.boxadactle.boxlib.util.WorldUtils; +import dev.boxadactle.coordinatesdisplay.Bindings; import dev.boxadactle.coordinatesdisplay.CoordinatesDisplay; import dev.boxadactle.coordinatesdisplay.position.Position; import dev.boxadactle.coordinatesdisplay.screen.CoordinatesScreen; import dev.boxadactle.coordinatesdisplay.screen.config.PositionScreen; import net.minecraft.client.resources.language.I18n; +import net.minecraft.network.chat.Component; public class CoordinatesCommand { public static BCommand createCommand() { return BCommand.create("coordinates", CoordinatesCommand::openCoordinatesScreen) + .registerSubcommand(new BasicSubcommand("toggle3dCompass", CoordinatesCommand::toggleCompass)) .registerSubcommand(ToggleSubcommand.create()) .registerSubcommand(MoveHudSubcommand.create()) .registerSubcommand(ConfigSubcommand.create()) @@ -39,4 +43,13 @@ static int noArgs(CommandContext ignored) { return 1; } + static int toggleCompass(CommandContext ignored) { + Bindings.toggle3DCompass(); + + String message = CoordinatesDisplay.CONFIG.get().render3dCompass ? GuiUtils.ON.getString() : GuiUtils.OFF.getString(); + CoordinatesDisplay.LOGGER.player.info(I18n.get("command.coordinatesdisplay.toggle3dCompass", message)); + + return 0; + } + } diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/hud/renderer/DirectionRenderer.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/hud/renderer/DirectionRenderer.java index 98af12c..6b0bd11 100644 --- a/common/src/main/java/dev/boxadactle/coordinatesdisplay/hud/renderer/DirectionRenderer.java +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/hud/renderer/DirectionRenderer.java @@ -8,6 +8,7 @@ import dev.boxadactle.boxlib.layouts.layout.RowLayout; import dev.boxadactle.boxlib.math.geometry.Vec3; import dev.boxadactle.boxlib.math.mathutils.NumberFormatter; +import dev.boxadactle.boxlib.util.GuiUtils; import dev.boxadactle.coordinatesdisplay.CoordinatesDisplay; import dev.boxadactle.coordinatesdisplay.ModUtil; import dev.boxadactle.coordinatesdisplay.hud.HudDisplayMode; @@ -145,6 +146,11 @@ public RenderingLayout renderOverlay(int x, int y, Position pos) { direction.add(pitchText); } + direction.add((definition( + "rendering3d", + value(config().render3dCompass ? GuiUtils.ON : GuiUtils.OFF) + ))); + hud.addComponent(direction); return new PaddingLayout(x, y, config().padding, hud); diff --git a/common/src/main/java/dev/boxadactle/coordinatesdisplay/screen/ConfigScreen.java b/common/src/main/java/dev/boxadactle/coordinatesdisplay/screen/ConfigScreen.java index 3a6ece8..c17e3f7 100644 --- a/common/src/main/java/dev/boxadactle/coordinatesdisplay/screen/ConfigScreen.java +++ b/common/src/main/java/dev/boxadactle/coordinatesdisplay/screen/ConfigScreen.java @@ -97,6 +97,13 @@ protected void initConfigButtons() { TextScreen::new )); + // 3d compass + addConfigLine(new BBooleanButton( + "button.coordinatesdisplay.3dcompass", + CoordinatesDisplay.getConfig().render3dCompass, + (val) -> CoordinatesDisplay.getConfig().render3dCompass = val + )); + this.addConfigLine(new BSpacingEntry()); this.addConfigLine(new BCustomButton(Component.translatable("button.coordinatesdisplay.configfile")) { diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/en_us.json b/common/src/main/resources/assets/coordinatesdisplay/lang/en_us.json index f5cdd90..daa24be 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/en_us.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/en_us.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "Copy Current Position as /tp command", "key.coordinatesdisplay.changeHudPos": "Change HUD Position", "key.coordinatesdisplay.cycleDisplayMode": "Cycle Display Mode (hold shift to go back)", + "key.coordinatesdisplay.toggle3DCompass": "Toggle 3D Compass Rendering", "category.coordinatesdisplay": "Coordinates Display", "hud.coordinatesdisplay.north": "North", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "Pitch: %s (%s)", "hud.coordinatesdisplay.direction.positive": "positive %s", "hud.coordinatesdisplay.direction.negative": "negative %s", + "hud.coordinatesdisplay.direction.rendering3d": "3D Compass: %s", "hud.coordinatesdisplay.chunk": "Chunk", "hud.coordinatesdisplay.chunk.position": "Position", @@ -109,6 +111,7 @@ "button.coordinatesdisplay.colorconfig": "Colors...", "button.coordinatesdisplay.deathpos": "Death Position...", "button.coordinatesdisplay.text": "Text Settings...", + "button.coordinatesdisplay.3dcompass": "Render 3D Compass: %s", "button.coordinatesdisplay.visibility": "Visibility: %s", "button.coordinatesdisplay.decimalPlaces": "Decimal Places: %s", "button.coordinatesdisplay.decimalPlaces.block_pos": "block pos", @@ -184,5 +187,6 @@ "command.coordinatesdisplay.config.open.success": "Successfully opened config file", "command.coordinatesdisplay.config.open.fail": "Could not open config file", "command.coordinatesdisplay.movehud.fail": "No Y value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "3D Compass rendering: %s" } \ No newline at end of file diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/es_es.json b/common/src/main/resources/assets/coordinatesdisplay/lang/es_es.json index 562a3bb..c2b30ae 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/es_es.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/es_es.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "Copiar la posición actual como /tp", "key.coordinatesdisplay.changeHudPos": "Cambiar la posición del HUD", "key.coordinatesdisplay.cycleDisplayMode": "Ciclar el modo renderizado (presionar shift para retroceder)", + "key.coordinatesdisplay.toggle3DCompass": "Activar/desactivar el renderizado de la brújula 3D", "category.coordinatesdisplay": "Coordinates Display", "hud.coordinatesdisplay.north": "Norte", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "Pitch: %s (%s)", "hud.coordinatesdisplay.direction.positive": "%s positivo", "hud.coordinatesdisplay.direction.negative": "%s negativo", + "hud.coordinatesdisplay.direction.rendering3d": "Brújula 3D: %s", "hud.coordinatesdisplay.chunk": "Pieza", "hud.coordinatesdisplay.chunk.position": "Posición", @@ -109,6 +111,7 @@ "button.coordinatesdisplay.colorconfig": "Colores...", "button.coordinatesdisplay.deathpos": "Posición de muerte...", "button.coordinatesdisplay.text": "Ajustes de texto...", + "button.coordinatesdisplay.3dcompass": "Renderizar la brújula 3D: %s", "button.coordinatesdisplay.visibility": "Visibilidad: %s", "button.coordinatesdisplay.decimalPlaces": "Cantidad de decimales: %s", "button.coordinatesdisplay.decimalPlaces.block_pos": "posición de bloque", @@ -184,5 +187,6 @@ "command.coordinatesdisplay.config.open.success": "Abrió el archivo de configuración con éxito.", "command.coordinatesdisplay.config.open.fail": "No se pudo abrir el archivo de configuración.", "command.coordinatesdisplay.movehud.fail": "No Z value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "Brújula 3D: %s" } \ No newline at end of file diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/ja_jp.json b/common/src/main/resources/assets/coordinatesdisplay/lang/ja_jp.json index 95455f8..47a129e 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/ja_jp.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/ja_jp.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "/tpコマンドとして現在の位置をコピー", "key.coordinatesdisplay.changeHudPos": "HUDの位置を変更", "key.coordinatesdisplay.cycleDisplayMode": "表示モードを切り替える(戻るにはShiftを押してください)", + "key.coordinatesdisplay.toggle3DCompass": "Toggle 3D Compass Rendering", "category.coordinatesdisplay": "Coordinates Display", "hud.coordinatesdisplay.north": "北", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "Pitch: %s (%s)", "hud.coordinatesdisplay.direction.positive": "positive %s", "hud.coordinatesdisplay.direction.negative": "negative %s", + "hud.coordinatesdisplay.direction.rendering3d": "3D Compass: %s", "hud.coordinatesdisplay.chunk": "Chunk", "hud.coordinatesdisplay.chunk.position": "Position", @@ -109,6 +111,7 @@ "button.coordinatesdisplay.colorconfig": "色設定...", "button.coordinatesdisplay.deathpos": "死亡位置設定...", "button.coordinatesdisplay.text": "テキスト設定...", + "button.coordinatesdisplay.3dcompass": "Render 3D Compass: %s", "button.coordinatesdisplay.visibility": "Visibility: %s", "button.coordinatesdisplay.decimalPlaces": "小数点以下桁数: %s", "button.coordinatesdisplay.decimalPlaces.block_pos": "ブロック位置", @@ -184,5 +187,6 @@ "command.coordinatesdisplay.config.open.success": "設定ファイルを正常に開きました", "command.coordinatesdisplay.config.open.fail": "設定ファイルを開けませんでした", "command.coordinatesdisplay.movehud.fail": "No Z value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "3D Compass rendering: %s" } \ No newline at end of file diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/ko_kr.json b/common/src/main/resources/assets/coordinatesdisplay/lang/ko_kr.json index e3b31aa..37ef769 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/ko_kr.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/ko_kr.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "/tp 명령으로 현재 위치를 복사하십시오", "key.coordinatesdisplay.changeHudPos": "Change HUD Position", "key.coordinatesdisplay.cycleDisplayMode": "Cycle Display Mode (hold shift to go back)", + "key.coordinatesdisplay.toggle3DCompass": "Toggle 3D Compass Rendering", "category.coordinatesdisplay": "Coordinates Display", "hud.coordinatesdisplay.north": "북", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "Pitch: %s (%s)", "hud.coordinatesdisplay.direction.positive": "positive %s", "hud.coordinatesdisplay.direction.negative": "negative %s", + "hud.coordinatesdisplay.direction.rendering3d": "3D Compass: %s", "hud.coordinatesdisplay.chunk": "Chunk", "hud.coordinatesdisplay.chunk.position": "Position", @@ -109,6 +111,7 @@ "button.coordinatesdisplay.colorconfig": "색상...", "button.coordinatesdisplay.deathpos": "죽음의 위치", "button.coordinatesdisplay.text": "텍스트 설정...", + "button.coordinatesdisplay.3dcompass": "Render 3D Compass: %s", "button.coordinatesdisplay.decimalPlaces": "소수점 표시: %s", "button.coordinatesdisplay.visibility": "Visibility: %s", "button.coordinatesdisplay.decimalPlaces.block_pos": "블록 위치", @@ -184,5 +187,6 @@ "command.coordinatesdisplay.config.open.success": "Successfully opened config file", "command.coordinatesdisplay.config.open.fail": "Could not open config file", "command.coordinatesdisplay.movehud.fail": "No Z value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "3D Compass rendering: %s" } \ No newline at end of file diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/ru_ru.json b/common/src/main/resources/assets/coordinatesdisplay/lang/ru_ru.json index f5e0f00..ea5bd18 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/ru_ru.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/ru_ru.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "Copy Current Position as /tp command", "key.coordinatesdisplay.changeHudPos": "Change HUD Position", "key.coordinatesdisplay.cycleDisplayMode": "Cycle Display Mode (hold shift to go back)", + "key.coordinatesdisplay.toggle3DCompass": "Toggle 3D Compass Rendering", "category.coordinatesdisplay": "Coordinates Display", "hud.coordinatesdisplay.north": "Север", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "Pitch: %s (%s)", "hud.coordinatesdisplay.direction.positive": "positive %s", "hud.coordinatesdisplay.direction.negative": "negative %s", + "hud.coordinatesdisplay.direction.rendering3d": "3D Compass: %s", "hud.coordinatesdisplay.chunk": "Chunk", "hud.coordinatesdisplay.chunk.position": "Position", @@ -109,6 +111,7 @@ "button.coordinatesdisplay.colorconfig": "Цвета...", "button.coordinatesdisplay.deathpos": "Позиция смерти...", "button.coordinatesdisplay.text": "Текстовые настройки...", + "button.coordinatesdisplay.3dcompass": "Render 3D Compass: %s", "button.coordinatesdisplay.visibility": "Visibility: %s", "button.coordinatesdisplay.decimalPlaces": "Decimal Places: %s", "button.coordinatesdisplay.decimalPlaces.block_pos": "позиция блока", @@ -184,5 +187,6 @@ "command.coordinatesdisplay.config.open.success": "Successfully opened config file", "command.coordinatesdisplay.config.open.fail": "Could not open config file", "command.coordinatesdisplay.movehud.fail": "No Z value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "3D Compass rendering: %s" } \ No newline at end of file diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/uk_ua.json b/common/src/main/resources/assets/coordinatesdisplay/lang/uk_ua.json index fba9f5d..8edfb68 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/uk_ua.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/uk_ua.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "Скопіювати поточні координати як команду /tp", "key.coordinatesdisplay.changeHudPos": "Змінити положення інтерфейсу", "key.coordinatesdisplay.cycleDisplayMode": "Перемкнути режим відображення (Shift — назад)", + "key.coordinatesdisplay.toggle3DCompass": "Toggle 3D Compass Rendering", "category.coordinatesdisplay": "Coordinates Display", "hud.coordinatesdisplay.north": "Північ", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "Нахил: %s (%s)", "hud.coordinatesdisplay.direction.positive": "додатне %s", "hud.coordinatesdisplay.direction.negative": "від'ємне %s", + "hud.coordinatesdisplay.direction.rendering3d": "3D Compass: %s", "hud.coordinatesdisplay.chunk": "Chunk", "hud.coordinatesdisplay.chunk.position": "Position", @@ -110,6 +112,7 @@ "button.coordinatesdisplay.deathpos": "Місце смерті...", "button.coordinatesdisplay.text": "Налаштування тексту...", "button.coordinatesdisplay.visibility": "Видимість: %s", + "button.coordinatesdisplay.3dcompass": "Render 3D Compass: %s", "button.coordinatesdisplay.decimalPlaces": "Цифри після коми: %s", "button.coordinatesdisplay.decimalPlaces.block_pos": "положення блока", "button.coordinatesdisplay.displayMode": "Режим: %s", @@ -183,5 +186,6 @@ "command.coordinatesdisplay.config.open.success": "Успішно відкрито файл налаштувань", "command.coordinatesdisplay.config.open.fail": "Не вдалося відкрити файл налаштувань", "command.coordinatesdisplay.movehud.fail": "No Z value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "3D Compass rendering: %s" } \ No newline at end of file diff --git a/common/src/main/resources/assets/coordinatesdisplay/lang/zh_tw.json b/common/src/main/resources/assets/coordinatesdisplay/lang/zh_tw.json index def693b..9e59069 100644 --- a/common/src/main/resources/assets/coordinatesdisplay/lang/zh_tw.json +++ b/common/src/main/resources/assets/coordinatesdisplay/lang/zh_tw.json @@ -6,6 +6,7 @@ "key.coordinatesdisplay.copypostp": "將目前位置複製為 /tp 指令", "key.coordinatesdisplay.changeHudPos": "更改抬頭顯示器位置", "key.coordinatesdisplay.cycleDisplayMode": "循環切換顯示模式(按住 Shift 鍵返回)", + "key.coordinatesdisplay.toggle3DCompass": "Toggle 3D Compass Rendering", "category.coordinatesdisplay": "座標顯示", "hud.coordinatesdisplay.north": "北", @@ -75,6 +76,7 @@ "hud.coordinatesdisplay.direction.pitch": "俯仰角:%s(%s)", "hud.coordinatesdisplay.direction.positive": "正 %s", "hud.coordinatesdisplay.direction.negative": "負 %s", + "hud.coordinatesdisplay.direction.rendering3d": "3D Compass: %s", "hud.coordinatesdisplay.chunk": "區塊", "hud.coordinatesdisplay.chunk.position": "位置", @@ -109,6 +111,7 @@ "button.coordinatesdisplay.colorconfig": "顏色…", "button.coordinatesdisplay.deathpos": "死亡位置…", "button.coordinatesdisplay.text": "文字設定…", + "button.coordinatesdisplay.3dcompass": "Render 3D Compass: %s", "button.coordinatesdisplay.visibility": "可見度:%s", "button.coordinatesdisplay.decimalPlaces": "小數位數:%s", "button.coordinatesdisplay.decimalPlaces.block_pos": "方塊位置", @@ -184,5 +187,6 @@ "command.coordinatesdisplay.config.open.success": "已成功開啟設定檔案", "command.coordinatesdisplay.config.open.fail": "無法開啟設定檔案", "command.coordinatesdisplay.movehud.fail": "No Z value specified!", - "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s" + "command.coordinatesdisplay.movehud.get": "Current HUD position: %s, %s", + "command.coordinatesdisplay.toggle3dCompass": "3D Compass rendering: %s" } \ No newline at end of file diff --git a/fabric/src/main/java/dev/boxadactle/coordinatesdisplay/fabric/CoordinatesDisplayFabric.java b/fabric/src/main/java/dev/boxadactle/coordinatesdisplay/fabric/CoordinatesDisplayFabric.java index a6038fc..e305a8e 100644 --- a/fabric/src/main/java/dev/boxadactle/coordinatesdisplay/fabric/CoordinatesDisplayFabric.java +++ b/fabric/src/main/java/dev/boxadactle/coordinatesdisplay/fabric/CoordinatesDisplayFabric.java @@ -35,6 +35,7 @@ public void onInitializeClient() { KeyBindingHelper.registerKeyBinding(Bindings.copyPosTp); KeyBindingHelper.registerKeyBinding(Bindings.changeHudPosition); KeyBindingHelper.registerKeyBinding(Bindings.cycleDisplayMode); + KeyBindingHelper.registerKeyBinding(Bindings.toggle3DCompass); } private void checkBindings(Minecraft client) { diff --git a/forge/src/main/java/dev/boxadactle/coordinatesdisplay/forge/CoordinatesDisplayForge.java b/forge/src/main/java/dev/boxadactle/coordinatesdisplay/forge/CoordinatesDisplayForge.java index 4ff2d54..4262f15 100644 --- a/forge/src/main/java/dev/boxadactle/coordinatesdisplay/forge/CoordinatesDisplayForge.java +++ b/forge/src/main/java/dev/boxadactle/coordinatesdisplay/forge/CoordinatesDisplayForge.java @@ -52,6 +52,7 @@ public static void registerKeys(RegisterKeyMappingsEvent e) { e.register(Bindings.copyPosTp); e.register(Bindings.changeHudPosition); e.register(Bindings.cycleDisplayMode); + e.register(Bindings.toggle3DCompass); } } diff --git a/gradle.properties b/gradle.properties index af1dc07..5dba8d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G org.gradle.parallel=true # Mod properties -mod_version = 13.1.0 +mod_version = 13.2.0 maven_group = dev.boxadactle archives_name = CoordinatesDisplay enabled_platforms = fabric,neoforge,forge @@ -18,7 +18,7 @@ neoforge_version = 21.1.18 forge_version = 52.0.4 modmenu_version = 11.0.1 -boxlib_version = 14.3.0 +boxlib_version = 14.4.1 # publishing game_versions = 1.21,1.21.1 diff --git a/neoforge/src/main/java/dev/boxadactle/coordinatesdisplay/neoforge/CoordinatesDisplayNeoforge.java b/neoforge/src/main/java/dev/boxadactle/coordinatesdisplay/neoforge/CoordinatesDisplayNeoforge.java index 09eb514..d6b5084 100644 --- a/neoforge/src/main/java/dev/boxadactle/coordinatesdisplay/neoforge/CoordinatesDisplayNeoforge.java +++ b/neoforge/src/main/java/dev/boxadactle/coordinatesdisplay/neoforge/CoordinatesDisplayNeoforge.java @@ -93,6 +93,7 @@ public static void registerKeys(RegisterKeyMappingsEvent e) { e.register(Bindings.copyPosTp); e.register(Bindings.changeHudPosition); e.register(Bindings.cycleDisplayMode); + e.register(Bindings.toggle3DCompass); } }