Class ShaderInjectionManager

java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderInjectionManager.Preparations>
foundry.veil.impl.client.render.shader.injection.ShaderInjectionManager
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener

@Internal public class ShaderInjectionManager extends net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderInjectionManager.Preparations>
Manages modifications for both vanilla and Veil shader files.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    apply(@NotNull ShaderInjectionManager.Preparations preparations, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
    Applies the loaded preparations to the live injection and replacement maps.
    void
    applyModifiers(net.minecraft.resources.ResourceLocation shaderId, io.github.ocelot.glslprocessor.api.node.GlslTree tree, boolean applyVersion)
    Applies all registered shader modifications to the specified GLSL tree.
    @Nullable net.minecraft.resources.ResourceLocation
    Returns the resource ID under which the given modification was registered, or null.
    getModifiers(net.minecraft.resources.ResourceLocation shaderId)
    Fetches all registered modifications for the specified shader.
    @Nullable net.minecraft.resources.ResourceLocation
    getReplacement(net.minecraft.resources.ResourceLocation target)
    Returns the replacement shader ID for the target, or null if none.
    prepare(@NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
    Loads and adapts all shader injection JSON definitions from resource packs.

    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 net.minecraft.server.packs.resources.PreparableReloadListener

    getName
  • Constructor Details

    • ShaderInjectionManager

      public ShaderInjectionManager()
  • Method Details

    • applyModifiers

      public void applyModifiers(net.minecraft.resources.ResourceLocation shaderId, io.github.ocelot.glslprocessor.api.node.GlslTree tree, boolean applyVersion)
      Applies all registered shader modifications to the specified GLSL tree.
    • getModifiers

      public List<ShaderInjection> getModifiers(net.minecraft.resources.ResourceLocation shaderId)
      Fetches all registered modifications for the specified shader.
    • getModifierId

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getModifierId(ShaderInjection modification)
      Returns the resource ID under which the given modification was registered, or null.
    • getReplacement

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getReplacement(net.minecraft.resources.ResourceLocation target)
      Returns the replacement shader ID for the target, or null if none.
    • prepare

      @NotNull protected @NotNull ShaderInjectionManager.Preparations prepare(@NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
      Loads and adapts all shader injection JSON definitions from resource packs.
      Specified by:
      prepare in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderInjectionManager.Preparations>
    • apply

      protected void apply(@NotNull @NotNull ShaderInjectionManager.Preparations preparations, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
      Applies the loaded preparations to the live injection and replacement maps.
      Specified by:
      apply in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderInjectionManager.Preparations>