@Override public void onUpdate(PlayerListItem playerListItem) { for ( PlayerListItem.Item item : playerListItem.getItems() ) { if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) { uuids.add( item.getUuid() ); } else if ( playerListItem.getAction() == PlayerListItem.Action.REMOVE_PLAYER ) { uuids.remove( item.getUuid() ); } } player.unsafe().sendPacket( playerListItem ); }
public PlayerListPacketWrapper wrapPlayerListPacket(PlayerListItem packet) { return new PlayerListPacketWrapper(packet.getAction(), Arrays.stream(packet.getItems()).map(this::wrapTabListItem).collect(Collectors.toCollection(ArrayList::new))); }
@Override public PacketListenerResult onPlayerListPacket(PlayerListItem packet) { if (packet.getAction() == PlayerListItem.Action.ADD_PLAYER) { for (PlayerListItem.Item item : packet.getItems()) { serverTabListEntryNames.add(getName(item)); serverTabList.put(getName(item), item.getPing()); } } else { for (PlayerListItem.Item item : packet.getItems()) { serverTabListEntryNames.remove(getName(item)); serverTabList.remove(getName(item)); } } return passThrough ? PacketListenerResult.PASS : PacketListenerResult.CANCEL; }
public static PlayerListItem rewrite(PlayerListItem playerListItem) for ( PlayerListItem.Item item : playerListItem.getItems() )
@Override protected void sendPacket(DefinedPacket packet) { if (!onlineMode && packet instanceof PlayerListItem) { PlayerListItem pli = (PlayerListItem) packet; if (pli.getAction() == PlayerListItem.Action.ADD_PLAYER) { for (PlayerListItem.Item item : pli.getItems()) { if (fakePlayerUUIDSet.contains(item.getUuid())) { item.setProperties(EMPTY_PROPRTIES); } } } } player.unsafe().sendPacket(packet); }
@Override public PacketListenerResult onPlayerListPacket(PlayerListItem packet) { if (packet.getAction() == PlayerListItem.Action.ADD_PLAYER || packet.getAction() == PlayerListItem.Action.UPDATE_GAMEMODE) { for (PlayerListItem.Item item : packet.getItems()) { if (userConnection.getUniqueId().equals(item.getUuid())) { userConnection.setGamemode(item.getGamemode()); } } } return super.onPlayerListPacket(packet); } }
@Override public void onUpdate(PlayerListItem playerListItem) { for ( PlayerListItem.Item item : playerListItem.getItems() ) { if ( playerListItem.getAction() == PlayerListItem.Action.ADD_PLAYER ) { if ( item.getUuid() != null ) { uuids.add( item.getUuid() ); } else { usernames.add( item.getUsername() ); } } else if ( playerListItem.getAction() == PlayerListItem.Action.REMOVE_PLAYER ) { if ( item.getUuid() != null ) { uuids.remove( item.getUuid() ); } else { usernames.remove( item.getUsername() ); } } } player.unsafe().sendPacket( playerListItem ); }
for (PlayerListItem.Item item : packet.getItems()) { UUID uuid = item.getUuid(); UserConnection player = BungeeCord.getInstance().getPlayerByOfflineUUID(uuid); for (PlayerListItem.Item item : packet.getItems()) { UUID uuid = rewriteMap.remove(item.getUuid()); modified |= uuid != null; for (PlayerListItem.Item item : packet.getItems()) { UUID uuid = rewriteMap.get(item.getUuid()); if (uuid != null) {
for ( PlayerListItem.Item item : packet.getItems() )
for (PlayerListItem.Item item : packet.getItems()) { if (fakePlayerUUIDSet.contains(item.getUuid())) { throw new AssertionError("UUID collision: " + item); for (PlayerListItem.Item item : packet.getItems()) { TabListItem tabListItem = serverTabList.get(item.getUuid()); if (tabListItem != null) { for (PlayerListItem.Item item : packet.getItems()) { TabListItem tabListItem = serverTabList.get(item.getUuid()); if (tabListItem != null) { for (PlayerListItem.Item item : packet.getItems()) { TabListItem tabListItem = serverTabList.get(item.getUuid()); if (tabListItem != null) { for (PlayerListItem.Item item : packet.getItems()) { serverTabList.remove(item.getUuid()); for (PlayerListItem.Item item : packet.getItems()) { if (item.getGamemode() == 3 && item.getUuid().equals(getUniqueId())) { for (PlayerListItem.Item item : packet.getItems()) { if (!serverTabList.containsKey(item.getUuid())) { continue; case REMOVE_PLAYER: sendPacket(packet); for (PlayerListItem.Item item : packet.getItems()) {
public static PlayerListItem rewrite(PlayerListItem playerListItem) for ( PlayerListItem.Item item : playerListItem.getItems() )
for ( PlayerListItem.Item item : playerListItem.getItems() )