From 6260eebcf7d23363ab3761a6521b6b506f223e8e Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 30 Dec 2021 12:50:29 +0100 Subject: [PATCH] Changing to Schem Nodes --- .../de/steamwar/bausystem/commands/CommandLockschem.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandLockschem.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandLockschem.java index 77b1233..6aebd98 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandLockschem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandLockschem.java @@ -27,8 +27,6 @@ import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.UserGroup; import org.bukkit.entity.Player; -import java.util.Optional; - public class CommandLockschem extends SWCommand { public CommandLockschem() { @@ -67,12 +65,11 @@ public class CommandLockschem extends SWCommand { p.sendMessage(BauSystem.PREFIX + "Dieser Spieler existiert nicht!"); return; } - Optional schematicOpt = SchematicNode.deepGet(schemOwner.getId(), node -> !node.getSchemtype().equals(SchematicType.Normal)).stream().findAny(); - if (!schematicOpt.isPresent()) { + SchematicNode node = SchematicNode.getNodeFromPath(schemOwner, schematicName); + if (node == null) { p.sendMessage(BauSystem.PREFIX + "Dieser Spieler besitzt keine Schematic mit diesem Namen!"); return; } - SchematicNode node = schematicOpt.get(); p.sendMessage(BauSystem.PREFIX + "Schematic " + node .getName() + " von " + SteamwarUser.get(node.getOwner()).getUserName() + " von " + node.getSchemtype().toString() + " auf NORMAL zurückgesetzt!");