From 6535e4f81e4a8774eb20ace6ad794a4abe1db6f4 Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Thu, 25 Apr 2019 01:22:51 +0200 Subject: [PATCH] hotfixes Signed-off-by: yaruma3341 --- .../commands/SchematicCommand.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/de/warking/schematicsystem/commands/SchematicCommand.java b/src/de/warking/schematicsystem/commands/SchematicCommand.java index f57a00d..30e514f 100644 --- a/src/de/warking/schematicsystem/commands/SchematicCommand.java +++ b/src/de/warking/schematicsystem/commands/SchematicCommand.java @@ -78,6 +78,11 @@ public class SchematicCommand implements CommandExecutor { try { Actor actor = SchematicSystem.getWorldEditPlugin().wrapCommandSender(player); + File folder = new File(SchematicSystem.SCHEM_DIR + player.getUniqueId().toString() + "/"); + if(!folder.exists()) { + player.sendMessage(SchematicSystem.PREFIX + "§cDie angegebene Schematic existiert nicht!"); + return false; + } File file; if(WarkingUser.get(schematic.getSchemOwner()).getUUID() != player.getUniqueId()) { @@ -177,8 +182,17 @@ public class SchematicCommand implements CommandExecutor { File folder = new File(SchematicSystem.SCHEM_DIR + player.getUniqueId().toString() + "/"); - if(!folder.exists()) + if(!folder.exists()) { folder.mkdir(); + Files.setPosixFilePermissions(folder.toPath(), + EnumSet.of(PosixFilePermission.OWNER_READ, + PosixFilePermission.OWNER_WRITE, + PosixFilePermission.GROUP_READ, + PosixFilePermission.OTHERS_READ, + PosixFilePermission.OTHERS_WRITE, + PosixFilePermission.OWNER_EXECUTE, + PosixFilePermission.OTHERS_EXECUTE)); + } File file = new File(folder, args[1] + ".schematic"); file.createNewFile();