geforkt von Mirrors/Paper
Consider arguments to team leave properly. Fixes BUKKIT-3994
Two checks to argument length were changed to properly consider if the sender is a player instead of an off-by-one logical error. By: Wesley Wolfe <weswolf@aol.com>
Dieser Commit ist enthalten in:
Ursprung
0716e7a635
Commit
e5dec4f10e
@ -385,13 +385,13 @@ public class ScoreboardCommand extends VanillaCommand {
|
||||
sender.sendMessage("Added " + addedPlayers.size() + " player(s) to team " + team.getName() + ": " + stringCollectionToString(addedPlayers));
|
||||
}
|
||||
} else if (args[1].equalsIgnoreCase("leave")) {
|
||||
if ((sender instanceof Player) ? args.length < 2 : args.length < 3) {
|
||||
if (!(sender instanceof Player) && args.length < 3) {
|
||||
sender.sendMessage(ChatColor.RED + "/scoreboard teams leave [player...]");
|
||||
return false;
|
||||
}
|
||||
Set<String> left = new HashSet<String>();
|
||||
Set<String> noTeam = new HashSet<String>();
|
||||
if ((sender instanceof Player) && args.length == 3) {
|
||||
if ((sender instanceof Player) && args.length == 2) {
|
||||
Team team = mainScoreboard.getPlayerTeam((Player) sender);
|
||||
if (team != null) {
|
||||
team.removePlayer((Player) sender);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren