Skip to content

Commit 055a82b

Browse files
committed
fix: Send all supported resource packages to the client instead of just sending the highest version resource package
1 parent a44b5f7 commit 055a82b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/main/java/cn/nukkit/Player.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2838,15 +2838,8 @@ protected void processLogin() {
28382838
ResourcePacksInfoPacket infoPacket = new ResourcePacksInfoPacket();
28392839

28402840
infoPacket.resourcePackEntries = Arrays.stream(this.server.getResourcePackManager().getResourceStack())
2841-
.filter(pack -> pack.getPackProtocol() <= protocol)
2842-
.collect(Collectors.collectingAndThen(
2843-
Collectors.groupingBy(
2844-
ResourcePack::getPackProtocol,
2845-
TreeMap::new,
2846-
Collectors.toList()
2847-
),
2848-
map -> map.isEmpty() ? ResourcePack.EMPTY_ARRAY : map.lastEntry().getValue().toArray(ResourcePack[]::new)
2849-
));
2841+
.filter(pack -> pack.getPackProtocol() <= protocol)
2842+
.toArray(ResourcePack[]::new);
28502843

28512844
infoPacket.mustAccept = this.server.getForceResources();
28522845
this.dataPacket(infoPacket);

0 commit comments

Comments
 (0)