Class FabricParticleTypes
java.lang.Object
net.fabricmc.fabric.api.particle.v1.FabricParticleTypes
Methods for creating particle types, both simple and using an existing attribute factory.
Usage:
public static final DefaultParticleType SIMPLE_TEST_PARTICLE = FabricParticleTypes.simple(); public static final DefaultParticleType CUSTOM_TEST_PARTICLE = FabricParticleTypes.simple(); @Override public void onInitialize() { Registry.register(Registry.PARTICLE_TYPE, new Identifier("testmod", "simple"), SIMPLE_TEST_PARTICLE); Registry.register(Registry.PARTICLE_TYPE, new Identifier("testmod", "custom"), CUSTOM_TEST_PARTICLE); }}
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ParticleEffect>
ParticleType<T> complex
(boolean alwaysSpawn, ParticleEffect.Factory<T> factory) Creates a new particle type with a custom factory for packet/data serialization.static <T extends ParticleEffect>
ParticleType<T> complex
(ParticleEffect.Factory<T> factory) Creates a new particle type with a custom factory for packet/data serialization.static DefaultParticleType
simple()
Creates a new, default particle type for the given id.static DefaultParticleType
simple
(boolean alwaysSpawn) Creates a new, default particle type for the given id.
-
Method Details
-
simple
Creates a new, default particle type for the given id. -
simple
Creates a new, default particle type for the given id.- Parameters:
alwaysSpawn
- True to always spawn the particle regardless of distance.
-
complex
Creates a new particle type with a custom factory for packet/data serialization.- Parameters:
factory
- A factory for serializing packet data and string command parameters into a particle effect.
-
complex
public static <T extends ParticleEffect> ParticleType<T> complex(boolean alwaysSpawn, ParticleEffect.Factory<T> factory) Creates a new particle type with a custom factory for packet/data serialization.- Parameters:
alwaysSpawn
- True to always spawn the particle regardless of distance.factory
- A factory for serializing packet data and string command parameters into a particle effect.
-