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
FieldsModifier and TypeFieldDescriptionprivate final net.minecraft.client.particle.ParticleEngine
-
Constructor Summary
ConstructorsConstructorDescriptionRegisterParticleProvidersEvent
(net.minecraft.client.particle.ParticleEngine particleEngine) -
Method Summary
Modifier and TypeMethodDescription<T extends net.minecraft.core.particles.ParticleOptions>
voidregisterSpecial
(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleProvider<T> provider) Registers a ParticleProvider for a non-json-based ParticleType.<T extends net.minecraft.core.particles.ParticleOptions>
voidregisterSprite
(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.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 net.minecraft.core.particles.ParticleOptions>
voidregisterSpriteSet
(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleEngine.SpriteParticleRegistration<T> registration) Registers a ParticleProvider for a json-based ParticleType.
-
Field Details
-
particleEngine
private final net.minecraft.client.particle.ParticleEngine particleEngine
-
-
Constructor Details
-
RegisterParticleProvidersEvent
@Internal public RegisterParticleProvidersEvent(net.minecraft.client.particle.ParticleEngine particleEngine)
-
-
Method Details
-
registerSpecial
public <T extends net.minecraft.core.particles.ParticleOptions> void registerSpecial(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.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 net.minecraft.core.particles.ParticleOptions> void registerSprite(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.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 net.minecraft.core.particles.ParticleOptions> void registerSpriteSet(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.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.
-