geforkt von SteamWar/BungeeCore
Fix Tablist
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
f270d4197b
Commit
6dd35a265b
@ -89,8 +89,8 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
|
||||
if(tabItem == null) {
|
||||
tablist.add(0, item);
|
||||
} else if(!tabItem.getDisplayName().equals(wrapName(item.getDisplayName()))) {
|
||||
tabItem.setDisplayName(wrapName(item.getDisplayName()));
|
||||
} else if(!tabItem.getDisplayName().equals(item.getDisplayName())) {
|
||||
tabItem.setDisplayName(item.getDisplayName());
|
||||
tabItem.setListed(true);
|
||||
update.add(tabItem);
|
||||
}
|
||||
@ -126,13 +126,13 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
TablistPart.Item item = tablist.get(i);
|
||||
if(!Arrays.equals(tabItem.getProperties(), item.getProperties())) {
|
||||
tabItem.setProperties(item.getProperties());
|
||||
tabItem.setDisplayName(wrapName(item.getDisplayName()));
|
||||
tabItem.setDisplayName(item.getDisplayName());
|
||||
add.add(tabItem);
|
||||
if(current.size() > i) {
|
||||
remove.add(tabItem);
|
||||
}
|
||||
} else if(!item.getDisplayName().equals(tabItem.getDisplayName())) {
|
||||
tabItem.setDisplayName(wrapName(item.getDisplayName()));
|
||||
tabItem.setDisplayName(item.getDisplayName());
|
||||
update.add(tabItem);
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
case ADD_PLAYER:
|
||||
for (PlayerListItem.Item item : list.getItems()) {
|
||||
item.setPing(1);
|
||||
item.setDisplayName(wrapName(""));
|
||||
item.setDisplayName(new TextComponent());
|
||||
item.setListed(false);
|
||||
item.setPublicKey(null);
|
||||
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
|
||||
@ -262,7 +262,7 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
case ADD_PLAYER:
|
||||
for (PlayerListItem.Item item : list.getItems()) {
|
||||
item.setPing(1);
|
||||
item.setDisplayName(wrapName(""));
|
||||
item.setDisplayName(new TextComponent());
|
||||
item.setListed(false);
|
||||
item.setPublicKey(null);
|
||||
if(!player.getUniqueId().equals(item.getUuid()) && item.getGamemode() == 3)
|
||||
@ -304,10 +304,6 @@ public class Tablist extends MessageToMessageDecoder<PacketWrapper> {
|
||||
return player.getPendingConnection().getVersion() < ProtocolConstants.MINECRAFT_1_19_3;
|
||||
}
|
||||
|
||||
private BaseComponent wrapName(String name) {
|
||||
return new TextComponent(name);
|
||||
}
|
||||
|
||||
private void sendTabPacket(List<PlayerListItem.Item> items, PlayerListItem.Action action) { //Breaks in 1.19.3 if action != UPDATE_DISPLAY_NAME, ADD_PLAYER or REMOVE_PLAYER
|
||||
if(!items.isEmpty()) {
|
||||
if(oldTab()) {
|
||||
|
@ -22,9 +22,9 @@ package de.steamwar.bungeecore.tablist;
|
||||
import de.steamwar.messages.ChatSender;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.UserPerm;
|
||||
import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.chat.ComponentSerializer;
|
||||
import net.md_5.bungee.connection.InitialHandler;
|
||||
import net.md_5.bungee.connection.LoginResult;
|
||||
import net.md_5.bungee.protocol.Property;
|
||||
@ -47,7 +47,7 @@ interface TablistPart {
|
||||
}
|
||||
|
||||
private final UUID uuid;
|
||||
private final String displayName;
|
||||
private final BaseComponent displayName;
|
||||
private final Property[] properties;
|
||||
|
||||
public Item(UUID uuid, String displayName, Property[] properties) {
|
||||
@ -75,7 +75,7 @@ interface TablistPart {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
public BaseComponent getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
@ -83,8 +83,8 @@ interface TablistPart {
|
||||
return properties;
|
||||
}
|
||||
|
||||
private String reformat(String string) {
|
||||
return ComponentSerializer.toString(TextComponent.fromLegacyText(string));
|
||||
private BaseComponent reformat(String string) {
|
||||
return TextComponent.fromArray(TextComponent.fromLegacyText(string));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren