Fix button disappearing when pin state is changed (#854)

Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
Kogepan229andMartin Robertz authored and GitHub committed 2025-09-21 14:43:21 +02:00
1 parent 4c2e3bd483
commit 8a5ef45ab7
3 files changed
+28 -22

No files matched your search

@@ -17,6 +17,8 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent;
import net.minecraftforge.common.MinecraftForge;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
@@ -248,8 +250,11 @@ public class GuiMEMonitorable extends AEBaseMEGui
private void reinitalize() {
memoryText = this.searchField.getText();
this.buttonList.clear();
this.initGui();
if (!MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Pre(this, this.buttonList))) {
this.buttonList.clear();
this.initGui();
}
MinecraftForge.EVENT_BUS.post(new InitGuiEvent.Post(this, this.buttonList));
}
@Override