From e428a1285f891cf3917367488d7211c5fc580dc0 Mon Sep 17 00:00:00 2001 From: Chaos Date: Thu, 13 Jan 2022 22:21:59 +0100 Subject: [PATCH] Fix Saving to Schem-Ordner --- .../schematicsystem/commands/SchematicCommand.java | 11 ++++++++--- 1 file changed, 8 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 2e5ee0f..09a7c09 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -145,9 +145,14 @@ public class SchematicCommand extends SWCommand { SchematicNode currentNode = mkdirs(layers, user, 1); SchematicNode node = SchematicNode.getNodeFromPath(user, String.join("/", layers)); - if (node != null && !node.getSchemtype().writeable() && node.getOwner() != user.getId()) { - player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst diese Schematic nicht überschreiben"); - return; + if (node != null) { + if(node.isDir()) { + player.sendMessage(SchematicSystem.PREFIX + "§cDie Schematic ist ein Ordner"); + return; + } else if (!node.getSchemtype().writeable() || node.getOwner() != user.getId()) { + player.sendMessage(SchematicSystem.PREFIX + "§cDu darfst diese Schematic nicht überschreiben"); + return; + } } boolean newSchem = false;