Class ParticleDescriptionProvider

java.lang.Object
net.minecraftforge.common.data.ParticleDescriptionProvider
All Implemented Interfaces:
DataProvider
Direct Known Subclasses:
DataGeneratorTest.ParticleDescriptions

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 or sprite set.


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

     // Multiple sprites
     this.spriteSet(ParticleTypes.CLOUD, new ResourceLocation("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 or sprite set consumer.

See Also: