Need to send two packets

This commit is contained in:
fullwall 2022-12-13 22:20:38 +08:00
parent d49781d090
commit 1c4420398c

View File

@ -1212,9 +1212,7 @@ public class NMSImpl implements NMSBridge {
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())
@ -1225,7 +1223,7 @@ public class NMSImpl implements NMSBridge {
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();
}