Skip to content

Commit

Permalink
Update to 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Nov 13, 2023
1 parent 39267f2 commit 484038d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
},
Expand Down

0 comments on commit 484038d

Please sign in to comment.