diff --git a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java index a2cc1955c..115261a71 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabList.java @@ -19,6 +19,7 @@ package com.velocitypowered.proxy.tablist; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; +import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.player.ChatSession; import com.velocitypowered.api.proxy.player.TabListEntry; @@ -128,6 +129,11 @@ public class VelocityTabList implements InternalTabList { actions.add(UpsertPlayerInfoPacket.Action.UPDATE_LISTED); 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())) { ChatSession from = entry.getChatSession(); if (from != null) { diff --git a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListEntry.java b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListEntry.java index 182825538..352d62716 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListEntry.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/tablist/VelocityTabListEntry.java @@ -17,6 +17,7 @@ package com.velocitypowered.proxy.tablist; +import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.proxy.player.ChatSession; import com.velocitypowered.api.proxy.player.TabList; import com.velocitypowered.api.proxy.player.TabListEntry; @@ -161,9 +162,11 @@ public class VelocityTabListEntry implements TabListEntry { @Override public VelocityTabListEntry setListOrder(int listOrder) { this.listOrder = listOrder; - UpsertPlayerInfoPacket.Entry upsertEntry = this.tabList.createRawEntry(this); - upsertEntry.setListOrder(listOrder); - this.tabList.emitActionRaw(UpsertPlayerInfoPacket.Action.UPDATE_LIST_ORDER, upsertEntry); + if (tabList.getPlayer().getProtocolVersion().noLessThan(ProtocolVersion.MINECRAFT_1_21_2)) { + UpsertPlayerInfoPacket.Entry upsertEntry = this.tabList.createRawEntry(this); + upsertEntry.setListOrder(listOrder); + tabList.emitActionRaw(UpsertPlayerInfoPacket.Action.UPDATE_LIST_ORDER, upsertEntry); + } return this; }