mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Fix NPE sending resource pack without prompt
Fixes KyoriPowered/adventure#1075
This commit is contained in:
parent
1570ecc56c
commit
5bd61ce801
1 changed files with 1 additions and 1 deletions
|
@ -4317,7 +4317,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ final Component prompt = io.papermc.paper.adventure.PaperAdventure.asVanilla(request.prompt());
|
||||
+ for (final java.util.Iterator<net.kyori.adventure.resource.ResourcePackInfo> iter = request.packs().iterator(); iter.hasNext();) {
|
||||
+ final net.kyori.adventure.resource.ResourcePackInfo pack = iter.next();
|
||||
+ packs.add(new ClientboundResourcePackPushPacket(pack.id(), pack.uri().toASCIIString(), pack.hash(), request.required(), iter.hasNext() ? Optional.empty() : Optional.of(prompt)));
|
||||
+ packs.add(new ClientboundResourcePackPushPacket(pack.id(), pack.uri().toASCIIString(), pack.hash(), request.required(), iter.hasNext() ? Optional.empty() : Optional.ofNullable(prompt)));
|
||||
+ if (request.callback() != net.kyori.adventure.resource.ResourcePackCallback.noOp()) {
|
||||
+ this.getHandle().connection.packCallbacks.put(pack.id(), request.callback()); // just override if there is a previously existing callback
|
||||
+ }
|
||||
|
|
Loading…
Add table
Reference in a new issue