13
0
geforkt von Mirrors/Velocity

Improve new Resource-pack API

Dieser Commit ist enthalten in:
FivePB 2021-06-05 16:07:24 +02:00
Ursprung df21105701
Commit 59b29a075e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 37DED8CFF428E1A4
4 geänderte Dateien mit 15 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -238,6 +238,8 @@ public interface Player extends CommandSource, Identified, InboundConnection,
* Queues and sends a new Resource-pack offer to the player.
* To monitor the status of the sent resource pack, subscribe to
* {@link PlayerResourcePackStatusEvent}.
* To create a {@link ResourcePackInfo} use the
* {@link ProxyServer#createResourcePackBuilder(String)} builder.
*
* @param packInfo the resource-pack in question
*/
@ -247,16 +249,17 @@ public interface Player extends CommandSource, Identified, InboundConnection,
* Gets the {@link ResourcePackInfo} of the currently applied
* resource-pack or null if none.
*
* @return the applied resource pack
* @return the applied resource pack or null if none.
*/
@Nullable
ResourcePackInfo getAppliedResourcePack();
/**
* Gets the {@link ResourcePackInfo} of the currently accepted
* and currently downloading resource-pack or null if none.
* Gets the {@link ResourcePackInfo} of the resource pack
* the user is currently downloading or is currently
* prompted to install or null if none.
*
* @return the pending resource pack
* @return the pending resource pack or null if none
*/
@Nullable
ResourcePackInfo getPendingResourcePack();

Datei anzeigen

@ -225,14 +225,16 @@ public interface ProxyServer extends Audience {
*
* <p>Note: The resource-pack location should always:
* - Use HTTPS with a valid certificate.
* - Be in a crawler-accessible location. Having it behind Cloudflare or Cloudfront
* may cause issues in downloading.
* - Be in location with appropriate bandwidth so the download does not time out or fail.</p>
* - Be in a crawler-accessible location. Having it behind Cloudflare or other DoS/Bot/crawler
* protection may cause issues in downloading.
* - Be on a web-server with enough bandwidth and reliable connection
* so the download does not time out or fail.</p>
*
* <p>Do also make sure that the resource pack is in the correct format for the version
* of the client. It is also highly recommended to always provide the resource-pack SHA-1 hash
* of the resource pack with {@link ResourcePackInfo.Builder#setHash(byte[])}
* whenever possible to save bandwidth.</p>
* whenever possible to save bandwidth. If a hash is present the client will first check
* if it already has a resource pack by that hash cached.</p>
*
* @param url The url where the resource pack can be found
* @return a ResourcePackInfo builder

Datei anzeigen

@ -113,7 +113,7 @@ public interface ResourcePackInfo {
*/
DOWNSTREAM_SERVER,
/**
* The player declined to download the resource pack.
* The resource-pack originated from a plugin on this proxy.
*/
PLUGIN_ON_PROXY
}

Datei anzeigen

@ -1000,9 +1000,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
}
if (!peek) {
CompletableFuture.supplyAsync(() -> {
connection.eventLoop().execute(() -> {
tickResourcePackQueue();
return true;
});
}