Class RegisterParticleProvidersEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RegisterParticleProvidersEvent
All Implemented Interfaces:
IModBusEvent

public class RegisterParticleProvidersEvent extends net.minecraftforge.eventbus.api.Event implements IModBusEvent
Fired for registering particle providers at the appropriate time.

ParticleTypes must be registered during RegisterEvent as usual; this event is only for the ParticleProviders.

This event is not cancellable, and does not have a result.

This event is fired on the mod-specific event bus, only on the logical client.

  • Field Details

  • Constructor Details

    • RegisterParticleProvidersEvent

      @Internal public RegisterParticleProvidersEvent(ParticleEngine particleEngine)
  • Method Details

    • registerSpecial

      public <T extends ParticleOptions> void registerSpecial(ParticleType<T> type, ParticleProvider<T> provider)

      Registers a ParticleProvider for a non-json-based ParticleType. These particles do not receive a list of texture sprites to use for rendering themselves.

      There must be no particle json with an ID matching the ParticleType, or a redundant texture list error will occur when particle jsons load.

      Type Parameters:
      T - ParticleOptions used by the ParticleType and ParticleProvider.
      Parameters:
      type - ParticleType to register a ParticleProvider for.
      provider - ParticleProvider function responsible for providing that ParticleType's particles.
    • registerSprite

      public <T extends ParticleOptions> void registerSprite(ParticleType<T> type, ParticleProvider.Sprite<T> sprite)

      Registers a ParticleProvider for a json-based ParticleType with a single texture; the resulting TextureSheetParticles will use that texture when created.

      A particle json with an ID matching the ParticleType must exist in the particles asset folder, or a missing texture list error will occur when particle jsons load.

      Type Parameters:
      T - ParticleOptions used by the ParticleType and Sprite function.
      Parameters:
      type - ParticleType to register a ParticleProvider for.
      sprite - Sprite function responsible for providing that ParticleType's particles.
    • registerSpriteSet

      public <T extends ParticleOptions> void registerSpriteSet(ParticleType<T> type, ParticleEngine.SpriteParticleRegistration<T> registration)

      Registers a ParticleProvider for a json-based ParticleType. Particle jsons define a list of texture sprites which the particle can use to render itself.

      A particle json with an ID matching the ParticleType must exist in the particles asset folder, or a missing texture list error will occur when particle jsons load.

      Type Parameters:
      T - ParticleOptions used by the ParticleType and SpriteParticleRegistration function.
      Parameters:
      type - ParticleType to register a particle provider for.
      registration - SpriteParticleRegistration function responsible for providing that ParticleType's particles.