Migrated all to BCLibs ParticleType API
This commit is contained in:
parent
bddfa09b12
commit
6d58f088e4
1 changed files with 10 additions and 7 deletions
|
@ -1,13 +1,13 @@
|
||||||
package org.betterx.betterend.registry;
|
package org.betterx.betterend.registry;
|
||||||
|
|
||||||
import net.minecraft.core.Registry;
|
|
||||||
import net.minecraft.core.particles.ParticleOptions;
|
import net.minecraft.core.particles.ParticleOptions;
|
||||||
import net.minecraft.core.particles.ParticleType;
|
import net.minecraft.core.particles.ParticleType;
|
||||||
import net.minecraft.core.particles.SimpleParticleType;
|
import net.minecraft.core.particles.SimpleParticleType;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
|
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
|
||||||
import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes;
|
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec;
|
||||||
|
import org.betterx.bclib.particles.BCLParticleType;
|
||||||
import org.betterx.betterend.BetterEnd;
|
import org.betterx.betterend.BetterEnd;
|
||||||
import org.betterx.betterend.particle.*;
|
import org.betterx.betterend.particle.*;
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@ public class EndParticles {
|
||||||
public static final SimpleParticleType PORTAL_SPHERE = register("portal_sphere");
|
public static final SimpleParticleType PORTAL_SPHERE = register("portal_sphere");
|
||||||
public static final ParticleType<InfusionParticleType> INFUSION = register(
|
public static final ParticleType<InfusionParticleType> INFUSION = register(
|
||||||
"infusion",
|
"infusion",
|
||||||
FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY)
|
InfusionParticleType.PARAMETERS_FACTORY,
|
||||||
|
InfusionParticleType.CODEC
|
||||||
);
|
);
|
||||||
public static final SimpleParticleType SULPHUR_PARTICLE = register("sulphur_particle");
|
public static final SimpleParticleType SULPHUR_PARTICLE = register("sulphur_particle");
|
||||||
public static final SimpleParticleType GEYSER_PARTICLE = registerFar("geyser_particle");
|
public static final SimpleParticleType GEYSER_PARTICLE = registerFar("geyser_particle");
|
||||||
|
@ -44,14 +45,16 @@ public class EndParticles {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SimpleParticleType register(String name) {
|
private static SimpleParticleType register(String name) {
|
||||||
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple());
|
return BCLParticleType.register(BetterEnd.makeID(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static SimpleParticleType registerFar(String name) {
|
private static SimpleParticleType registerFar(String name) {
|
||||||
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple(true));
|
return BCLParticleType.register(BetterEnd.makeID(name), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T extends ParticleOptions> ParticleType<T> register(String name, ParticleType<T> type) {
|
private static <T extends ParticleOptions> ParticleType<T> register(String name,
|
||||||
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), type);
|
ParticleOptions.Deserializer<T> type,
|
||||||
|
Codec<T> codec) {
|
||||||
|
return BCLParticleType.register(BetterEnd.makeID(name), type, codec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue