Files
Botania/src/main/java/vazkii/botania/client/fx/ModParticles.java
T

38 lines
1.4 KiB
Java

/*
* This class is distributed as part of the Botania Mod.
* Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*/
package vazkii.botania.client.fx;
import net.minecraft.client.Minecraft;
import net.minecraft.particles.ParticleType;
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.registries.ObjectHolder;
import vazkii.botania.common.lib.LibMisc;
import static vazkii.botania.common.block.ModBlocks.register;
public class ModParticles {
@ObjectHolder(LibMisc.MOD_ID + ":wisp") public static ParticleType<WispParticleData> WISP;
@ObjectHolder(LibMisc.MOD_ID + ":sparkle") public static ParticleType<SparkleParticleData> SPARKLE;
public static void registerParticles(RegistryEvent.Register<ParticleType<?>> evt) {
register(evt.getRegistry(), new WispParticleType(), "wisp");
register(evt.getRegistry(), new SparkleParticleType(), "sparkle");
}
public static class FactoryHandler {
public static void registerFactories(ParticleFactoryRegisterEvent evt) {
Minecraft.getInstance().particles.registerFactory(ModParticles.WISP, WispParticleType.Factory::new);
Minecraft.getInstance().particles.registerFactory(ModParticles.SPARKLE, SparkleParticleType.Factory::new);
}
}
}