Class ParticleDescriptionProvider

java.lang.Object
net.neoforged.neoforge.client.data.ParticleDescriptionProvider
All Implemented Interfaces:
DataProvider

public abstract class ParticleDescriptionProvider extends Object implements DataProvider
A data provider for ParticleDescriptions.

To use this provider, extend this class and implement addDescriptions(). Then, register an instance using DataGenerator.addProvider(boolean, Factory) via the GatherDataEvent on the mod event bus.

A description can be added to a ParticleType which uses a sprite set.

@Override
protected void addDescriptions() {
    // Single sprite
    this.sprite(ParticleTypes.DRIPPING_LAVA, Identifier.withDefaultNamespace("drip_hang"));

    // Multiple sprites
    this.spriteSet(ParticleTypes.CLOUD, Identifier.withDefaultNamespace("generic"), 8, true);
}

A particle description holds a list of textures used when rendering the particle to the screen. All registered particle descriptions are stitched together into a texture atlas called TextureAtlas.LOCATION_PARTICLES. A ParticleType whose particle uses the texture atlas, typically via the ParticleRenderType, can then reference the necessary texture during rendering.

Particles with a particle description must have their particle providers attached to a ParticleType as a sprite set consumer.

See Also: