Skip to content

Commit

Permalink
Updated mappings to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SuchBlue committed Jul 14, 2023
1 parent 11c2404 commit 3e9fd6f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
fabric_version=0.83.0+1.20.1
32 changes: 15 additions & 17 deletions src/main/java/net/drago/ofcapes/mixin/SkinOptionsScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"ofcapes.mixins.json"
],
"depends": {
"minecraft": "1.19.x"
"minecraft": "1.20.x"
},
"custom": {
"modmenu": {
Expand Down

0 comments on commit 3e9fd6f

Please sign in to comment.