Class ParticleProviderRegistry

java.lang.Object
dev.architectury.registry.client.particle.ParticleProviderRegistry

@Environment(CLIENT) public final class ParticleProviderRegistry extends Object
A utility class for registering custom ParticleProviders for particle types.

This class's methods should be invoked before ClientLifecycleEvent.CLIENT_SETUP, as doing so afterwards will result in the providers not being registered properly on Forge, causing crashes on startup.

Generally speaking, you should either listen to the registration of your particle type yourself and use either register(ParticleType, ParticleProvider) or register(ParticleType, DeferredParticleProvider) to register the provider, or use the helper methods register(RegistrySupplier, ParticleProvider) and register(RegistrySupplier, DeferredParticleProvider), which will automatically handle the listening for you.

  • Constructor Details

    • ParticleProviderRegistry

      public ParticleProviderRegistry()
  • Method Details

    • register

      public static <T extends net.minecraft.core.particles.ParticleOptions> void register(RegistrySupplier<? extends net.minecraft.core.particles.ParticleType<T>> supplier, net.minecraft.client.particle.ParticleProvider<T> provider)
    • register

      public static <T extends net.minecraft.core.particles.ParticleOptions> void register(RegistrySupplier<? extends net.minecraft.core.particles.ParticleType<T>> supplier, ParticleProviderRegistry.DeferredParticleProvider<T> provider)
    • register

      public static <T extends net.minecraft.core.particles.ParticleOptions> void register(net.minecraft.core.particles.ParticleType<T> type, net.minecraft.client.particle.ParticleProvider<T> provider)
    • register

      public static <T extends net.minecraft.core.particles.ParticleOptions> void register(net.minecraft.core.particles.ParticleType<T> type, ParticleProviderRegistry.DeferredParticleProvider<T> provider)