mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 13:07:29 +00:00
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.
This commit is contained in:
1 file changed
+4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user