updated bau toggle-commands tab completion to tab complete adequately for executing user
Dieser Commit ist enthalten in:
Ursprung
9b1f4433ca
Commit
73d492cdf0
@ -27,7 +27,6 @@ import de.steamwar.command.TypeMapper;
|
|||||||
import de.steamwar.sql.BauweltMember;
|
import de.steamwar.sql.BauweltMember;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
@ -51,19 +50,25 @@ public class CommandBau extends SWCommand {
|
|||||||
|
|
||||||
@Register("togglebuild")
|
@Register("togglebuild")
|
||||||
public void toggleBuildCommand(Player p, SteamwarUser user) {
|
public void toggleBuildCommand(Player p, SteamwarUser user) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onToggleBD(p, user);
|
onToggleBD(p, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("togglewe")
|
@Register("togglewe")
|
||||||
public void toggleWECommand(Player p, SteamwarUser user) {
|
public void toggleWECommand(Player p, SteamwarUser user) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onToggleWE(p, user);
|
onToggleWE(p, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register("toggleworld")
|
@Register("toggleworld")
|
||||||
public void toggleWorldCommand(Player p, SteamwarUser user) {
|
public void toggleWorldCommand(Player p, SteamwarUser user) {
|
||||||
if (!permissionCheck(p)) return;
|
if (!permissionCheck(p)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
onToggleWorld(p, user);
|
onToggleWorld(p, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,9 +133,15 @@ public class CommandBau extends SWCommand {
|
|||||||
.filter(u -> u.getUserName().equals(s))
|
.filter(u -> u.getUserName().equals(s))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null),
|
.orElse(null),
|
||||||
s -> BauweltMember.getMembers(BauSystem.getOwnerID())
|
(c, s) -> {
|
||||||
|
if (!(c instanceof Player)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Player p = (Player) c;
|
||||||
|
return BauweltMember.getMembers(SteamwarUser.get(p.getUniqueId()).getId())
|
||||||
.stream()
|
.stream()
|
||||||
.map(m -> SteamwarUser.get(m.getMemberID()).getUserName())
|
.map(m -> SteamwarUser.get(m.getMemberID()).getUserName())
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toList());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren