Package foundry.veil.render.post
Class PostProcessingManager
java.lang.Object
net.neoforged.neoforge.resource.ContextAwareReloadListener
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,T>>
foundry.veil.resource.CodecReloadListener<CompositePostPipeline>
foundry.veil.render.post.PostProcessingManager
- All Implemented Interfaces:
AutoCloseable,net.minecraft.server.packs.resources.PreparableReloadListener,org.lwjgl.system.NativeResource
public class PostProcessingManager
extends CodecReloadListener<CompositePostPipeline>
implements org.lwjgl.system.NativeResource
Manages all post pipelines.
Post Pipelines are a single "effect" that can be applied.
For example, a vanilla Minecraft creeper effect can be a added using add(int, ResourceLocation)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA single active profile.Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier -
Field Summary
Fields inherited from class foundry.veil.resource.CodecReloadListener
codec, converter, loggerFields inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
conditionContext, registryAccess -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the post-processing manager. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int priority, net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline with the specified priority.booleanadd(net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline under the default priority of1000.protected voidapply(@NotNull Map<net.minecraft.resources.ResourceLocation, CompositePostPipeline> data, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) voidfree()@Nullable PostPipelinegetPipeline(net.minecraft.resources.ResourceLocation pipeline) Retrieves a post pipeline by name.@NotNull Set<net.minecraft.resources.ResourceLocation>booleanisActive(net.minecraft.resources.ResourceLocation pipeline) Checks to see if the specified pipeline is active.protected @NotNull Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline> prepare(@NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) booleanremove(net.minecraft.resources.ResourceLocation pipeline) Removes the specified pipeline from the active profiles.voidApplies all pipelines in the order they are specified in the current pipeline list.voidrunPipeline(PostPipeline pipeline) Applies only the specified pipeline.Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reloadMethods inherited from class net.neoforged.neoforge.resource.ContextAwareReloadListener
injectContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
closeMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName
-
Constructor Details
-
PostProcessingManager
public PostProcessingManager()Creates a new instance of the post-processing manager.
-
-
Method Details
-
isActive
public boolean isActive(net.minecraft.resources.ResourceLocation pipeline) Checks to see if the specified pipeline is active.- Parameters:
pipeline- The pipeline to check for- Returns:
- Whether that pipeline is active
-
add
public boolean add(net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline under the default priority of1000. A higher priority indicates the pipeline should be run earlier than lower priority pipelines.- Parameters:
pipeline- The pipeline to add- Returns:
- Whether the pipeline was added or had a priority change
-
add
public boolean add(int priority, net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline with the specified priority. A higher priority indicates the pipeline should be run earlier than lower priority pipelines.- Parameters:
priority- The priority to set the pipeline to. The default priority is1000pipeline- The pipeline to add- Returns:
- Whether the pipeline was added or had a priority change
-
remove
public boolean remove(net.minecraft.resources.ResourceLocation pipeline) Removes the specified pipeline from the active profiles.- Parameters:
pipeline- The pipeline to remove- Returns:
- If the pipeline was previously active
-
getPipeline
@Nullable public @Nullable PostPipeline getPipeline(net.minecraft.resources.ResourceLocation pipeline) Retrieves a post pipeline by name.- Parameters:
pipeline- The pipeline to get- Returns:
- The pipeline found or
nullif it doesn't exist
-
runPipeline
public void runPipeline()Applies all pipelines in the order they are specified in the current pipeline list. -
runPipeline
Applies only the specified pipeline.- Parameters:
pipeline- The pipeline to run
-
prepare
@NotNull protected @NotNull Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline> prepare(@NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) - Overrides:
preparein classCodecReloadListener<CompositePostPipeline>
-
apply
protected void apply(@NotNull @NotNull Map<net.minecraft.resources.ResourceLocation, CompositePostPipeline> data, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) - Specified by:
applyin classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline>>
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-
getContext
- Returns:
- The default context for post-processing
-
getPipelines
- Returns:
- All available pipelines
-
getActivePipelines
- Returns:
- A list of all active profiles and their priorities
-