Skip to content

Commit 85b33af

Browse files
authored
prevent skip GC mixin in Minecraft#loadWorld from cancelling all the code at the end of the method (#163)
1 parent c906f55 commit 85b33af

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/main/java/org/embeddedt/archaicfix/mixins/client/core/MixinMinecraft.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public abstract class MixinMinecraft {
2525

2626
@Shadow public abstract void displayGuiScreen(GuiScreen p_147108_1_);
2727

28-
@Shadow public GuiScreen currentScreen;
29-
3028
@Shadow private boolean fullscreen;
3129

3230
/** @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) {
3533
return true;
3634
}
3735
/** @reason Removes a call to {@link System#gc()} to make world loading as fast as possible */
38-
@Inject(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At(value = "INVOKE", target = "Ljava/lang/System;gc()V"), cancellable = true)
39-
private void onSystemGC(WorldClient worldClient, String reason, CallbackInfo ci) {
40-
ci.cancel();
41-
}
36+
@Redirect(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At(value = "INVOKE", target = "Ljava/lang/System;gc()V"))
37+
private void onSystemGC() {}
4238

4339
@Inject(method = "checkGLError", at = @At("HEAD"), cancellable = true)
4440
private void skipErrorCheck(String msg, CallbackInfo ci) {

0 commit comments

Comments
 (0)