Class ShaderModificationManager

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

public class ShaderModificationManager extends net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderModificationManager.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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.FileToIdConverter
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    apply(@NotNull ShaderModificationManager.Preparations preparations, @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
     
    applyModifiers(net.minecraft.resources.ResourceLocation shaderId, String source, int flags)
    Applies all shader modifiers to the specified shader source.
    @Nullable net.minecraft.resources.ResourceLocation
    Retrieves the id of the specified modifier.
    getModifiers(net.minecraft.resources.ResourceLocation shaderId)
    Retrieves all modifiers for the specified shader.
    prepare(@NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
     

    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
  • Field Details

    • MODIFIER_LISTER

      public static final net.minecraft.resources.FileToIdConverter MODIFIER_LISTER
  • Constructor Details

    • ShaderModificationManager

      public ShaderModificationManager()
  • Method Details

    • applyModifiers

      public String applyModifiers(net.minecraft.resources.ResourceLocation shaderId, String source, int flags)
      Applies all shader modifiers to the specified shader source.
      Parameters:
      shaderId - The id of the shader to get modifiers for
      source - The shader source text
      flags - Additional flags for applying
      Returns:
      The modified shader source
      See Also:
    • getModifiers

      public Collection<ShaderModification> getModifiers(net.minecraft.resources.ResourceLocation shaderId)
      Retrieves all modifiers for the specified shader.
      Parameters:
      shaderId - The shader to get all modifiers for
      Returns:
      The modifiers applied to the specified shader
    • getModifierId

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getModifierId(ShaderModification modification)
      Retrieves the id of the specified modifier.
      Parameters:
      modification - The modification to get the id of
      Returns:
      The id of that modification or null if unregistered
    • prepare

      @NotNull protected @NotNull ShaderModificationManager.Preparations prepare(@NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
      Specified by:
      prepare in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderModificationManager.Preparations>
    • apply

      protected void apply(@NotNull @NotNull ShaderModificationManager.Preparations preparations, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profilerFiller)
      Specified by:
      apply in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<ShaderModificationManager.Preparations>