geforkt von SteamWar/BungeeCore
Add TpCommand tabcompletions for Teamserver players not joining from SteamWar
Fix Tablist color for Teamserver players not joining from SteamWar
Dieser Commit ist enthalten in:
Ursprung
3d67919f0a
Commit
99f3ad5f03
@ -20,6 +20,7 @@
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.*;
|
||||
import de.steamwar.bungeecore.tablist.TablistManager;
|
||||
import de.steamwar.sql.*;
|
||||
import de.steamwar.bungeecore.util.BauLock;
|
||||
import de.steamwar.bungeecore.util.Chat19;
|
||||
@ -34,6 +35,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class TpCommand extends SWCommand {
|
||||
@ -65,7 +67,7 @@ public class TpCommand extends SWCommand {
|
||||
}
|
||||
|
||||
@Mapper("to")
|
||||
@Cached(cacheDuration = 10, global = true)
|
||||
@Cached(cacheDuration = 10)
|
||||
public TypeMapper<String> tabCompleter() {
|
||||
return new TypeMapper<String>() {
|
||||
@Override
|
||||
@ -86,6 +88,11 @@ public class TpCommand extends SWCommand {
|
||||
list.add(team.getTeamKuerzel());
|
||||
});
|
||||
}
|
||||
if (Storage.teamServers.containsValue(((ProxiedPlayer) sender).getServer().getInfo())) {
|
||||
Storage.directTabItems.getOrDefault((ProxiedPlayer) sender, new HashMap<>()).forEach((uuid, item) -> {
|
||||
list.add(item.getUsername());
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
};
|
||||
|
@ -218,7 +218,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
item.setDisplayName(new TextComponent());
|
||||
item.setListed(false);
|
||||
} else if (item.getDisplayName() == null) {
|
||||
item.setDisplayName(new TextComponent(item.getUsername()));
|
||||
item.setDisplayName(new TextComponent("§7" + item.getUsername()));
|
||||
}
|
||||
item.setPublicKey(null);
|
||||
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
|
||||
@ -273,7 +273,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
item.setDisplayName(new TextComponent());
|
||||
item.setListed(false);
|
||||
} else if (item.getDisplayName() == null) {
|
||||
item.setDisplayName(new TextComponent(item.getUsername()));
|
||||
item.setDisplayName(new TextComponent("§7" + item.getUsername()));
|
||||
}
|
||||
item.setPublicKey(null);
|
||||
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren