Package at.petrak.hexcasting.common.msgs
Record Class MsgCastParticleS2C
java.lang.Object
java.lang.Record
at.petrak.hexcasting.common.msgs.MsgCastParticleS2C
- All Implemented Interfaces:
IMessage
public record MsgCastParticleS2C(at.petrak.hexcasting.api.casting.ParticleSpray spray, FrozenPigment colorizer)
extends Record
implements IMessage
Sent server->client to spray particles everywhere.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMsgCastParticleS2C(at.petrak.hexcasting.api.casting.ParticleSpray spray, FrozenPigment colorizer) Creates an instance of aMsgCastParticleS2Crecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecolorizerrecord component.static MsgCastParticleS2Cdeserialize(io.netty.buffer.ByteBuf buffer) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.resources.ResourceLocationForge auto-assigns incrementing integers, Fabric requires us to declare an ID These are sent using vanilla's custom plugin channel system and thus are written to every single packet.static voidhandle(MsgCastParticleS2C msg) final inthashCode()Returns a hash code value for this object.voidserialize(net.minecraft.network.FriendlyByteBuf buf) at.petrak.hexcasting.api.casting.ParticleSprayspray()Returns the value of thesprayrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
MsgCastParticleS2C
public MsgCastParticleS2C(at.petrak.hexcasting.api.casting.ParticleSpray spray, FrozenPigment colorizer) Creates an instance of aMsgCastParticleS2Crecord class.- Parameters:
spray- the value for thesprayrecord componentcolorizer- the value for thecolorizerrecord component
-
-
Method Details
-
getFabricId
public net.minecraft.resources.ResourceLocation getFabricId()Description copied from interface:IMessageForge auto-assigns incrementing integers, Fabric requires us to declare an ID These are sent using vanilla's custom plugin channel system and thus are written to every single packet. So this ID tends to be more terse.- Specified by:
getFabricIdin interfaceIMessage
-
deserialize
-
serialize
public void serialize(net.minecraft.network.FriendlyByteBuf buf) -
handle
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
spray
public at.petrak.hexcasting.api.casting.ParticleSpray spray()Returns the value of thesprayrecord component.- Returns:
- the value of the
sprayrecord component
-
colorizer
Returns the value of thecolorizerrecord component.- Returns:
- the value of the
colorizerrecord component
-