Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,7 @@ public StructureModifier<WrappedServerPing> getServerPings() {
*/
public StructureModifier<List<PlayerInfoData>> getPlayerInfoDataLists() {
// Convert to and from the ProtocolLib wrapper
return structureModifier.withType(
Collection.class,
BukkitConverters.getListConverter(PlayerInfoData.getConverter()));
return getLists(PlayerInfoData.getConverter());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,14 +848,14 @@ public void testPlayerInfoActions() {
new WrappedGameProfile(new UUID(0, 0), "system"),
null,
(WrappedRemoteChatSessionData) null);
updatePlayerInfoActions.getPlayerInfoDataLists().write(1, Collections.singletonList(data));
StructureModifier<List<PlayerInfoData>> playerInfoDataLists = updatePlayerInfoActions.getPlayerInfoDataLists();
Assertions.assertEquals(1, playerInfoDataLists.size());
playerInfoDataLists.write(0, Collections.singletonList(data));

Set<EnumWrappers.PlayerInfoAction> readActions = updatePlayerInfoActions.getPlayerInfoActions().read(0);
Assertions.assertTrue(readActions.contains(EnumWrappers.PlayerInfoAction.ADD_PLAYER));
Assertions.assertTrue(readActions.contains(EnumWrappers.PlayerInfoAction.UPDATE_LATENCY));
Assertions.assertTrue(readActions.contains(EnumWrappers.PlayerInfoAction.UPDATE_LISTED));
Assertions.assertEquals(actions, readActions);

Collection<PlayerInfoData> readData = updatePlayerInfoActions.getPlayerInfoDataLists().read(1);
Collection<PlayerInfoData> readData = playerInfoDataLists.read(0);
Assertions.assertEquals(1, readData.size());

PlayerInfoData firstData = readData.iterator().next();
Expand Down
Loading