From 484038dca969dddfbfed5044706ecc459d756e27 Mon Sep 17 00:00:00 2001 From: enjarai Date: Mon, 13 Nov 2023 15:30:45 +0100 Subject: [PATCH] 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": "*" },