BCLib Supported ParticleType handling
This commit is contained in:
parent
a7ba94a07c
commit
73b20f88c5
1 changed files with 39 additions and 0 deletions
|
@ -0,0 +1,39 @@
|
||||||
|
package org.betterx.bclib.particles;
|
||||||
|
|
||||||
|
import net.minecraft.core.Registry;
|
||||||
|
import net.minecraft.core.particles.SimpleParticleType;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
|
||||||
|
|
||||||
|
public class BCLParticleType {
|
||||||
|
public static SimpleParticleType simple(boolean alwaysSpawn) {
|
||||||
|
return new SimpleParticleType(alwaysSpawn) {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SimpleParticleType simple() {
|
||||||
|
return simple(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SimpleParticleType registerSimple(ResourceLocation location) {
|
||||||
|
return registerSimple(location, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SimpleParticleType registerSimple(ResourceLocation location, boolean alwaysSpawn) {
|
||||||
|
return Registry.register(Registry.PARTICLE_TYPE, location, simple(alwaysSpawn));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SimpleParticleType registerSimple(ResourceLocation location,
|
||||||
|
ParticleFactoryRegistry.PendingParticleFactory<SimpleParticleType> provider) {
|
||||||
|
return registerSimple(location, false, provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SimpleParticleType registerSimple(ResourceLocation location,
|
||||||
|
boolean alwaysSpawn,
|
||||||
|
ParticleFactoryRegistry.PendingParticleFactory<SimpleParticleType> provider) {
|
||||||
|
SimpleParticleType type = Registry.register(Registry.PARTICLE_TYPE, location, simple(alwaysSpawn));
|
||||||
|
ParticleFactoryRegistry.getInstance().register(type, provider);
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue