Class RegisterParticleProvidersEvent
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
ParticleType
s must be registered during RegisterEvent
as usual;
this event is only for the ParticleProvider
s.
This event is not cancellable, and does not
invalid reference
have a result
This event is fired on the mod-specific event bus, only on the logical client.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends ParticleOptions>
voidregisterSpecial
(ParticleType<T> type, ParticleProvider<T> provider) Registers a ParticleProvider for a non-json-based ParticleType.<T extends ParticleOptions>
voidregisterSprite
(ParticleType<T> type, ParticleProvider.Sprite<T> sprite) Registers a ParticleProvider for a json-based ParticleType with a single texture; the resultingTextureSheetParticle
s will use that texture when created.<T extends ParticleOptions>
voidregisterSpriteSet
(ParticleType<T> type, ParticleEngine.SpriteParticleRegistration<T> registration) Registers a ParticleProvider for a json-based ParticleType.
-
Field Details
-
particleEngine
-
-
Constructor Details
-
RegisterParticleProvidersEvent
-
-
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
TextureSheetParticle
s 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.
-