diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBau.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBau.java index 4bdc212..a02e6bb 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBau.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandBau.java @@ -27,7 +27,6 @@ import de.steamwar.command.TypeMapper; import de.steamwar.sql.BauweltMember; import de.steamwar.sql.SteamwarUser; import java.util.stream.Collectors; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -51,19 +50,25 @@ public class CommandBau extends SWCommand { @Register("togglebuild") public void toggleBuildCommand(Player p, SteamwarUser user) { - if (!permissionCheck(p)) return; + if (!permissionCheck(p)) { + return; + } onToggleBD(p, user); } @Register("togglewe") public void toggleWECommand(Player p, SteamwarUser user) { - if (!permissionCheck(p)) return; + if (!permissionCheck(p)) { + return; + } onToggleWE(p, user); } @Register("toggleworld") public void toggleWorldCommand(Player p, SteamwarUser user) { - if (!permissionCheck(p)) return; + if (!permissionCheck(p)) { + return; + } onToggleWorld(p, user); } @@ -128,9 +133,15 @@ public class CommandBau extends SWCommand { .filter(u -> u.getUserName().equals(s)) .findFirst() .orElse(null), - s -> BauweltMember.getMembers(BauSystem.getOwnerID()) - .stream() - .map(m -> SteamwarUser.get(m.getMemberID()).getUserName()) - .collect(Collectors.toList())); + (c, s) -> { + if (!(c instanceof Player)) { + return null; + } + Player p = (Player) c; + return BauweltMember.getMembers(SteamwarUser.get(p.getUniqueId()).getId()) + .stream() + .map(m -> SteamwarUser.get(m.getMemberID()).getUserName()) + .collect(Collectors.toList()); + }); } } \ No newline at end of file