diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java index 267fa19..d3c96ab 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java @@ -131,7 +131,7 @@ public class GUI { SteamwarUser owneruser = SteamwarUser.get(node.getOwner()); SWItem skull = SWItem.getPlayerSkull(owneruser.getUserName()); skull.setName("§7von §e" + owneruser.getUserName()); - inv.setItem(6, skull); + inv.setItem(6, skull.getItemStack(), clickType -> {}); inv.setItem(8, SWItem.getDye(1), (byte) 1, "§cZugriff entfernen", click -> { player.closeInventory(); diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index e5c40a8..a9a83c8 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -341,6 +341,11 @@ public class SchematicCommand extends SWCommand { SchematicCommandUtils.changeType(player, node, type, extend); } + @Register("move") + public void moveToNull(Player player, SchematicNode node) { + move(player, node, "/"); + } + @Register("move") public void move(Player player, SchematicNode node, @Mapper("dirStringMapper") String name) { SteamwarUser user = getUser(player); @@ -350,7 +355,7 @@ public class SchematicCommand extends SWCommand { } if (name.equals("/")) { - node.setParent(0); + node.setParent(null); } else { if (name.startsWith("/")) name = name.substring(1); if (name.endsWith("/")) name = name.substring(0, name.length() - 1); @@ -612,6 +617,21 @@ public class SchematicCommand extends SWCommand { }; } + @ClassMapper(value = SchematicNode.class, local = true) + public TypeMapper nodeTypeMapper() { + return new TypeMapper() { + @Override + public List tabCompletes(CommandSender commandSender, String[] strings, String s) { + return SchematicNode.getNodeTabcomplete(getUser((Player) commandSender), s); + } + + @Override + public SchematicNode map(CommandSender commandSender, String[] previousArguments, String s) { + return SchematicNode.getNodeFromPath(getUser((Player) commandSender), s); + } + }; + } + enum Extend { AUSFAHREN, NORMAL