Skip to content

Commit

Permalink
Need to send two packets
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Dec 13, 2022
1 parent d49781d commit 1c44203
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1212,9 +1212,7 @@ public boolean sendTabListAdd(Player recipient, Player listPlayer) {
ServerPlayer entity = ((CraftPlayer) listPlayer).getHandle();

ClientboundPlayerInfoUpdatePacket packet = new ClientboundPlayerInfoUpdatePacket(
EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER,
ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED),
Arrays.asList(entity));
EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER), Arrays.asList(entity));

boolean list = entity instanceof NPCHolder
? !((NPCHolder) entity).getNPC().data().get("removefromtablist", Setting.DISABLE_TABLIST.asBoolean())
Expand All @@ -1225,7 +1223,7 @@ public boolean sendTabListAdd(Player recipient, Player listPlayer) {
entity.getChatSession() == null ? null : entity.getChatSession().asData());

try {
PLAYERINFO_ENTRIES.invoke(packet, Lists.newArrayList(entry));
PLAYERINFO_ENTRIES.invoke(packet, Lists.newArrayList(entry, entry));
} catch (Throwable e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 1c44203

Please sign in to comment.