From bfbf98c1d61e55442bb2095d113a58463dc5116c Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 23 Oct 2026 11:05:28 +0200 Subject: [PATCH] Fix GUI.schemDialog for overriden Public list --- .../src/de/steamwar/fightsystem/commands/GUI.java | 10 +++++++++- .../src/de/steamwar/inventory/SchematicSelector.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java index a65886b0..c70fbeca 100644 --- a/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java +++ b/FightSystem/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java @@ -255,7 +255,15 @@ public class GUI { private static void schemDialog(Player p, SchematicType type, boolean publicSchems, boolean unchecked) { SchematicSelector selector = new SchematicSelector(p, Config.test() ? SchematicSelector.selectSchematic() : SchematicSelector.selectSchematicType(unchecked ? type.checkType() : type), node -> { schemSelect(p, node); - }); + }) { + @Override + protected List getSchematicList(SchematicNode parent) { + if (!publicSchems || parent != null) return super.getSchematicList(parent); + List publics = Config.GameModeConfig.Schematic.Publics; + if (publics.isEmpty()) return super.getSchematicList(null); + return publics.stream().map(SchematicNode::byId).collect(Collectors.toList()); + } + }; selector.setPublicMode(publicSchems ? SchematicSelector.PublicMode.PUBLIC_ONLY : SchematicSelector.PublicMode.PRIVATE_ONLY); selector.open(); } diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java index 5d649766..59df352e 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/inventory/SchematicSelector.java @@ -467,7 +467,7 @@ public class SchematicSelector { return nodes; } - private List getSchematicList(SchematicNode parent) { + protected List getSchematicList(SchematicNode parent) { List nodes = new ArrayList<>(); switch (target.target) { case DIRECTORY: