This commit is contained in:
paulevsGitch 2020-12-04 15:09:09 +03:00
parent 6ee49ed3e6
commit 49c8d97d9e
11 changed files with 101 additions and 21 deletions

View file

@ -9,6 +9,7 @@ import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd;
import ru.betterend.particle.InfusionParticle;
import ru.betterend.particle.InfusionParticleType;
import ru.betterend.particle.ParticleGeyser;
import ru.betterend.particle.ParticleGlowingSphere;
import ru.betterend.particle.ParticleSulphur;
import ru.betterend.particle.PaticlePortalSphere;
@ -18,18 +19,24 @@ public class EndParticles {
public static final DefaultParticleType PORTAL_SPHERE = register("portal_sphere");
public static final ParticleType<InfusionParticleType> INFUSION = register("infusion", FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY));
public static final DefaultParticleType SULPHUR_PARTICLE = register("sulphur_particle");
public static final DefaultParticleType GEYSER_PARTICLE = registerFar("geyser_particle");
public static void register() {
ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
ParticleFactoryRegistry.getInstance().register(PORTAL_SPHERE, PaticlePortalSphere.FactoryPortalSphere::new);
ParticleFactoryRegistry.getInstance().register(INFUSION, InfusionParticle.DefaultFactory::new);
ParticleFactoryRegistry.getInstance().register(INFUSION, InfusionParticle.InfusionFactory::new);
ParticleFactoryRegistry.getInstance().register(SULPHUR_PARTICLE, ParticleSulphur.FactorySulphur::new);
ParticleFactoryRegistry.getInstance().register(GEYSER_PARTICLE, ParticleGeyser.FactoryGeyser::new);
}
private static DefaultParticleType register(String name) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple());
}
private static DefaultParticleType registerFar(String name) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple(true));
}
private static <T extends ParticleEffect> ParticleType<T> register(String name, ParticleType<T> type) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), type);
}