Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Improve new Resource-pack API
Dieser Commit ist enthalten in:
Ursprung
df21105701
Commit
59b29a075e
@ -238,6 +238,8 @@ public interface Player extends CommandSource, Identified, InboundConnection,
|
|||||||
* Queues and sends a new Resource-pack offer to the player.
|
* Queues and sends a new Resource-pack offer to the player.
|
||||||
* To monitor the status of the sent resource pack, subscribe to
|
* To monitor the status of the sent resource pack, subscribe to
|
||||||
* {@link PlayerResourcePackStatusEvent}.
|
* {@link PlayerResourcePackStatusEvent}.
|
||||||
|
* To create a {@link ResourcePackInfo} use the
|
||||||
|
* {@link ProxyServer#createResourcePackBuilder(String)} builder.
|
||||||
*
|
*
|
||||||
* @param packInfo the resource-pack in question
|
* @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
|
* Gets the {@link ResourcePackInfo} of the currently applied
|
||||||
* resource-pack or null if none.
|
* resource-pack or null if none.
|
||||||
*
|
*
|
||||||
* @return the applied resource pack
|
* @return the applied resource pack or null if none.
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
ResourcePackInfo getAppliedResourcePack();
|
ResourcePackInfo getAppliedResourcePack();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the {@link ResourcePackInfo} of the currently accepted
|
* Gets the {@link ResourcePackInfo} of the resource pack
|
||||||
* and currently downloading resource-pack or null if none.
|
* 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
|
@Nullable
|
||||||
ResourcePackInfo getPendingResourcePack();
|
ResourcePackInfo getPendingResourcePack();
|
||||||
|
@ -225,14 +225,16 @@ public interface ProxyServer extends Audience {
|
|||||||
*
|
*
|
||||||
* <p>Note: The resource-pack location should always:
|
* <p>Note: The resource-pack location should always:
|
||||||
* - Use HTTPS with a valid certificate.
|
* - Use HTTPS with a valid certificate.
|
||||||
* - Be in a crawler-accessible location. Having it behind Cloudflare or Cloudfront
|
* - Be in a crawler-accessible location. Having it behind Cloudflare or other DoS/Bot/crawler
|
||||||
* may cause issues in downloading.
|
* protection may cause issues in downloading.
|
||||||
* - Be in location with appropriate bandwidth so the download does not time out or fail.</p>
|
* - 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
|
* <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 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[])}
|
* 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
|
* @param url The url where the resource pack can be found
|
||||||
* @return a ResourcePackInfo builder
|
* @return a ResourcePackInfo builder
|
||||||
|
@ -113,7 +113,7 @@ public interface ResourcePackInfo {
|
|||||||
*/
|
*/
|
||||||
DOWNSTREAM_SERVER,
|
DOWNSTREAM_SERVER,
|
||||||
/**
|
/**
|
||||||
* The player declined to download the resource pack.
|
* The resource-pack originated from a plugin on this proxy.
|
||||||
*/
|
*/
|
||||||
PLUGIN_ON_PROXY
|
PLUGIN_ON_PROXY
|
||||||
}
|
}
|
||||||
|
@ -1000,9 +1000,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!peek) {
|
if (!peek) {
|
||||||
CompletableFuture.supplyAsync(() -> {
|
connection.eventLoop().execute(() -> {
|
||||||
tickResourcePackQueue();
|
tickResourcePackQueue();
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren