From b75cc6a00d7bce57c875a71c9bd014284b799ee4 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 30 Sep 2020 15:00:38 +0200 Subject: [PATCH] Fix Self Add --- src/de/steamwar/bungeecore/commands/BauCommand.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/de/steamwar/bungeecore/commands/BauCommand.java b/src/de/steamwar/bungeecore/commands/BauCommand.java index 84ab0be2..045e1bb8 100644 --- a/src/de/steamwar/bungeecore/commands/BauCommand.java +++ b/src/de/steamwar/bungeecore/commands/BauCommand.java @@ -120,6 +120,9 @@ public class BauCommand { if (target == null) { BungeeCore.send(p, UNKNOWN_PLAYER); return; + }else if(target.getUuid().equals(p.getUniqueId())) { + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu brauchst dich nicht selbst hinzufügen!"); + return; }else if (BauweltMember.getBauMember(p.getUniqueId(), target.getUuid()) != null) { BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDieser Spieler ist bereits Mitglied auf deiner Welt"); return; @@ -216,6 +219,11 @@ public class BauCommand { if(target == null) return; + if(SteamwarUser.get(target.getMemberID()).getUuid().equals(p.getUniqueId())) { + BungeeCore.send(p, BungeeCore.CHAT_PREFIX + "§cDu kannst dich nicht selbst entfernen!"); + return; + } + target.remove(); ProxiedPlayer z = ProxyServer.getInstance().getPlayer(SteamwarUser.get(target.getMemberID()).getUuid()); if(z != null){