Fix WorldClient leak after leaving the world (#1115)

This commit is contained in:
slprime authored and GitHub committed 2026-11-10 19:22:17 +02:00
1 parent 9839d1d08f
commit fbbeafcd79
5 files changed
+42 -12

No files matched your search

@@ -137,7 +137,11 @@ public class ItemCraftablesPanel
@Override
public void execute() {
pendingResult.set(generateCraftables(ItemCraftablesPanel.this.pendingSnapshot));
final CraftablesSnapshot snapshot = ItemCraftablesPanel.this.pendingSnapshot;
if (snapshot != null) {
pendingResult.set(generateCraftables(snapshot));
}
}
};
@@ -298,6 +302,11 @@ public class ItemCraftablesPanel
}
}
public void clearGuiReferences() {
this.lastGuiContainer = null;
this.pendingSnapshot = null;
}
private GuiContainer getGuiContainer() {
final GuiContainer firstGui = NEIClientUtils.getGuiContainer();
return (firstGui instanceof GuiRecipe<?>gui) ? gui.firstGui : firstGui;