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.Codec<T> codec, net.minecraft.core.particles.ParticleOptions.Deserializer<T> deserializer) Creates a new particle type the 1.20.1 way, with a codec and a deserializer for network and command data.static <T extends net.minecraft.core.particles.ParticleOptions>
net.minecraft.core.particles.ParticleType<T>complex(boolean alwaysSpawn, com.mojang.serialization.MapCodec<T> codec, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, 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>, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, 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.Codec<T> codec, net.minecraft.core.particles.ParticleOptions.Deserializer<T> deserializer) Creates a new particle type the 1.20.1 way, with a codec and a deserializer for network and command data.static <T extends net.minecraft.core.particles.ParticleOptions>
net.minecraft.core.particles.ParticleType<T>complex(com.mojang.serialization.MapCodec<T> codec, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, 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>, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, 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, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, T> packetCodec) Creates a new particle type with a custom factory and codecs for packet/data serialization.On 1.20.1, particle options write themselves to the network (
ParticleOptions.writeToNetwork(net.minecraft.network.FriendlyByteBuf)): make it write whatpacketCodecreads, e.g.PACKET_CODEC.encode(buf, this). In commands, the options are given as SNBT thatcodecreads.- 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, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, T> packetCodec) Creates a new particle type with a custom factory and codecs for packet/data serialization. Seecomplex(MapCodec, StreamCodec).- 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>, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, 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. Seecomplex(MapCodec, StreamCodec).- 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>, StreamCodec<? super net.minecraft.network.FriendlyByteBuf, 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. Seecomplex(MapCodec, StreamCodec).- 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.
-
complex
public static <T extends net.minecraft.core.particles.ParticleOptions> net.minecraft.core.particles.ParticleType<T> complex(com.mojang.serialization.Codec<T> codec, net.minecraft.core.particles.ParticleOptions.Deserializer<T> deserializer) Creates a new particle type the 1.20.1 way, with a codec and a deserializer for network and command data.- Parameters:
codec- The codec for serialization.deserializer- The particle deserializer for network and command serialization.
-
complex
public static <T extends net.minecraft.core.particles.ParticleOptions> net.minecraft.core.particles.ParticleType<T> complex(boolean alwaysSpawn, com.mojang.serialization.Codec<T> codec, net.minecraft.core.particles.ParticleOptions.Deserializer<T> deserializer) Creates a new particle type the 1.20.1 way, with a codec and a deserializer for network and command data.- Parameters:
alwaysSpawn- True to always spawn the particle regardless of distance.codec- The codec for serialization.deserializer- The particle deserializer for network and command serialization.
-