From f9adf75e5a59ff7e0dc0aea6e916da70d79db54b Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Wed, 9 Jun 2021 22:58:43 +0800 Subject: [PATCH 1/6] Update build.gradle --- build.gradle | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 4a217886..7574f964 100644 --- a/build.gradle +++ b/build.gradle @@ -8,17 +8,20 @@ buildscript { } plugins { - id 'fabric-loom' version '0.7-SNAPSHOT' + id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' } repositories { maven { - url 'https://masa.dy.fi/maven' + url 'https://masa.dy.fi/maven/' } maven { url 'https://www.cursemaven.com/' } + maven { + url 'https://maven.terraformersmc.com/releases/' + } } dependencies { @@ -29,7 +32,7 @@ dependencies { // Malilib modApi("fi.dy.masa.malilib:malilib-fabric-${project.minecraft_version_masa}:${project.malilib_version}") // ModMenu - modCompileOnly("io.github.prospector:modmenu:" + project.mod_menu_version) + modCompileOnly("com.terraformersmc:modmenu:" + project.mod_menu_version) // Optional mod compatibility Library modCompileOnly("curse.maven:authme-356643:3073169") modCompileOnly("curse.maven:reauth-403928:3105780") From 60be0d59ed0a0775e98bb87133c13946fe6c3e78 Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Wed, 9 Jun 2021 22:58:55 +0800 Subject: [PATCH 2/6] Update gradle.properties --- gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index abb78aa2..9bc4cbbc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,17 +10,17 @@ mod_version = 1.0.8 mod_version_detail = 1.0.8+build.undefined # Required malilib version -malilib_version = 0.10.0-dev.21+arne.1 +malilib_version = 0.10.0-dev.22+beta.1 # Minecraft, Fabric and mappings versions fabric_loader_version = 0.11.3 -mappings_version = 1.16.5+build.9 -minecraft_version = 1.16.5 -minecraft_version_masa = 1.16.4 -minecraft_version_out = 1.16 +mappings_version = 1.17+build.5 +minecraft_version = 1.17 +minecraft_version_masa = 1.17.0 +minecraft_version_out = 1.17 # ModMenu -mod_menu_version = 1.14.6+build.31 +mod_menu_version = 2.0.0-beta.7 -# CurseForge 7890 = 1.16 8203 = 1.16.5 -release-curse-versions = 7890, 8203 +# CurseForge 8152 = 1.17 +release-curse-versions = 8152 From b640a4be63f61e6e15942fc11cb31ffdd0a682b5 Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Wed, 9 Jun 2021 23:51:07 +0800 Subject: [PATCH 3/6] Update build.yml --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8873f0b..1bedf454 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,9 +13,7 @@ jobs: matrix: # Use these Java versions java: [ - 1.8, # Minimum supported by Minecraft - 11, # Current Java LTS - 16 # Latest version + 16, # Minimum supported by Minecraft ] # and run on both Linux and Windows os: [ ubuntu-20.04, windows-latest ] @@ -48,7 +46,7 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Upload assets to GitHub - if: ${{ runner.os == 'Linux' && matrix.java == '1.8' }} # Only upload artifacts built from java 1.8 on one OS + if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from java 16 on one OS uses: actions/upload-artifact@v2 with: name: build-artifacts From 15c4f5d81e5bec4ff5b0e3b558fcc227aaff6d34 Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Wed, 9 Jun 2021 23:51:17 +0800 Subject: [PATCH 4/6] Update publish.yml --- .github/workflows/publish.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8ace0eea..cf384e8d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,9 +37,7 @@ jobs: matrix: # Use these Java versions java: [ - 1.8, # Minimum supported by Minecraft - 11, # Current Java LTS - 16 # Latest version + 16, # Minimum supported by Minecraft ] # and run on both Linux and Windows os: [ ubuntu-20.04, windows-latest ] @@ -75,19 +73,19 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Find correct JAR - if: ${{ runner.os == 'Linux' && matrix.java == '1.8' }} # Only upload artifacts built from java 1.8 on one OS + if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from java 16 on one OS id: findjar run: | output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")" echo "::set-output name=jarname::$output" - name: Upload assets to GitHub - if: ${{ runner.os == 'Linux' && matrix.java == '1.8' }} # Only upload artifacts built from java 1.8 on one OS + if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from java 16 on one OS uses: AButler/upload-release-assets@v2.0 with: - files: 'build/libs/*' + files: 'build/libs/${{ steps.findjar.outputs.jarname }}' repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload to Curseforge - if: ${{ runner.os == 'Linux' && matrix.java == '1.8' }} # Only upload artifacts built from java 1.8 on one OS + if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from java 16 on one OS uses: itsmeow/curseforge-upload@v3 with: token: ${{ secrets.CF_API_TOKEN }} @@ -96,5 +94,5 @@ jobs: file_path: build/libs/${{ steps.findjar.outputs.jarname }} changelog_type: markdown changelog: ${{ github.event.release.body }} - game_versions: 7499,4458,8320,8325,${{ steps.getbranchinfo.outputs.curse-versions }} #Fabric,Java 8, Java 11, Java 16 [version (s) for the branch] + game_versions: 7499,8325,${{ steps.getbranchinfo.outputs.curse-versions }} #Fabric, Java 16 [version (s) for the branch] release_type: ${{ needs.Get-Properties.outputs.release-type }} From 19e25a9e7e5424b234713b461e22e30dcd6de1e3 Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Wed, 9 Jun 2021 23:53:24 +0800 Subject: [PATCH 5/6] Compatible with 1.17 --- .../mixin/MixinDisconnectedScreen.java | 4 ++-- .../TweakMyClient/mixin/MixinInGameHud.java | 19 +++++++++---------- .../mixin/authme/MixinDisconnectedScreen.java | 2 +- .../mixin/reauth/MixinDisconnectedScreen.java | 2 +- .../TweakMyClient/util/AutoReconnect.java | 3 ++- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinDisconnectedScreen.java b/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinDisconnectedScreen.java index b4d9e609..efec59e3 100644 --- a/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinDisconnectedScreen.java +++ b/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinDisconnectedScreen.java @@ -54,11 +54,11 @@ private void onInitDisconnectedScreen(CallbackInfo ci) { int backButtonX = width / 2 - 100; int backButtonY = Math.min(height / 2 + reasonHeight / 2 + 9, height - 30); - addButton(new ButtonWidget(backButtonX, backButtonY + 24, 200, 20, + addDrawableChild(new ButtonWidget(backButtonX, backButtonY + 24, 200, 20, new LiteralText(StringUtils.translate(String.format("%s.message.autoReconnect.static", PREFIX))), b -> AutoReconnect.reconnect(parent))); autoReconnectButton = - addButton(new ButtonWidget(backButtonX, backButtonY + 48, 200, 20, + addDrawableChild(new ButtonWidget(backButtonX, backButtonY + 48, 200, 20, new LiteralText(StringUtils.translate(String.format("%s.message.autoReconnect.toggle", PREFIX))), b -> onPressAutoReconnect())); if (reason == null || getTranslationKey(reason).startsWith("disconnect.loginFailed")) { Configs.Feature.FEATURE_AUTO_RECONNECT.setBooleanValue(false); diff --git a/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinInGameHud.java b/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinInGameHud.java index 9bd4e599..62a43899 100644 --- a/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinInGameHud.java +++ b/src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinInGameHud.java @@ -1,11 +1,12 @@ package top.hendrixshen.TweakMyClient.mixin; import net.minecraft.client.gui.hud.InGameHud; -import net.minecraft.client.options.GameOptions; +import net.minecraft.client.option.GameOptions; import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.scoreboard.ScoreboardObjective; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; @@ -14,9 +15,6 @@ @Mixin(InGameHud.class) public abstract class MixinInGameHud { - @Shadow - protected abstract void renderPumpkinOverlay(); - @Inject( method = "renderScoreboardSidebar", at = @At( @@ -34,7 +32,7 @@ private void onRenderScoreboardSidebar(MatrixStack matrices, ScoreboardObjective method = "renderScoreboardSidebar", at = @At( value = "INVOKE", - target = "Lnet/minecraft/client/options/GameOptions;getTextBackgroundColor(F)I", + target = "Lnet/minecraft/client/option/GameOptions;getTextBackgroundColor(F)I", ordinal = 1 ) ) @@ -49,7 +47,7 @@ private int changeSidebarTitleBackgroundColor(GameOptions gameOptions, float fal method = "renderScoreboardSidebar", at = @At( value = "INVOKE", - target = "Lnet/minecraft/client/options/GameOptions;getTextBackgroundColor(F)I", + target = "Lnet/minecraft/client/option/GameOptions;getTextBackgroundColor(F)I", ordinal = 0 ) ) @@ -64,12 +62,13 @@ private int changeSidebarContentBackgroundColor(GameOptions gameOptions, float f method = "render", at = @At( value = "INVOKE", - target = "Lnet/minecraft/client/gui/hud/InGameHud;renderPumpkinOverlay()V" + target = "Lnet/minecraft/item/ItemStack;isOf(Lnet/minecraft/item/Item;)Z" ) ) - private void onRenderPumpkinOverlay(InGameHud inGameHud) { + private boolean onRenderPumpkinOverlay(ItemStack itemStack, Item item) { if (!Configs.Disable.DISABLE_RENDER_OVERLAY_PUMPKIN.getBooleanValue()) { - renderPumpkinOverlay(); + return itemStack.isOf(item); } + return false; } } diff --git a/src/main/java/top/hendrixshen/TweakMyClient/mixin/authme/MixinDisconnectedScreen.java b/src/main/java/top/hendrixshen/TweakMyClient/mixin/authme/MixinDisconnectedScreen.java index 5bd72c7b..1ff1a8b4 100644 --- a/src/main/java/top/hendrixshen/TweakMyClient/mixin/authme/MixinDisconnectedScreen.java +++ b/src/main/java/top/hendrixshen/TweakMyClient/mixin/authme/MixinDisconnectedScreen.java @@ -49,7 +49,7 @@ private void onInitDisconnectedScreen(CallbackInfo ci) { if (reason == null || AutoReconnect.getTranslationKey(reason).startsWith("disconnect.loginFailed")) { Configs.Feature.FEATURE_AUTO_RECONNECT.setBooleanValue(false); if (TweakMyClientMixinPlugin.isAuthMeLoaded) { - addButton(new ButtonWidget(backButtonX, backButtonY + 72, 200, 20, + addDrawableChild(new ButtonWidget(backButtonX, backButtonY + 72, 200, 20, new LiteralText(StringUtils.translate(String.format("%s.message.autoReconnect.reAuthenticateWithAuthMe", PREFIX))), button -> this.client.openScreen(new AuthScreen(parent)))); } } diff --git a/src/main/java/top/hendrixshen/TweakMyClient/mixin/reauth/MixinDisconnectedScreen.java b/src/main/java/top/hendrixshen/TweakMyClient/mixin/reauth/MixinDisconnectedScreen.java index 7b05bce2..ad1a1d47 100644 --- a/src/main/java/top/hendrixshen/TweakMyClient/mixin/reauth/MixinDisconnectedScreen.java +++ b/src/main/java/top/hendrixshen/TweakMyClient/mixin/reauth/MixinDisconnectedScreen.java @@ -49,7 +49,7 @@ private void onInitDisconnectedScreen(CallbackInfo ci) { if (reason == null || AutoReconnect.getTranslationKey(reason).startsWith("disconnect.loginFailed")) { Configs.Feature.FEATURE_AUTO_RECONNECT.setBooleanValue(false); if (TweakMyClientMixinPlugin.isReAuthLoaded) { - addButton(new ButtonWidget(backButtonX, backButtonY + (TweakMyClientMixinPlugin.isAuthMeLoaded ? 96 : 72), 200, 20, + addDrawableChild(new ButtonWidget(backButtonX, backButtonY + (TweakMyClientMixinPlugin.isAuthMeLoaded ? 96 : 72), 200, 20, new LiteralText(StringUtils.translate(String.format("%s.message.autoReconnect.reAuthenticateWithReAuth", PREFIX))), button -> this.client.openScreen(new AuthScreen(parent)))); } } diff --git a/src/main/java/top/hendrixshen/TweakMyClient/util/AutoReconnect.java b/src/main/java/top/hendrixshen/TweakMyClient/util/AutoReconnect.java index cf7e991c..e7b46c2b 100644 --- a/src/main/java/top/hendrixshen/TweakMyClient/util/AutoReconnect.java +++ b/src/main/java/top/hendrixshen/TweakMyClient/util/AutoReconnect.java @@ -2,6 +2,7 @@ import net.minecraft.client.gui.screen.ConnectScreen; import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.network.ServerAddress; import net.minecraft.client.network.ServerInfo; import net.minecraft.text.Text; import net.minecraft.text.TranslatableText; @@ -22,7 +23,7 @@ public static void setLastServer(ServerInfo serverInfo) { public static void reconnect(Screen screen) { ServerInfo serverInfo = AutoReconnect.getLastServer(); if (lastServer != null) { - TweakMyClient.minecraftClient.openScreen(new ConnectScreen(screen, TweakMyClient.minecraftClient, serverInfo)); + ConnectScreen.connect(screen, TweakMyClient.minecraftClient, ServerAddress.parse(serverInfo.address), serverInfo); } } From 1ab35e4167041f81f296877d8b44ce0d7c29e188 Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Wed, 9 Jun 2021 23:59:40 +0800 Subject: [PATCH 6/6] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bd6e560e..4cc2ef41 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ The default hotkey to open the in-game config GUI is **T + C**. - *The block tracing position will be sent in this mode.* - *获取到的追踪位置将该模式发送.* ### Color ++ colorBlockOutside + - *Custom block outside color.* + - *自定义方块轮廓颜色.* + colorGuiStart - *Custom gui gradient start color.* - *自定义界面渐变起始颜色.* @@ -96,6 +99,9 @@ The default hotkey to open the in-game config GUI is **T + C**. + featureAutoRespawn - *Automatically respawns you whenever you die.* - *死亡时自动重生.* ++ featureBlockOutsideColor + - *Enable block outside color override.* + - *启用方块轮廓颜色覆写.* + featureGuiBackgroundColor - *Enable gui background color override.* - *启用计分板界面背景色覆写.*