Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-06 08:10:12 +01:00
fix: address comment (from github)
Dieser Commit ist enthalten in:
Ursprung
ab60261842
Commit
6cf9be128d
@ -19,6 +19,7 @@ package com.velocitypowered.proxy.tablist;
|
|||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import com.velocitypowered.api.network.ProtocolVersion;
|
||||||
import com.velocitypowered.api.proxy.Player;
|
import com.velocitypowered.api.proxy.Player;
|
||||||
import com.velocitypowered.api.proxy.player.ChatSession;
|
import com.velocitypowered.api.proxy.player.ChatSession;
|
||||||
import com.velocitypowered.api.proxy.player.TabListEntry;
|
import com.velocitypowered.api.proxy.player.TabListEntry;
|
||||||
@ -128,6 +129,11 @@ public class VelocityTabList implements InternalTabList {
|
|||||||
actions.add(UpsertPlayerInfoPacket.Action.UPDATE_LISTED);
|
actions.add(UpsertPlayerInfoPacket.Action.UPDATE_LISTED);
|
||||||
playerInfoEntry.setListed(entry.isListed());
|
playerInfoEntry.setListed(entry.isListed());
|
||||||
}
|
}
|
||||||
|
if (!Objects.equals(previousEntry.getListOrder(), entry.getListOrder())
|
||||||
|
&& player.getProtocolVersion().noLessThan(ProtocolVersion.MINECRAFT_1_21_2)) {
|
||||||
|
actions.add(UpsertPlayerInfoPacket.Action.UPDATE_LIST_ORDER);
|
||||||
|
playerInfoEntry.setListOrder(entry.getListOrder());
|
||||||
|
}
|
||||||
if (!Objects.equals(previousEntry.getChatSession(), entry.getChatSession())) {
|
if (!Objects.equals(previousEntry.getChatSession(), entry.getChatSession())) {
|
||||||
ChatSession from = entry.getChatSession();
|
ChatSession from = entry.getChatSession();
|
||||||
if (from != null) {
|
if (from != null) {
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package com.velocitypowered.proxy.tablist;
|
package com.velocitypowered.proxy.tablist;
|
||||||
|
|
||||||
|
import com.velocitypowered.api.network.ProtocolVersion;
|
||||||
import com.velocitypowered.api.proxy.player.ChatSession;
|
import com.velocitypowered.api.proxy.player.ChatSession;
|
||||||
import com.velocitypowered.api.proxy.player.TabList;
|
import com.velocitypowered.api.proxy.player.TabList;
|
||||||
import com.velocitypowered.api.proxy.player.TabListEntry;
|
import com.velocitypowered.api.proxy.player.TabListEntry;
|
||||||
@ -161,9 +162,11 @@ public class VelocityTabListEntry implements TabListEntry {
|
|||||||
@Override
|
@Override
|
||||||
public VelocityTabListEntry setListOrder(int listOrder) {
|
public VelocityTabListEntry setListOrder(int listOrder) {
|
||||||
this.listOrder = listOrder;
|
this.listOrder = listOrder;
|
||||||
|
if (tabList.getPlayer().getProtocolVersion().noLessThan(ProtocolVersion.MINECRAFT_1_21_2)) {
|
||||||
UpsertPlayerInfoPacket.Entry upsertEntry = this.tabList.createRawEntry(this);
|
UpsertPlayerInfoPacket.Entry upsertEntry = this.tabList.createRawEntry(this);
|
||||||
upsertEntry.setListOrder(listOrder);
|
upsertEntry.setListOrder(listOrder);
|
||||||
this.tabList.emitActionRaw(UpsertPlayerInfoPacket.Action.UPDATE_LIST_ORDER, upsertEntry);
|
tabList.emitActionRaw(UpsertPlayerInfoPacket.Action.UPDATE_LIST_ORDER, upsertEntry);
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren