Exclude vanished players from tab complete list

Part 2 of fixing #1745
This commit is contained in:
TfT_02
2014-02-28 21:55:32 +01:00
parent 53fdf750f4
commit e56d5a0454
14 changed files with 48 additions and 30 deletions

View File

@ -9,6 +9,7 @@ import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
@ -175,7 +176,7 @@ public class PartyCommand implements TabExecutor {
case INVITE:
case KICK:
case OWNER:
Set<String> playerNames = UserManager.getPlayerNames();
List<String> playerNames = CommandUtils.getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
case XPSHARE:
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<String>(XPSHARE_COMPLETIONS.size()));
@ -190,7 +191,10 @@ public class PartyCommand implements TabExecutor {
List<String> matches = StringUtil.copyPartialMatches(args[1], PtpCommand.TELEPORT_SUBCOMMANDS, new ArrayList<String>(PtpCommand.TELEPORT_SUBCOMMANDS.size()));
if (matches.size() == 0) {
playerNames = UserManager.getPlayerNames();
Player player = (Player) sender;
Party party = UserManager.getPlayer(player).getParty();
playerNames = party.getOnlinePlayerNames(player);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<String>(playerNames.size()));
}