diff --git a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java index 555a615..f781f09 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java +++ b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java @@ -81,7 +81,9 @@ public class Schematic { public static List getSchemsAccessibleByUser(int schemOwner){ List schematics = new ArrayList<>(); SchematicNode.getSchematicsAccessibleByUser(schemOwner, null) - .forEach(node1 -> schematics.add(new Schematic(node1))); + .forEach(node1 -> { + if (!node1.isDir()) schematics.add(new Schematic(node1)); + }); return schematics; } @@ -92,7 +94,9 @@ public class Schematic { public static List getSchemsOfType(int schemOwner, SchematicType schemType){ List schematics = new ArrayList<>(); SchematicNode.getSchematicsOfType(schemOwner, schemType.toDB(), null) - .forEach(node1 -> schematics.add(new Schematic(node1))); + .forEach(node1 -> { + if (!node1.isDir()) schematics.add(new Schematic(node1)); + }); return schematics; } diff --git a/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java b/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java index 3f124e9..c86274a 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java +++ b/SpigotCore_Main/src/de/steamwar/sql/SchematicNode.java @@ -186,7 +186,7 @@ public class SchematicNode { public static List getSchematicsOfType(int owner, String schemType, Integer parent) { List schems = getAllSchematicsAccessibleByUser(owner); - schems.removeIf(node -> !node.getType().equals(schemType)); + schems.removeIf(node -> node.isDir() || !node.getType().equals(schemType)); Map nodesInParent = new LinkedHashMap<>(); for (SchematicNode schematicNode : schems) { SchematicNode currentNode = schematicNode;