From 39267f2c81f2281a65322f664a95e7c4bd991454 Mon Sep 17 00:00:00 2001 From: enjarai Date: Mon, 13 Nov 2023 15:24:34 +0100 Subject: [PATCH 1/4] Ah shit, here we go --- build.gradle | 2 +- gradle.properties | 4 ++-- src/main/resources/fabric.mod.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 48abf572..587fe266 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ dependencies { modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" // Mixin Extras for extra compatibility. - include(implementation("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")) + implementation("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}") annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}") clientAnnotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}") diff --git a/gradle.properties b/gradle.properties index 366c1bdd..06d0b8d6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx4096M minecraft_version=1.20 archives_base_name=do-a-barrel-roll -mod_version=3.3.6 +mod_version=3.3.7 maven_group=nl.enjarai yarn_version=1.20+build.1 @@ -11,7 +11,7 @@ yarn_version=1.20+build.1 loader_version=0.14.24 fabric_version=0.83.0+1.20 -cicada_version=0.4.6 +cicada_version=0.5.0+1.20.1-minus # https://modrinth.com/mod/modmenu/versions#all-versions modmenu_version=7.2.1 # https://github.com/isXander/YetAnotherConfigLib/releases diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 2289ca41..6dd42176 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -60,7 +60,7 @@ "yet_another_config_lib_v3": ">=3.1.0" }, "depends": { - "minecraft": ">=1.20- <1.20.3-", + "minecraft": ">=1.20- <1.20.2-", "fabric-api": "*", "cicada": "*" }, From 484038dca969dddfbfed5044706ecc459d756e27 Mon Sep 17 00:00:00 2001 From: enjarai Date: Mon, 13 Nov 2023 15:30:45 +0100 Subject: [PATCH 2/4] Update to 1.20.2 --- gradle.properties | 14 +++++----- .../doabarrelroll/DoABarrelRollClient.java | 27 +------------------ src/main/resources/fabric.mod.json | 2 +- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/gradle.properties b/gradle.properties index 06d0b8d6..05d097f3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,23 +1,23 @@ org.gradle.jvmargs=-Xmx4096M -minecraft_version=1.20 +minecraft_version=1.20.2 archives_base_name=do-a-barrel-roll mod_version=3.3.7 maven_group=nl.enjarai -yarn_version=1.20+build.1 +yarn_version=1.20.2+build.4 loader_version=0.14.24 -fabric_version=0.83.0+1.20 +fabric_version=0.90.7+1.20.2 -cicada_version=0.5.0+1.20.1-minus +cicada_version=0.5.0+1.20.2-plus # https://modrinth.com/mod/modmenu/versions#all-versions -modmenu_version=7.2.1 +modmenu_version=8.0.0 # https://github.com/isXander/YetAnotherConfigLib/releases -yacl_version=3.1.0+1.20 +yacl_version=3.3.0-beta.1+1.20.2 # https://github.com/isXander/Controlify/releases -controlify_version=1.3.0-beta.2+1.20 +controlify_version=1.7.0+1.20.2 mixin_extras_version=0.2.0 mixin_squared_version=0.1.1 permissions_api_version=0.2-SNAPSHOT diff --git a/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java b/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java index 4c088057..69965d2f 100644 --- a/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java +++ b/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java @@ -37,23 +37,6 @@ public class DoABarrelRollClient { public static final RollGroup FALL_FLYING_GROUP = RollGroup.of(DoABarrelRoll.id("fall_flying")); public static double throttle = 0; - @Nullable - private static final Method isRealmsMethod; - - static { - Method method; - var resolver = FabricLoader.getInstance().getMappingResolver(); - var className = resolver.mapClassName("intermediary", "class_8599"); - var methodName = resolver.mapMethodName("intermediary", className, "method_52811", "()Z"); - - try { - method = ServerInfo.class.getMethod(methodName); - } catch (NoSuchMethodException e) { - method = null; - } - isRealmsMethod = method; - } - public static void init() { FALL_FLYING_GROUP.trueIf(DoABarrelRollClient::isFallFlying); @@ -138,17 +121,9 @@ public static boolean isFallFlying() { } public static boolean isConnectedToRealms() { - if (isRealmsMethod == null) return false; - var serverInfo = MinecraftClient.getInstance().getCurrentServerEntry(); if (serverInfo == null) return false; - // We don't have to care about supporting 1.20 for realms, as realms servers are always on the latest version. - // But I also want to keep the project on 1.20 as a base for now, therefore the reflection jank. - try { - return (boolean) isRealmsMethod.invoke(serverInfo); - } catch (ReflectiveOperationException | NullPointerException | ClassCastException f) { - return false; - } + return serverInfo.isRealm(); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 6dd42176..a5494798 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -60,7 +60,7 @@ "yet_another_config_lib_v3": ">=3.1.0" }, "depends": { - "minecraft": ">=1.20- <1.20.2-", + "minecraft": ">=1.20.2- <1.20.3-", "fabric-api": "*", "cicada": "*" }, From 47a198d9c6725a21fdf835311b7e663b32680e24 Mon Sep 17 00:00:00 2001 From: enjarai Date: Mon, 13 Nov 2023 15:33:05 +0100 Subject: [PATCH 3/4] MMM update --- .github/workflows/publish_all.yml | 14 ++++++++++++++ CHANGELOG.md | 1 + .../nl/enjarai/doabarrelroll/DoABarrelRoll.java | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_all.yml b/.github/workflows/publish_all.yml index 2409fdba..bb60af32 100644 --- a/.github/workflows/publish_all.yml +++ b/.github/workflows/publish_all.yml @@ -40,6 +40,20 @@ jobs: game_vers: | 1.20 1.20.1 + java_vers: 17 + GITHUB_REF: ${{ github.ref }} + secrets: + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + PUBLISH_MAVEN_USERNAME: ${{ secrets.PUBLISH_MAVEN_USERNAME }} + PUBLISH_MAVEN_PASSWORD: ${{ secrets.PUBLISH_MAVEN_PASSWORD }} + + deploy_1_20_2: + needs: deploy_1_20 + uses: enjarai/do-a-barrel-roll/.github/workflows/publish.yml@1.20.2/dev + with: + branch: 1.20.2/dev + game_vers: | 1.20.2 java_vers: 17 GITHUB_REF: ${{ github.ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index ea3feadb..c7a703ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,3 +2,4 @@ This does not apply to normal servers. - Changed the default toggle keybind to I to avoid conflicting with the advancements button. - Fixed an incompatibility with Keybind Fix. +- Separated 1.20 and 1.20.2 support into separate jars. \ No newline at end of file diff --git a/src/main/java/nl/enjarai/doabarrelroll/DoABarrelRoll.java b/src/main/java/nl/enjarai/doabarrelroll/DoABarrelRoll.java index 627a721d..b2af3124 100644 --- a/src/main/java/nl/enjarai/doabarrelroll/DoABarrelRoll.java +++ b/src/main/java/nl/enjarai/doabarrelroll/DoABarrelRoll.java @@ -37,7 +37,7 @@ public static void init() { @Override public void registerConversations(ConversationManager conversationManager) { conversationManager.registerSource( - JsonSource.fromUrl("https://raw.githubusercontent.com/enjarai/do-a-barrel-roll/1.20/dev/src/main/resources/cicada/do-a-barrel-roll/conversations.json") + JsonSource.fromUrl("https://raw.githubusercontent.com/enjarai/do-a-barrel-roll/1.20.2/dev/src/main/resources/cicada/do-a-barrel-roll/conversations.json") .or(JsonSource.fromResource("cicada/do-a-barrel-roll/conversations.json")), LOGGER::info ); From cb5f95ac37ccc3d8f92ead8991e3db5b648c7b15 Mon Sep 17 00:00:00 2001 From: enjarai Date: Mon, 13 Nov 2023 15:34:23 +0100 Subject: [PATCH 4/4] Lovely --- .../doabarrelroll/DoABarrelRollClient.java | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java b/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java index 4c088057..b97c7c25 100644 --- a/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java +++ b/src/client/java/nl/enjarai/doabarrelroll/DoABarrelRollClient.java @@ -37,23 +37,6 @@ public class DoABarrelRollClient { public static final RollGroup FALL_FLYING_GROUP = RollGroup.of(DoABarrelRoll.id("fall_flying")); public static double throttle = 0; - @Nullable - private static final Method isRealmsMethod; - - static { - Method method; - var resolver = FabricLoader.getInstance().getMappingResolver(); - var className = resolver.mapClassName("intermediary", "class_8599"); - var methodName = resolver.mapMethodName("intermediary", className, "method_52811", "()Z"); - - try { - method = ServerInfo.class.getMethod(methodName); - } catch (NoSuchMethodException e) { - method = null; - } - isRealmsMethod = method; - } - public static void init() { FALL_FLYING_GROUP.trueIf(DoABarrelRollClient::isFallFlying); @@ -138,17 +121,6 @@ public static boolean isFallFlying() { } public static boolean isConnectedToRealms() { - if (isRealmsMethod == null) return false; - - var serverInfo = MinecraftClient.getInstance().getCurrentServerEntry(); - if (serverInfo == null) return false; - - // We don't have to care about supporting 1.20 for realms, as realms servers are always on the latest version. - // But I also want to keep the project on 1.20 as a base for now, therefore the reflection jank. - try { - return (boolean) isRealmsMethod.invoke(serverInfo); - } catch (ReflectiveOperationException | NullPointerException | ClassCastException f) { - return false; - } + return false; // We are not connected to realms. } }