Class AbstractManyOperationSource
java.lang.Object
dev.lukebemish.dynamicassetgenerator.api.client.generators.texsources.AbstractManyOperationSource
- All Implemented Interfaces:
TexSource
- Direct Known Subclasses:
AddMask,MultiplyMask,OverlaySource
An abstract
TexSource that is described by a PointwiseOperation.Any.-
Field Summary
Fields inherited from interface dev.lukebemish.dynamicassetgenerator.api.client.generators.TexSource
CODEC, METADATA_CACHE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract PointwiseOperation.Any<Integer> @Nullable net.minecraft.server.packs.resources.IoSupplier<com.mojang.blaze3d.platform.NativeImage> getSupplier(TexSourceDataHolder data, ResourceGenerationContext context) Provides a supplier for the texture this source will generate, or null if a texture cannot be provided.static <T extends AbstractManyOperationSource>
com.mojang.serialization.MapCodec<T> Creates aCodecfor a subtype of this class based on a function for constructing single instances.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.client.generators.TexSource
cacheMetadata, codec, getCachedSupplier, persistentCacheData, stringify
-
Constructor Details
-
AbstractManyOperationSource
-
-
Method Details
-
getSources
-
getOperation
- Returns:
- the operation that describes this source
-
makeCodec
public static <T extends AbstractManyOperationSource> com.mojang.serialization.MapCodec<T> makeCodec(Function<List<TexSource>, T> ctor) Creates aCodecfor a subtype of this class based on a function for constructing single instances. -
getSupplier
public @Nullable net.minecraft.server.packs.resources.IoSupplier<com.mojang.blaze3d.platform.NativeImage> getSupplier(TexSourceDataHolder data, ResourceGenerationContext context) Description copied from interface:TexSourceProvides a supplier for the texture this source will generate, or null if a texture cannot be provided. Should be overridden, but not called; callTexSource.getCachedSupplier(dev.lukebemish.dynamicassetgenerator.api.client.generators.TexSourceDataHolder, dev.lukebemish.dynamicassetgenerator.api.ResourceGenerationContext)instead to support caching.- Specified by:
getSupplierin interfaceTexSource- Parameters:
data- context information passed by outer nesting texture sources; if you depend on this, you will want to implement the caching API (seeTexSource.cacheMetadata(com.mojang.serialization.DynamicOps<T>, dev.lukebemish.dynamicassetgenerator.api.client.generators.TexSourceDataHolder))context- context about the environment the texture is generating in- Returns:
- a supplier able to produce the texture, or null if the texture could not be produced.
-