addResource

fun <T> addResource(type: PackType, registry: ResourceKey<out Registry<T>>, codec: Codec<T>, id: ResourceLocation, value: T): ResourceKey<T>

Add a generic serializable resource in a registry.

Return

a ResourceKey pointing to the created resource

Parameters

type

the resource type

registry

the registry which holds this type of resource

codec

a codec to serialize the value

id

the resource location within the registry

value

the raw resource value


fun <T> addResource(type: PackType, path: List<String>, codec: Codec<T>, id: ResourceLocation, value: T)

Add a generic serializable resource at a path.

Parameters

type

the resource type

path

the base path of the resource

codec

a codec to serialize the value

id

the resource location

value

the raw resource value


fun addResource(type: PackType, path: List<String>, resource: String)

Add a generic resource with the given content.

Parameters

type

the resource type

path

the full path of the resource

resource

the string content of the resource file


fun addResource(type: PackType, path: List<String>, resource: Resource)

Add a generic resource with the given content.

Parameters

type

the resource type

path

the full path of the resource

resource

the InputStream supplier of the resource file