Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-25 15:50:19 +01:00
fix resource pack status
Dieser Commit ist enthalten in:
Ursprung
519bf5ee04
Commit
058aee259a
@ -134,6 +134,10 @@ public class PlayerResourcePackStatusEvent {
|
|||||||
* The player has accepted the resource pack and is now downloading it.
|
* The player has accepted the resource pack and is now downloading it.
|
||||||
*/
|
*/
|
||||||
ACCEPTED,
|
ACCEPTED,
|
||||||
|
/**
|
||||||
|
* The player has downloaded the resource pack.
|
||||||
|
*/
|
||||||
|
DOWNLOADED,
|
||||||
/**
|
/**
|
||||||
* The URL of the resource pack failed to load.
|
* The URL of the resource pack failed to load.
|
||||||
*/
|
*/
|
||||||
@ -145,6 +149,10 @@ public class PlayerResourcePackStatusEvent {
|
|||||||
/**
|
/**
|
||||||
* The resource pack was discarded.
|
* The resource pack was discarded.
|
||||||
*/
|
*/
|
||||||
DISCARDED,
|
DISCARDED;
|
||||||
|
|
||||||
|
public boolean isIntermediate() {
|
||||||
|
return this == ACCEPTED || this == DOWNLOADED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1057,7 +1057,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player,
|
|||||||
* Processes a client response to a sent resource-pack.
|
* Processes a client response to a sent resource-pack.
|
||||||
*/
|
*/
|
||||||
public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status) {
|
public boolean onResourcePackResponse(PlayerResourcePackStatusEvent.Status status) {
|
||||||
final boolean peek = status == PlayerResourcePackStatusEvent.Status.ACCEPTED;
|
final boolean peek = status.isIntermediate();
|
||||||
final ResourcePackInfo queued = peek
|
final ResourcePackInfo queued = peek
|
||||||
? outstandingResourcePacks.peek() : outstandingResourcePacks.poll();
|
? outstandingResourcePacks.peek() : outstandingResourcePacks.poll();
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren