Class PostProcessingManager
java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,CompositePostPipeline>>
foundry.veil.api.CodecReloadListener<CompositePostPipeline>
foundry.veil.api.client.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 added using add(int, ResourceLocation)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A 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.api.CodecReloadListener
codec, converter
-
Constructor Summary
ConstructorDescriptionCreates a new instance of the post-processing manager. -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(int priority, net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline with the specified priority.boolean
add
(net.minecraft.resources.ResourceLocation pipeline) Adds the specified pipeline under the default priority of1000
.protected void
apply
(@NotNull Map<net.minecraft.resources.ResourceLocation, CompositePostPipeline> data, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller) void
free()
@Nullable PostPipeline
getPipeline
(net.minecraft.resources.ResourceLocation pipeline) Retrieves a post pipeline by name.@NotNull Set
<net.minecraft.resources.ResourceLocation> boolean
isActive
(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) boolean
remove
(net.minecraft.resources.ResourceLocation pipeline) Removes the specified pipeline from the active profiles.void
void
runPipeline
(PostPipeline pipeline) Applies only the specified pipeline.void
runPipeline
(PostPipeline pipeline, boolean resolvePost) Applies only the specified pipeline.Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener
reload
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.lwjgl.system.NativeResource
close
Methods 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 is1000
pipeline
- 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
null
if it doesn't exist
-
runPipeline
@Internal public void runPipeline() -
runPipeline
Applies only the specified pipeline. Copies the main buffer into the post framebuffer and back before running the pipeline.- Parameters:
pipeline
- The pipeline to run
-
runPipeline
Applies only the specified pipeline.- Parameters:
pipeline
- The pipeline to runresolvePost
- Whether to copy the main buffer into the post framebuffer before running the pipeline
-
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:
prepare
in 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:
apply
in classnet.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,
CompositePostPipeline>>
-
free
public void free()- Specified by:
free
in interfaceorg.lwjgl.system.NativeResource
-
getPostPipelineContext
- Returns:
- The default context for post-processing
-
getPipelines
- Returns:
- All available pipelines
-
getActivePipelines
- Returns:
- An immutable view of all active profiles and their priorities
-