Interface ResourcePackInfo
- All Superinterfaces:
ResourcePackRequestLike
Represents the information for a resource pack to apply that can be sent to the client.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builder forResourcePackInfo
instances.static enum
Represents the origin of the resource-pack. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of thisResourcePackInfo
instance as a builder so that it can be modified.Returns a copy of thisResourcePackInfo
instance as a builder, using the new URL.byte @Nullable []
getHash()
Gets the SHA-1 hash of the resource-pack SeeResourcePackInfo.Builder.setHash(byte[])
for more information.getId()
Gets the id of this resource-pack.Gets theResourcePackInfo.Origin
of this resource-pack.Gets the originalResourcePackInfo.Origin
of the resource-pack.@Nullable Component
Gets theComponent
that is displayed on the resource-pack prompt.boolean
Gets whether or not the acceptance of the resource-pack is enforced.getUrl()
Gets the link the resource-pack can be found at.Methods inherited from interface net.kyori.adventure.resource.ResourcePackRequestLike
asResourcePackRequest
-
Method Details
-
getId
UUID getId()Gets the id of this resource-pack.- Returns:
- the id of the resource-pack
-
getUrl
String getUrl()Gets the link the resource-pack can be found at.- Returns:
- the location of the resource-pack
-
getPrompt
@Nullable Component getPrompt()Gets theComponent
that is displayed on the resource-pack prompt. This is only displayed if the client version is 1.17 or newer.- Returns:
- the prompt if present or null otherwise
-
getShouldForce
boolean getShouldForce()Gets whether or not the acceptance of the resource-pack is enforced. SeeResourcePackInfo.Builder.setShouldForce(boolean)
for more information.- Returns:
- whether or not to force usage of this resource-pack
-
getHash
byte @Nullable [] getHash()Gets the SHA-1 hash of the resource-pack SeeResourcePackInfo.Builder.setHash(byte[])
for more information.- Returns:
- the hash if present or null otherwise
-
getOrigin
ResourcePackInfo.Origin getOrigin()Gets theResourcePackInfo.Origin
of this resource-pack.- Returns:
- the origin of the resource pack
-
getOriginalOrigin
ResourcePackInfo.Origin getOriginalOrigin()Gets the originalResourcePackInfo.Origin
of the resource-pack. The original origin may differ if the resource pack was altered in the eventServerResourcePackSendEvent
.- Returns:
- the origin of the resource pack
-
asBuilder
ResourcePackInfo.Builder asBuilder()Returns a copy of thisResourcePackInfo
instance as a builder so that it can be modified. It is not guaranteed thatresourcePackInfo.asBuilder().build().equals(resourcePackInfo)
is true. That is due to the transientgetOrigin()
andgetOriginalOrigin()
fields.- Returns:
- a content-copy of this instance as a
ResourcePackInfo.Builder
-
asBuilder
Returns a copy of thisResourcePackInfo
instance as a builder, using the new URL. It is not guaranteed thatresourcePackInfo.asBuilder(resourcePackInfo.getUrl()).build().equals(resourcePackInfo)
is true, because thegetOrigin()
andgetOriginalOrigin()
fields are transient.- Parameters:
newUrl
- The new URL to use in the updated builder.- Returns:
- a content-copy of this instance as a
ResourcePackInfo.Builder
-