From 058aee259a805bb5826b1a6185f3e019036c7352 Mon Sep 17 00:00:00 2001 From: Gero Date: Thu, 7 Dec 2023 13:51:32 +0100 Subject: [PATCH] fix resource pack status --- .../event/player/PlayerResourcePackStatusEvent.java | 10 +++++++++- .../proxy/connection/client/ConnectedPlayer.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/event/player/PlayerResourcePackStatusEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/PlayerResourcePackStatusEvent.java index b2a5bc0e8..3f175a407 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/PlayerResourcePackStatusEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/PlayerResourcePackStatusEvent.java @@ -134,6 +134,10 @@ public class PlayerResourcePackStatusEvent { * The player has accepted the resource pack and is now downloading it. */ ACCEPTED, + /** + * The player has downloaded the resource pack. + */ + DOWNLOADED, /** * The URL of the resource pack failed to load. */ @@ -145,6 +149,10 @@ public class PlayerResourcePackStatusEvent { /** * The resource pack was discarded. */ - DISCARDED, + DISCARDED; + + public boolean isIntermediate() { + return this == ACCEPTED || this == DOWNLOADED; + } } } \ No newline at end of file diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 5c267b4e1..6d8fb1828 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -1057,7 +1057,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player, * Processes a client response to a sent resource-pack. */ public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status) { - final boolean peek = status == PlayerResourcePackStatusEvent.Status.ACCEPTED; + final boolean peek = status.isIntermediate(); final ResourcePackInfo queued = peek ? outstandingResourcePacks.peek() : outstandingResourcePacks.poll();