Create full tablist packets

This commit is contained in:
fullwall 2022-12-14 22:46:26 +08:00
parent 1c4420398c
commit bc16fb9cc3
1 changed files with 3 additions and 3 deletions

View File

@ -1211,8 +1211,8 @@ public class NMSImpl implements NMSBridge {
ServerPlayer entity = ((CraftPlayer) listPlayer).getHandle();
ClientboundPlayerInfoUpdatePacket packet = new ClientboundPlayerInfoUpdatePacket(
EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER), Arrays.asList(entity));
ClientboundPlayerInfoUpdatePacket packet = ClientboundPlayerInfoUpdatePacket
.createPlayerInitializing(Arrays.asList(entity));
boolean list = entity instanceof NPCHolder
? !((NPCHolder) entity).getNPC().data().get("removefromtablist", Setting.DISABLE_TABLIST.asBoolean())
@ -1223,7 +1223,7 @@ public class NMSImpl implements NMSBridge {
entity.getChatSession() == null ? null : entity.getChatSession().asData());
try {
PLAYERINFO_ENTRIES.invoke(packet, Lists.newArrayList(entry, entry));
PLAYERINFO_ENTRIES.invoke(packet, Lists.newArrayList(entry));
} catch (Throwable e) {
e.printStackTrace();
}