Class ParticleTypes
java.lang.Object
net.ixdarklord.coolcatcore.api.utils.ParticleTypes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends net.minecraft.core.particles.ParticleOptions>
net.minecraft.core.particles.ParticleType<T> complex(boolean alwaysSpawn, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> packetCodec) Creates a new particle type with a custom factory and codecs for packet/data serialization.static <T extends net.minecraft.core.particles.ParticleOptions>
net.minecraft.core.particles.ParticleType<T> complex(boolean alwaysSpawn, Function<net.minecraft.core.particles.ParticleType<T>, com.mojang.serialization.MapCodec<T>> codecGetter, Function<net.minecraft.core.particles.ParticleType<T>, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T>> packetCodecGetter) Creates a new particle type with a custom factory and codecs for packet/data serialization.static <T extends net.minecraft.core.particles.ParticleOptions>
net.minecraft.core.particles.ParticleType<T> complex(com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> packetCodec) Creates a new particle type with a custom factory and codecs for packet/data serialization.static <T extends net.minecraft.core.particles.ParticleOptions>
net.minecraft.core.particles.ParticleType<T> complex(Function<net.minecraft.core.particles.ParticleType<T>, com.mojang.serialization.MapCodec<T>> codecGetter, Function<net.minecraft.core.particles.ParticleType<T>, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T>> packetCodecGetter) Creates a new particle type with a custom factory and codecs for packet/data serialization.static net.minecraft.core.particles.SimpleParticleTypesimple()static net.minecraft.core.particles.SimpleParticleTypesimple(boolean alwaysSpawn) Creates a new, default particle type for the given id.
-
Constructor Details
-
ParticleTypes
public ParticleTypes()
-
-
Method Details
-
simple
public static net.minecraft.core.particles.SimpleParticleType simple() -
simple
public static net.minecraft.core.particles.SimpleParticleType simple(boolean alwaysSpawn) Creates a new, default particle type for the given id.- Parameters:
alwaysSpawn- True to always spawn the particle regardless of distance.
-
complex
public static <T extends net.minecraft.core.particles.ParticleOptions> net.minecraft.core.particles.ParticleType<T> complex(com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> packetCodec) Creates a new particle type with a custom factory and codecs for packet/data serialization.- Parameters:
codec- The codec for serialization.packetCodec- The packet codec for network serialization.
-
complex
public static <T extends net.minecraft.core.particles.ParticleOptions> net.minecraft.core.particles.ParticleType<T> complex(boolean alwaysSpawn, com.mojang.serialization.MapCodec<T> codec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T> packetCodec) Creates a new particle type with a custom factory and codecs for packet/data serialization.- Parameters:
alwaysSpawn- True to always spawn the particle regardless of distance.codec- The codec for serialization.packetCodec- The packet codec for network serialization.
-
complex
public static <T extends net.minecraft.core.particles.ParticleOptions> net.minecraft.core.particles.ParticleType<T> complex(Function<net.minecraft.core.particles.ParticleType<T>, com.mojang.serialization.MapCodec<T>> codecGetter, Function<net.minecraft.core.particles.ParticleType<T>, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T>> packetCodecGetter) Creates a new particle type with a custom factory and codecs for packet/data serialization. This method is useful when two differentParticleTypes share the sameParticleOptionsimplementation.- Parameters:
codecGetter- A function that, given the newly created type, returns the codec for serialization.packetCodecGetter- A function that, given the newly created type, returns the packet codec for network serialization.
-
complex
public static <T extends net.minecraft.core.particles.ParticleOptions> net.minecraft.core.particles.ParticleType<T> complex(boolean alwaysSpawn, Function<net.minecraft.core.particles.ParticleType<T>, com.mojang.serialization.MapCodec<T>> codecGetter, Function<net.minecraft.core.particles.ParticleType<T>, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, T>> packetCodecGetter) Creates a new particle type with a custom factory and codecs for packet/data serialization. This method is useful when two differentParticleTypes share the sameParticleOptionsimplementation.- Parameters:
alwaysSpawn- True to always spawn the particle regardless of distance.codecGetter- A function that, given the newly created type, returns the codec for serialization.packetCodecGetter- A function that, given the newly created type, returns the packet codec for network serialization.
-