From 3e9fd6fb2027eb9f5fc8e4b37e0af81dbcc2ca77 Mon Sep 17 00:00:00 2001 From: SuchBlue <58862188+SuchBlue@users.noreply.github.com> Date: Fri, 14 Jul 2023 10:03:29 +0200 Subject: [PATCH] Updated mappings to 1.20.1 --- gradle.properties | 6 ++-- .../ofcapes/mixin/SkinOptionsScreenMixin.java | 32 +++++++++---------- src/main/resources/fabric.mod.json | 2 +- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/gradle.properties b/gradle.properties index 3dbd867..fcfb9db 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.19 - yarn_mappings=1.19+build.2 + minecraft_version=1.20.1 + yarn_mappings=1.20.1+build.9 loader_version=0.14.7 @@ -15,4 +15,4 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.55.3+1.19 \ No newline at end of file + fabric_version=0.83.0+1.20.1 \ No newline at end of file diff --git a/src/main/java/net/drago/ofcapes/mixin/SkinOptionsScreenMixin.java b/src/main/java/net/drago/ofcapes/mixin/SkinOptionsScreenMixin.java index 2aa9552..c74684d 100644 --- a/src/main/java/net/drago/ofcapes/mixin/SkinOptionsScreenMixin.java +++ b/src/main/java/net/drago/ofcapes/mixin/SkinOptionsScreenMixin.java @@ -26,26 +26,24 @@ public SkinOptionsScreenMixin(Screen parent, GameOptions gameOptions, Text title // This is supposed to be a quick and simple mod for snapshots, FAPI may not be available, // and there should be little harm in using a hardcoded string in english. private final Text changeBtnText = Text.of("Open Cape Editor"); - + @Inject( at = @At("TAIL"), method = "init()V") public void iTInject(CallbackInfo info) { - this.addDrawableChild(new ButtonWidget( - this.width - 155, this.height - 25, - 150, 20, - changeBtnText, - (btn) -> { - BigInteger intA = new BigInteger(128, new Random()); - BigInteger intB = new BigInteger(128, new Random(System.identityHashCode(new Object()))); - String serverId = intA.xor(intB).toString(16); - String url = String.format("https://optifine.net/capeChange?u=%s&n=%s&s=%s", this.client.getSession().getUuid(), this.client.getSession().getUsername(), serverId); - if(url == null) { - btn.active = false; - return; - } - Util.getOperatingSystem().open(url); - } - )); + ButtonWidget btn = ButtonWidget.builder(changeBtnText, button -> { + BigInteger intA = new BigInteger(128, new Random()); + BigInteger intB = new BigInteger(128, new Random(System.identityHashCode(new Object()))); + String serverId = intA.xor(intB).toString(16); + String url = String.format("https://optifine.net/capeChange?u=%s&n=%s&s=%s", this.client.getSession().getUuid(), this.client.getSession().getUsername(), serverId); + if(url == null) { + button.active = false; + return; + } + Util.getOperatingSystem().open(url); + }) + .dimensions(this.width - 155, this.height - 25, 150, 20) + .build(); + this.addDrawableChild(btn); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5dbbc56..c04419d 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -22,7 +22,7 @@ "ofcapes.mixins.json" ], "depends": { - "minecraft": "1.19.x" + "minecraft": "1.20.x" }, "custom": { "modmenu": {