From 8de16e966ca9540c3f671adb7517a0bdaf742462 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 21 Jan 2023 09:48:20 +0100 Subject: [PATCH] Fix: Schematic Search Command --- .../steamwar/schematicsystem/commands/SchematicCommand.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index 44efd0a..79a7ecc 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -303,7 +303,7 @@ public class SchematicCommand extends SWCommand { int finalI = i; switch (current) { case "-type": - predicates.add(node -> node.getSchemtype().name().equalsIgnoreCase(query[finalI + 1])); + predicates.add(node -> !node.isDir() && node.getSchemtype().name().equalsIgnoreCase(query[finalI + 1])); break; case "-item": predicates.add(node -> node.getItem().equalsIgnoreCase(query[finalI + 1])); @@ -320,7 +320,7 @@ public class SchematicCommand extends SWCommand { predicates.add(node -> !node.getName().contains(query[finalI + 1])); break; case "-excludeType": - predicates.add(node -> !node.getSchemtype().name().equalsIgnoreCase(query[finalI + 1])); + predicates.add(node -> !node.isDir() && !node.getSchemtype().name().equalsIgnoreCase(query[finalI + 1])); break; case "-excludeOwner": SteamwarUser steamwarUser1 = SteamwarUser.get(query[finalI + 1]); @@ -340,7 +340,7 @@ public class SchematicCommand extends SWCommand { i++; } - List nodes = SchematicNode.getAll(user).stream().filter(node -> { + List nodes = SchematicNode.getAll(SteamwarUser.get(userId)).stream().filter(node -> { for (Predicate predicate : predicates) { if (!predicate.test(node)) { return false;