Class ParticleRendererRegistry

java.lang.Object
net.fabricmc.fabric.api.client.particle.v1.ParticleRendererRegistry

public final class ParticleRendererRegistry extends Object
A registry for custom ParticleRenderers.
  • Method Details

    • register

      public static void register(ParticleTextureSheet textureSheet, Function<ParticleManager,ParticleRenderer<?>> function)
      Registers a ParticleRenderer factory for the given ParticleTextureSheet.
      Parameters:
      textureSheet - the texture sheet
      function - the factory function
    • registerOrdering

      public static void registerOrdering(ParticleTextureSheet first, Identifier second)
      Registers a rendering order between two ParticleTextureSheets.

      The first texture sheet will be rendered before the second texture sheet.

      Note that the rendering order of vanilla texture sheets is already defined by Minecraft, and you cannot change the order of vanilla texture sheets with this method.

      Parameters:
      first - the texture sheet to render first
      second - the texture sheet to render second
    • registerOrdering

      public static void registerOrdering(ParticleTextureSheet first, ParticleTextureSheet second)
      Registers a rendering order between two ParticleTextureSheets.

      The first texture sheet will be rendered before the second texture sheet.

      Note that the rendering order of vanilla texture sheets is already defined by Minecraft, and you cannot change the order of vanilla texture sheets with this method.

      Parameters:
      first - the texture sheet to render first
      second - the texture sheet to render second
    • registerOrdering

      public static void registerOrdering(Identifier first, ParticleTextureSheet second)
      Registers a rendering order between two ParticleTextureSheets.

      The first texture sheet will be rendered before the second texture sheet.

      Note that the rendering order of vanilla texture sheets is already defined by Minecraft, and you cannot change the order of vanilla texture sheets with this method.

      Parameters:
      first - the texture sheet to render first
      second - the texture sheet to render second
    • registerOrdering

      public static void registerOrdering(Identifier first, Identifier second)
      Registers a rendering order between two ParticleTextureSheets.

      The first texture sheet will be rendered before the second texture sheet.

      Note that the rendering order of vanilla texture sheets is already defined by Minecraft, and you cannot change the order of vanilla texture sheets with this method.

      Parameters:
      first - the texture sheet to render first
      second - the texture sheet to render second
    • getParticleTextureSheet

      @Nullable public static @Nullable ParticleTextureSheet getParticleTextureSheet(Identifier id)
      Gets the ParticleTextureSheet registered with the given identifier.
      Parameters:
      id - the identifier of the texture sheet
      Returns:
      the texture sheet, or null if none is registered with the given identifier
    • getId

      public static Identifier getId(ParticleTextureSheet textureSheet)
      Gets the identifier for the given ParticleTextureSheet.
      Parameters:
      textureSheet - the texture sheet
      Returns:
      the identifier