13
0
geforkt von Mirrors/Velocity

Fix TabList population

Bug reported by JakubBien on Discord
Dieser Commit ist enthalten in:
Andrew Steinborn 2021-08-17 13:30:10 -04:00
Ursprung ec4d2d45a1
Commit 6d4cb3b18f
3 geänderte Dateien mit 6 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -211,7 +211,8 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler {
@Override
public boolean handle(PlayerListItem packet) {
return !serverConn.getPlayer().getTabList().processBackendPacket(packet);
serverConn.getPlayer().getTabList().processBackendPacket(packet);
return false;
}
@Override

Datei anzeigen

@ -129,9 +129,8 @@ public class VelocityTabList implements TabList {
* Processes a tab list entry packet from the backend.
*
* @param packet the packet to process
* @return {@code true} to forward the packet on, {@code false} otherwise
*/
public boolean processBackendPacket(PlayerListItem packet) {
public void processBackendPacket(PlayerListItem packet) {
// Packets are already forwarded on, so no need to do that here
for (PlayerListItem.Item item : packet.getItems()) {
UUID uuid = item.getUuid();
@ -150,13 +149,13 @@ public class VelocityTabList implements TabList {
if (name == null || properties == null) {
throw new IllegalStateException("Got null game profile for ADD_PLAYER");
}
return entries.putIfAbsent(item.getUuid(), (VelocityTabListEntry) TabListEntry.builder()
entries.putIfAbsent(item.getUuid(), (VelocityTabListEntry) TabListEntry.builder()
.tabList(this)
.profile(new GameProfile(uuid, name, properties))
.displayName(item.getDisplayName())
.latency(item.getLatency())
.gameMode(item.getGameMode())
.build()) == null;
.build());
}
case PlayerListItem.REMOVE_PLAYER:
entries.remove(uuid);
@ -187,7 +186,6 @@ public class VelocityTabList implements TabList {
break;
}
}
return true;
}
void updateEntry(int action, TabListEntry entry) {

Datei anzeigen

@ -72,7 +72,7 @@ public class VelocityTabListLegacy extends VelocityTabList {
}
@Override
public boolean processBackendPacket(PlayerListItem packet) {
public void processBackendPacket(PlayerListItem packet) {
Item item = packet.getItems().get(0); // Only one item per packet in 1.7
switch (packet.getAction()) {
@ -102,8 +102,6 @@ public class VelocityTabListLegacy extends VelocityTabList {
// For 1.7 there is only add and remove
break;
}
return true;
}
@Override