Skip to content

Commit

Permalink
Update to 1.4.3 (1.20.4).
Browse files Browse the repository at this point in the history
  • Loading branch information
Coderx-Gamer authored Dec 31, 2023
1 parent f590b59 commit d759015
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.24
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.1
loader_version=0.15.0

# Mod Properties
mod_version = 1.4.2
mod_version = 1.4.3
maven_group = org.uiutils
archives_base_name = uiutils

# Dependencies
fabric_version=0.90.7+1.20.2
fabric_version=0.91.1+1.20.4
2 changes: 1 addition & 1 deletion src/main/java/org/uiutils/MainClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public static void createWidgets(MinecraftClient mc, Screen screen) {
if (mc.currentScreen == null) {
throw new IllegalStateException("The current minecraft screen (mc.currentScreen) is null");
}
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(Text.Serializer.toJson(mc.currentScreen.getTitle())), null);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(Text.Serialization.toJsonString(mc.currentScreen.getTitle())), null);
} catch (IllegalStateException e) {
LOGGER.error("Error while copying title JSON to clipboard", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public abstract class ClientCommonNetworkHandlerMixin {

@Inject(at = @At("HEAD"), method = "onResourcePackSend", cancellable = true)
public void onResourcePackSend(ResourcePackSendS2CPacket packet, CallbackInfo ci) {
if (SharedVariables.bypassResourcePack && (packet.isRequired() || SharedVariables.resourcePackForceDeny)) {
this.sendPacket(new ResourcePackStatusC2SPacket(ResourcePackStatusC2SPacket.Status.ACCEPTED));
this.sendPacket(new ResourcePackStatusC2SPacket(ResourcePackStatusC2SPacket.Status.SUCCESSFULLY_LOADED));
if (SharedVariables.bypassResourcePack && (packet.required() || SharedVariables.resourcePackForceDeny)) {
this.sendPacket(new ResourcePackStatusC2SPacket(MinecraftClient.getInstance().getSession().getUuidOrNull(), ResourcePackStatusC2SPacket.Status.ACCEPTED));
this.sendPacket(new ResourcePackStatusC2SPacket(MinecraftClient.getInstance().getSession().getUuidOrNull(), ResourcePackStatusC2SPacket.Status.SUCCESSFULLY_LOADED));
MainClient.LOGGER.info(
"[UI Utils]: Required Resource Pack Bypassed, Message: " +
(packet.getPrompt() == null ? "<no message>" : packet.getPrompt().getString()) +
", URL: " + (packet.getUrl() == null ? "<no url>" : packet.getUrl())
(packet.prompt() == null ? "<no message>" : packet.prompt().getString()) +
", URL: " + (packet.url() == null ? "<no url>" : packet.url())
);
ci.cancel();
}
Expand Down
22 changes: 12 additions & 10 deletions src/main/java/org/uiutils/mixin/MultiplayerScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ private MultiplayerScreenMixin() {

@Inject(at = @At("TAIL"), method = "init")
public void init(CallbackInfo ci) {
// Create "Bypass Resource Pack" option
this.addDrawableChild(ButtonWidget.builder(Text.of("Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")), (button) -> {
SharedVariables.bypassResourcePack = !SharedVariables.bypassResourcePack;
button.setMessage(Text.of("Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")));
}).width(160).position(this.width - 170, this.height - 50).build());
if (SharedVariables.enabled) {
// Create "Bypass Resource Pack" option
this.addDrawableChild(ButtonWidget.builder(Text.of("Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")), (button) -> {
SharedVariables.bypassResourcePack = !SharedVariables.bypassResourcePack;
button.setMessage(Text.of("Bypass Resource Pack: " + (SharedVariables.bypassResourcePack ? "ON" : "OFF")));
}).width(160).position(this.width - 170, this.height - 50).build());

// Create "Force Deny" option
this.addDrawableChild(ButtonWidget.builder(Text.of("Force Deny: " + (SharedVariables.resourcePackForceDeny ? "ON" : "OFF")), (button) -> {
SharedVariables.resourcePackForceDeny = !SharedVariables.resourcePackForceDeny;
button.setMessage(Text.of("Force Deny: " + (SharedVariables.resourcePackForceDeny ? "ON" : "OFF")));
}).width(160).position(this.width - 170, this.height - 25).build());
// Create "Force Deny" option
this.addDrawableChild(ButtonWidget.builder(Text.of("Force Deny: " + (SharedVariables.resourcePackForceDeny ? "ON" : "OFF")), (button) -> {
SharedVariables.resourcePackForceDeny = !SharedVariables.resourcePackForceDeny;
button.setMessage(Text.of("Force Deny: " + (SharedVariables.resourcePackForceDeny ? "ON" : "OFF")));
}).width(160).position(this.width - 170, this.height - 25).build());
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],

"depends": {
"fabricloader": ">=0.14.24",
"fabricloader": ">=0.15.0",
"fabric": "*",
"minecraft": "~1.20",
"java": ">=17"
Expand Down

0 comments on commit d759015

Please sign in to comment.