Class TextureMetaGenerator
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.client.generators.TextureMetaGenerator
- All Implemented Interfaces:
InputStreamSource,PathAwareInputStreamSource,ResourceGenerator
A
ResourceGenerator that generates a .mcmeta file for a texture by combining those of other textures
and/or setting properties manually.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfacestatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TextureMetaGenerator> Fields inherited from interface dev.lukebemish.dynamicassetgenerator.api.ResourceGenerator
PERSISTENT_CACHE_KEY -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends ResourceGenerator> codec()@Nullable net.minecraft.server.packs.resources.IoSupplier<InputStream> get(net.minecraft.resources.ResourceLocation outRl, ResourceGenerationContext context) Gets an input stream for the given resource location.@NonNull Set<net.minecraft.resources.ResourceLocation> getLocations(ResourceGenerationContext context) net.minecraft.resources.ResourceLocationList<net.minecraft.resources.ResourceLocation> <T> @NonNull com.mojang.serialization.DataResult<T> persistentCacheData(com.mojang.serialization.DynamicOps<T> ops, net.minecraft.resources.ResourceLocation location, ResourceGenerationContext context) Create a key that can be uniquely used to identify the resource this generator will generate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.lukebemish.dynamicassetgenerator.api.ResourceGenerator
createCacheKey
-
Field Details
-
CODEC
-
-
Method Details
-
getAnimation
-
getVillager
-
getTexture
-
getOutputLocation
public net.minecraft.resources.ResourceLocation getOutputLocation() -
getSources
-
persistentCacheData
public <T> @NonNull com.mojang.serialization.DataResult<T> persistentCacheData(com.mojang.serialization.DynamicOps<T> ops, net.minecraft.resources.ResourceLocation location, ResourceGenerationContext context) Description copied from interface:ResourceGeneratorCreate a key that can be uniquely used to identify the resource this generator will generate. Note that this is used for caching across reloads, and so should incorporate any resources that may be used to generate the resource. If this is not possible, return null.- Specified by:
persistentCacheDatain interfaceResourceGenerator- Parameters:
ops- DynamicOps to encode the unique key with.location- the resource location that will be generatedcontext- the context that the resource will be generated in. Resources can safely be accessed in this context- Returns:
- a key that can be used to uniquely identify the resource, or null if this is not possible
-
get
public @Nullable net.minecraft.server.packs.resources.IoSupplier<InputStream> get(net.minecraft.resources.ResourceLocation outRl, ResourceGenerationContext context) Description copied from interface:InputStreamSourceGets an input stream for the given resource location.- Specified by:
getin interfaceInputStreamSource- Parameters:
outRl-ResourceLocationto get the input stream for.context-ResourceGenerationContextcontaining information about when and where the resource is being generated.- Returns:
- Supplier for an InputStream for the location. Should be null if the resource cannot be loaded.
-
getLocations
public @NonNull Set<net.minecraft.resources.ResourceLocation> getLocations(ResourceGenerationContext context) - Specified by:
getLocationsin interfacePathAwareInputStreamSource- Returns:
- the locations that this
InputStreamSourcecan provide resources at.
-
codec
- Specified by:
codecin interfaceResourceGenerator- Returns:
- A codec that can serialize this resource generator.
-