From eac749c06bd9caec081ee3f38c448ea4d8fcd66a Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Mon, 6 Apr 2026 11:14:02 +0200 Subject: [PATCH] prevent skip GC mixin in Minecraft#loadWorld from cancelling all the code at the end of the method --- .../archaicfix/mixins/client/core/MixinMinecraft.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/embeddedt/archaicfix/mixins/client/core/MixinMinecraft.java b/src/main/java/org/embeddedt/archaicfix/mixins/client/core/MixinMinecraft.java index 6901aa0..dc8e38f 100644 --- a/src/main/java/org/embeddedt/archaicfix/mixins/client/core/MixinMinecraft.java +++ b/src/main/java/org/embeddedt/archaicfix/mixins/client/core/MixinMinecraft.java @@ -25,8 +25,6 @@ public abstract class MixinMinecraft { @Shadow public abstract void displayGuiScreen(GuiScreen p_147108_1_); - @Shadow public GuiScreen currentScreen; - @Shadow private boolean fullscreen; /** @reason Makes grass display as fancy regardless of the graphics setting. Matches the appearance of 1.8+ */ @@ -35,10 +33,8 @@ private boolean getFancyGrass(GameSettings gameSettings) { return true; } /** @reason Removes a call to {@link System#gc()} to make world loading as fast as possible */ - @Inject(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At(value = "INVOKE", target = "Ljava/lang/System;gc()V"), cancellable = true) - private void onSystemGC(WorldClient worldClient, String reason, CallbackInfo ci) { - ci.cancel(); - } + @Redirect(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At(value = "INVOKE", target = "Ljava/lang/System;gc()V")) + private void onSystemGC() {} @Inject(method = "checkGLError", at = @At("HEAD"), cancellable = true) private void skipErrorCheck(String msg, CallbackInfo ci) {