From 09d3a014d759237ed95bbbaab2fb5d7bb817ac27 Mon Sep 17 00:00:00 2001 From: HTony03 Date: Sun, 30 Apr 2023 15:41:28 +0800 Subject: [PATCH 1/8] 1.18.2 yeaaaah --- build.gradle | 8 ++++---- gradle.properties | 16 +++++++++++++++- .../java/net/torocraft/flighthud/FlightHud.java | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 86ea1fb..fb26860 100644 --- a/build.gradle +++ b/build.gradle @@ -13,12 +13,12 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '1.17.1-forge-1' +version = '1.18.2_htony_test' group = 'net.torocraft' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'flighthud' // Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16. -java.toolchain.languageVersion = JavaLanguageVersion.of(16) +java.toolchain.languageVersion = JavaLanguageVersion.of(17) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { @@ -33,7 +33,7 @@ minecraft { // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'official', version: '1.17.1' + mappings channel: 'official', version: '1.18.2' // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. @@ -128,7 +128,7 @@ dependencies { // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.17.1-37.0.34' + minecraft 'net.minecraftforge:forge:1.18.2-40.1.93' // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency diff --git a/gradle.properties b/gradle.properties index 878bf1f..f3b3b43 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,18 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=false \ No newline at end of file +org.gradle.daemon=true +org.gradle.configureondemand=true + +artifact_minecraft_version = 1.18.2 +mc_version=1.18.2 +forge_version = 40.1.93 +mod_version=HTony_test +forgegradle_version = 5.1.53 +mixingradle_version = 0.7-SNAPSHOT +mixin_version = 0.8.5 +jei_minecraft_version = 1.18.2 +jei_version = 9.7.0.209 +registrate_version = MC1.18.2-1.1.3 +curios_minecraft_version = 1.18.2 +curios_version = 5.0.7.0 \ No newline at end of file diff --git a/src/main/java/net/torocraft/flighthud/FlightHud.java b/src/main/java/net/torocraft/flighthud/FlightHud.java index bc90a5d..21a3525 100644 --- a/src/main/java/net/torocraft/flighthud/FlightHud.java +++ b/src/main/java/net/torocraft/flighthud/FlightHud.java @@ -6,7 +6,7 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import net.minecraftforge.fmlclient.registry.ClientRegistry; +import net.minecraftforge.client.ClientRegistry; import net.torocraft.flighthud.config.HudConfig; import net.torocraft.flighthud.config.SettingsConfig; import net.torocraft.flighthud.config.loader.ConfigLoader; From 3c8e5bcef80123eb5696f90373641897d81a5264 Mon Sep 17 00:00:00 2001 From: HTony03 Date: Sun, 30 Apr 2023 16:38:38 +0800 Subject: [PATCH 2/8] 6fps --- .../net/torocraft/flighthud/HudRenderer.java | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/src/main/java/net/torocraft/flighthud/HudRenderer.java b/src/main/java/net/torocraft/flighthud/HudRenderer.java index e01573e..56d2f94 100644 --- a/src/main/java/net/torocraft/flighthud/HudRenderer.java +++ b/src/main/java/net/torocraft/flighthud/HudRenderer.java @@ -11,8 +11,10 @@ import net.torocraft.flighthud.components.SpeedIndicator; import net.torocraft.flighthud.config.SettingsConfig.DisplayMode; +class fps { + public static int tps = 1; +} public class HudRenderer extends HudComponent { - private final Dimensions dim = new Dimensions(); private final FlightComputer computer = new FlightComputer(); private static final String FULL = DisplayMode.FULL.toString(); @@ -50,20 +52,38 @@ public void render(PoseStack m, float partial, Minecraft client) { } try { - m.pushPose(); + if (fps.tps == 1){ + m.pushPose(); - if (HudComponent.CONFIG.scale != 1d) { - float scale = 1 / (float) HudComponent.CONFIG.scale; - m.scale(scale, scale, scale); - } + if (HudComponent.CONFIG.scale != 1d) { + float scale = 1 / (float) HudComponent.CONFIG.scale; + m.scale(scale, scale, scale); + } - computer.update(client, partial); - dim.update(client); + computer.update(client, partial); + dim.update(client); - for (HudComponent component : components) { - component.render(m, partial, client); + for (HudComponent component : components) { + component.render(m, partial, client); + } + m.popPose(); + fps.tps = 2; } - m.popPose(); + if (fps.tps == 2){ + fps.tps = 3; + } + if (fps.tps == 3){ + fps.tps = 4; + } + if (fps.tps == 4){ + fps.tps = 5; + } + if (fps.tps == 5){ + fps.tps = 6; + } + if (fps.tps == 6){ + fps.tps = 1; + } } catch (Exception e) { e.printStackTrace(); } From 43d067068debe38e32a1bd530af5ab1fb3381151 Mon Sep 17 00:00:00 2001 From: HTony03 Date: Sun, 30 Apr 2023 17:12:07 +0800 Subject: [PATCH 3/8] 6fps --- src/main/java/net/torocraft/flighthud/HudRenderer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/torocraft/flighthud/HudRenderer.java b/src/main/java/net/torocraft/flighthud/HudRenderer.java index 56d2f94..359249c 100644 --- a/src/main/java/net/torocraft/flighthud/HudRenderer.java +++ b/src/main/java/net/torocraft/flighthud/HudRenderer.java @@ -69,19 +69,19 @@ public void render(PoseStack m, float partial, Minecraft client) { m.popPose(); fps.tps = 2; } - if (fps.tps == 2){ + else if (fps.tps == 2){ fps.tps = 3; } - if (fps.tps == 3){ + else if (fps.tps == 3){ fps.tps = 4; } - if (fps.tps == 4){ + else if (fps.tps == 4){ fps.tps = 5; } - if (fps.tps == 5){ + else if (fps.tps == 5){ fps.tps = 6; } - if (fps.tps == 6){ + else if (fps.tps == 6){ fps.tps = 1; } } catch (Exception e) { From 1c7d2050888488caad805402901ea0547d51578d Mon Sep 17 00:00:00 2001 From: HTony03 Date: Sun, 30 Apr 2023 17:21:43 +0800 Subject: [PATCH 4/8] readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 716b946..82c0681 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,5 @@ __Flight HUD__ is a client side Fabric Minecraft Mod that adds a flight style HU ![HUD Components](images/hud-diagram.png?raw=true "HUD Components") ## Requirements -- Minecraft 1.16.1 -- Fabric Mod Loader -- Fabric API Mod +- Minecraft 1.18.1/1.18.2 +- Forge 40.1.93+ From d7b95c028102e9e6e26567318cc6d5d9d125a658 Mon Sep 17 00:00:00 2001 From: HTony03 Date: Tue, 2 May 2023 16:14:17 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=A4=A7=E6=AE=B5=E6=94=B9=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/torocraft/flighthud/HudRenderer.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/main/java/net/torocraft/flighthud/HudRenderer.java b/src/main/java/net/torocraft/flighthud/HudRenderer.java index 359249c..a2a6374 100644 --- a/src/main/java/net/torocraft/flighthud/HudRenderer.java +++ b/src/main/java/net/torocraft/flighthud/HudRenderer.java @@ -52,7 +52,7 @@ public void render(PoseStack m, float partial, Minecraft client) { } try { - if (fps.tps == 1){ + if (fps.tps % 6 == 0 ){ m.pushPose(); if (HudComponent.CONFIG.scale != 1d) { @@ -68,22 +68,8 @@ public void render(PoseStack m, float partial, Minecraft client) { } m.popPose(); fps.tps = 2; - } - else if (fps.tps == 2){ - fps.tps = 3; - } - else if (fps.tps == 3){ - fps.tps = 4; - } - else if (fps.tps == 4){ - fps.tps = 5; - } - else if (fps.tps == 5){ - fps.tps = 6; - } - else if (fps.tps == 6){ - fps.tps = 1; - } + }; + fps.tps = ++fps.tps; } catch (Exception e) { e.printStackTrace(); } From 4d176871c6945b25cdebb8366956756b46ff15ca Mon Sep 17 00:00:00 2001 From: HTony03 Date: Fri, 12 May 2023 20:51:24 +0800 Subject: [PATCH 6/8] toml --- src/main/resources/META-INF/mods.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 2d4c878..8b7e4ce 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -62,6 +62,6 @@ Displays a flight styled hud while flying with elytra. [[dependencies.flighthud]] modId="minecraft" mandatory=true - versionRange="[1.17.1]" + versionRange="[1.18,1.18.2]" ordering="NONE" side="BOTH" From 3e07c80a0a6549a43d467acf0e1a481b993c4eb9 Mon Sep 17 00:00:00 2001 From: HTony03 Date: Fri, 12 May 2023 21:23:41 +0800 Subject: [PATCH 7/8] toml2 --- src/main/resources/META-INF/mods.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 8b7e4ce..20c3acd 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -24,13 +24,13 @@ modId="flighthud" #mandatory version="${file.jarVersion}" #mandatory # A display name for the mod -displayName="FlightHUD" #mandatory +displayName="FlightHUD reloaded" #mandatory # A URL to query for updates for this mod. See the JSON update specification #updateJSONURL="http://myurl.me/" #optional # A URL for the "homepage" for this mod, displayed in the mod UI -displayURL="https://www.curseforge.com/minecraft/mc-mods/flighthud" #optional +displayURL="https://www.mcmod.cn/class/10172.html" #optional # A file name (in the root of the mod JAR) containing a logo for display #logoFile="flighthud.png" #optional @@ -39,7 +39,7 @@ displayURL="https://www.curseforge.com/minecraft/mc-mods/flighthud" #optional #credits="Thanks for this example mod goes to Java" #optional # A text field displayed in the mod UI -authors="frodare" #optional +authors="frodare,HTony03" #optional # The description text for the mod (multi line!) (#mandatory) description=''' From 20491f13a91e56a23be30dfe701d872bebcfa4ff Mon Sep 17 00:00:00 2001 From: HTony03 Date: Fri, 26 May 2023 22:12:31 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E1.18=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0zh=5Fcn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 +++--- gradle.properties | 12 +++--------- src/main/java/net/torocraft/flighthud/FlightHud.java | 2 +- src/main/resources/assets/flighthud/lang/zh_cn.json | 4 ++++ 4 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/assets/flighthud/lang/zh_cn.json diff --git a/build.gradle b/build.gradle index fb26860..7f85f1c 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '1.18.2_htony_test' +version = '1.18_0.0.2' group = 'net.torocraft' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'flighthud' @@ -33,7 +33,7 @@ minecraft { // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'official', version: '1.18.2' + mappings channel: 'official', version: '1.18' // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. @@ -128,7 +128,7 @@ dependencies { // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.18.2-40.1.93' + minecraft 'net.minecraftforge:forge:1.18.2-40.2.0' // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency diff --git a/gradle.properties b/gradle.properties index f3b3b43..dea19b5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,16 +3,10 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=true org.gradle.configureondemand=true +org.gradle.parallel=true -artifact_minecraft_version = 1.18.2 +artifact_minecraft_version = 1.18 mc_version=1.18.2 -forge_version = 40.1.93 +forge_version = 41.1.0 mod_version=HTony_test forgegradle_version = 5.1.53 -mixingradle_version = 0.7-SNAPSHOT -mixin_version = 0.8.5 -jei_minecraft_version = 1.18.2 -jei_version = 9.7.0.209 -registrate_version = MC1.18.2-1.1.3 -curios_minecraft_version = 1.18.2 -curios_version = 5.0.7.0 \ No newline at end of file diff --git a/src/main/java/net/torocraft/flighthud/FlightHud.java b/src/main/java/net/torocraft/flighthud/FlightHud.java index 21a3525..8599860 100644 --- a/src/main/java/net/torocraft/flighthud/FlightHud.java +++ b/src/main/java/net/torocraft/flighthud/FlightHud.java @@ -46,7 +46,7 @@ public FlightHud() { } private void setup(final FMLCommonSetupEvent event) { - keyBinding = new KeyMapping("key.flighthud.toggleDisplayModed", GLFW.GLFW_KEY_GRAVE_ACCENT, "category.flighthud.toggleDisplayMode"); + keyBinding = new KeyMapping("key.flighthud.toggleDisplayMode", GLFW.GLFW_KEY_GRAVE_ACCENT, "category.flighthud.toggleDisplayMode"); CONFIG_LOADER_SETTINGS.load(); CONFIG_LOADER_FULL.load(); CONFIG_LOADER_MIN.load(); diff --git a/src/main/resources/assets/flighthud/lang/zh_cn.json b/src/main/resources/assets/flighthud/lang/zh_cn.json new file mode 100644 index 0000000..6b35b82 --- /dev/null +++ b/src/main/resources/assets/flighthud/lang/zh_cn.json @@ -0,0 +1,4 @@ +{ + "key.flighthud.toggleDisplayMode": "切换HUD模式", + "category.flighthud.toggleDisplayMode": "Flight HUD" +} \ No newline at end of file