From 7d8ba6675bc899ccf00c2086776ef8560bdf670d Mon Sep 17 00:00:00 2001 From: Chaos Date: Sat, 29 Jan 2022 14:39:44 +0100 Subject: [PATCH] Another Member Delete --- .../commands/SchematicCommand.java | 16 +++++++++++++++- .../commands/SchematicCommandHelp.java | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index 8e3202b..bc5d253 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -485,7 +485,21 @@ public class SchematicCommand extends SWCommand { player.sendMessage(SchematicSystem.PREFIX + "§7Alle Spieler wurden von der Schematic entfernt"); } - @Register("togglepublic") + @Register("delallmember") + public void delAllMember(Player player, SteamwarUser target) { + SteamwarUser user = getUser(player); + int i = 0; + for (NodeMember nodeMember : NodeMember.getSchematics(target.getId())) { + SchematicNode node = SchematicNode.getSchematicNode(nodeMember.getNode()); + if (node.getOwner() == user.getId()) { + nodeMember.delete(); + i++; + } + } + player.sendMessage(SchematicSystem.PREFIX + "§e" + target.getUserName() + " §7wurde von §e" + i + " §7Schematics entfernt"); + } + + @Register(value = "togglepublic", noTabComplete = true) public void togglePublicMode(Player player) { SteamwarUser user = SteamwarUser.get(player.getUniqueId()); if (!user.getUserGroup().isAdminGroup()) { diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandHelp.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandHelp.java index a05e0f6..871ed06 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandHelp.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommandHelp.java @@ -69,6 +69,7 @@ public class SchematicCommandHelp { "§8/§7schem §eaddmember §8[§7Schematic§8] §8[§7Spieler§8] - §7Fügt einen Spieler zu einer Schematic hinzu", "§8/§7schem §edelmember §8[§7Schematic§8] §8[§7Spieler§8] - §7Entfernt einen Spieler von einer Schematic", "§8/§7schem §eclearmember §8[§7Schematic§8] - §7Entfernt alle Spieler von der Schematic", + "§8/§7schem §edelallmember §8[§7Spieler§8] - §7Entfernt einen Spieler von allen deinen Schematics", "§8/§7schem §eaddteam §8[§7Schematic§8] - §7Füge jeden aus deinem Team auf die Schematic hinzu", "§8/§7schem §edelteam §8[§7Schematic§8] - §7Entferne jeden aus deinem Team von der Schematic" }); -- 2.39.2