ResourcePath

@Serializable(with = ResourcePathSerializer::class)
class ResourcePath<out T : ResourceType>(val type: T, val namespace: String, val path: String) : Key

An identifier for a file in a resource pack.

Similar to Key, ResourcePath consists of a namespace and path, but with an additional type that specifies the type of resource and thereby its location in the resource pack.

Constructors

Link copied to clipboard
constructor(type: T, namespace: String, path: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The full path to the file in the resource pack, starting with assets/.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val type: T

Functions

Link copied to clipboard
@NotNull
open fun asMinimalString(): @NotNull String
Link copied to clipboard
open override fun asString(): String
Link copied to clipboard
open operator override fun compareTo(@NotNull other: @NotNull Key): Int
Link copied to clipboard
operator fun component1(): String
Link copied to clipboard
operator fun component2(): String
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
@NotNull
open fun examinableName(): @NotNull String
Link copied to clipboard
@NotNull
open override fun examinableProperties(): @NotNull Stream<out ExaminableProperty>
Link copied to clipboard
@NotNull
open fun <R : Any> examine(@NotNull examiner: @NotNull Examiner<R>): @NotNull R & Any
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
@NotNull
open override fun key(): @NotNull Key
Link copied to clipboard
open override fun namespace(): String
Link copied to clipboard
fun Key.toNamespacedKey(): NamespacedKey

Converts this Key to a NamespacedKey.

Link copied to clipboard
fun Key.toResourceLocation(): ResourceLocation
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun Key.toString(separator: String): String

Converts this Key to a string by concatenating the Key.namespace and Key.value with separator.

Link copied to clipboard
fun <NT : ResourceType> toType(newType: NT): ResourcePath<NT>

Changes the type of this ResourcePath to newType, updating path to still target the same file from the new type.

Link copied to clipboard
open override fun value(): String