diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index 76a1ce6..d4491f6 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -21,13 +21,8 @@ package de.steamwar.schematicsystem.commands; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; -import de.steamwar.comms.packets.PrepareSchemPacket; import de.steamwar.inventory.SWAnvilInv; -import de.steamwar.inventory.SWInventory; -import de.steamwar.inventory.SWItem; import de.steamwar.inventory.SchematicSelector; -import de.steamwar.schematicsystem.AutoCheckResult; -import de.steamwar.schematicsystem.CheckSchemType; import de.steamwar.schematicsystem.SchematicSystem; import de.steamwar.sql.*; import net.md_5.bungee.api.ChatColor; @@ -254,7 +249,6 @@ public class SchematicCommand extends SWCommand { } @Register("delmember") - @Register("remmember") public void delMember(Player player, SchematicNode node, @Mapper("memberMapper") NodeMember member) { SteamwarUser user = getUser(player); @@ -274,22 +268,22 @@ public class SchematicCommand extends SWCommand { } member.delete(); - player.sendMessage(SchematicSystem.PREFIX + "Der Spieler §e" + target.getUserName() + " §7hat nun keinen zugriff mehr auf die Schematic §e" + node.generateBreadcrumbs(user)); + player.sendMessage(SchematicSystem.PREFIX + "Der Spieler §e" + target.getUserName() + " §7hat nun keinen Zugriff mehr auf die Schematic §e" + node.generateBreadcrumbs(user)); Player t = Bukkit.getPlayer(target.getUUID()); if (t != null) { - t.sendMessage(SchematicSystem.PREFIX + "Du hast nun keinen zugriff mehr auf die Schematic §e" + node.getName() + " §7von §e" + player.getName()); + t.sendMessage(SchematicSystem.PREFIX + "Du hast nun keinen Zugriff mehr auf die Schematic §e" + node.getName() + " §7von §e" + player.getName()); } } @Register("search") - public void schemSearch(Player player, String quarry) { + public void schemSearch(Player player, String query) { SteamwarUser user = getUser(player); - List nodes = SchematicNode.filterSchems(user.getId(), node -> node.getName().contains(quarry)); + List nodes = SchematicNode.filterSchems(user.getId(), node -> node.getName().contains(query)); player.sendMessage("§eSchematics §8(§e" + nodes.size() + "§8)"); nodes.forEach(node -> { String br = node.generateBreadcrumbs(user); - TextComponent schematics = new TextComponent("§7" + br.replace(quarry, "§e§l" + quarry + "§7")); + TextComponent schematics = new TextComponent("§7" + br.replace(query, "§e§l" + query + "§7")); schematics.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§eSchematic verwalten").create())); schematics.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem info " + br)); @@ -422,7 +416,7 @@ public class SchematicCommand extends SWCommand { } } - @Register("remteam") + @Register("delteam") public void remTeam(Player player, SchematicNode node) { SteamwarUser user = getUser(player); if (node.getOwner() != user.getId()) { @@ -453,7 +447,6 @@ public class SchematicCommand extends SWCommand { } } - @Register("remallmember") @Register("clearmember") public void clearMember(Player player, SchematicNode node) { SteamwarUser user = getUser(player); diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java index a283ff4..92d099f 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandUtils.java @@ -331,7 +331,11 @@ public class SchematicCommandUtils { return; } - if (node.getType().equals(type.toDB())) { + if(!type.isAssignable()) { + player.sendMessage(SchematicSystem.PREFIX + "§cZu diesem Typen können keine Schematics geändert werden."); + } + + if (node.getSchemtype().equals(type)) { player.sendMessage(SchematicSystem.PREFIX + "§cDie Schematic hat schon diesen Typen"); return; }