From f6114dfa5e06c7a651587f9c92ae0abbb3ec42dd Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 2 Jan 2026 09:43:12 +0000 Subject: [PATCH] Fix NPC biome spawn settings not persisting after editing When users modified biomes, dimensions, or spawning options through the sub-GUI dialogs, changes were only stored in client memory and never sent to the server. This caused spawn configurations to appear correct in the UI but fail to work after server restarts. The closeSubGui() method now calls save() when SubGuiNpcBiomes, SubGuiNpcDimensions, or SubGuiSpawningOptions dialogs close, ensuring changes are immediately sent to the server via NaturalSpawnSavePacket. Added @Override annotation for consistency with other GUI classes. --- .../noppes/npcs/client/gui/global/GuiNpcNaturalSpawns.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/noppes/npcs/client/gui/global/GuiNpcNaturalSpawns.java b/src/main/java/noppes/npcs/client/gui/global/GuiNpcNaturalSpawns.java index a5ebd6e1f..41e105a38 100644 --- a/src/main/java/noppes/npcs/client/gui/global/GuiNpcNaturalSpawns.java +++ b/src/main/java/noppes/npcs/client/gui/global/GuiNpcNaturalSpawns.java @@ -262,6 +262,7 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I public void setSelected(String selected) { } + @Override public void closeSubGui(SubGuiInterface gui) { super.closeSubGui(gui); if (gui instanceof GuiNpcMobSpawnerSelector && this.spawnEntryScroll.hasSelected()) { @@ -270,6 +271,9 @@ public class GuiNpcNaturalSpawns extends GuiNPCInterface2 implements IGuiData, I this.spawn.spawnCompounds.put(selected, selector.getCompound()); initGui(); } + if (gui instanceof SubGuiNpcBiomes || gui instanceof SubGuiNpcDimensions || gui instanceof SubGuiSpawningOptions) { + save(); + } } @Override