Package at.petrak.hexcasting.common.msgs
Record Class MsgNewSpellPatternC2S
java.lang.Object
java.lang.Record
at.petrak.hexcasting.common.msgs.MsgNewSpellPatternC2S
- All Implemented Interfaces:
IMessage
public record MsgNewSpellPatternC2S(net.minecraft.world.InteractionHand handUsed, at.petrak.hexcasting.api.casting.math.HexPattern pattern, List<at.petrak.hexcasting.api.casting.eval.ResolvedPattern> resolvedPatterns)
extends Record
implements IMessage
Sent client->server when the player finishes drawing a pattern.
Server will send back a
MsgNewSpellPatternS2C packet-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMsgNewSpellPatternC2S(net.minecraft.world.InteractionHand handUsed, at.petrak.hexcasting.api.casting.math.HexPattern pattern, List<at.petrak.hexcasting.api.casting.eval.ResolvedPattern> resolvedPatterns) Creates an instance of aMsgNewSpellPatternC2Srecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MsgNewSpellPatternC2Sdeserialize(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.voidhandle(net.minecraft.server.MinecraftServer server, net.minecraft.server.level.ServerPlayer sender) net.minecraft.world.InteractionHandhandUsed()Returns the value of thehandUsedrecord component.final inthashCode()Returns a hash code value for this object.at.petrak.hexcasting.api.casting.math.HexPatternpattern()Returns the value of thepatternrecord component.List<at.petrak.hexcasting.api.casting.eval.ResolvedPattern>Returns the value of theresolvedPatternsrecord component.voidserialize(net.minecraft.network.FriendlyByteBuf buf) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
MsgNewSpellPatternC2S
public MsgNewSpellPatternC2S(net.minecraft.world.InteractionHand handUsed, at.petrak.hexcasting.api.casting.math.HexPattern pattern, List<at.petrak.hexcasting.api.casting.eval.ResolvedPattern> resolvedPatterns) Creates an instance of aMsgNewSpellPatternC2Srecord class.- Parameters:
handUsed- the value for thehandUsedrecord componentpattern- the value for thepatternrecord componentresolvedPatterns- the value for theresolvedPatternsrecord 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
public void handle(net.minecraft.server.MinecraftServer server, net.minecraft.server.level.ServerPlayer sender) -
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). -
handUsed
public net.minecraft.world.InteractionHand handUsed()Returns the value of thehandUsedrecord component.- Returns:
- the value of the
handUsedrecord component
-
pattern
public at.petrak.hexcasting.api.casting.math.HexPattern pattern()Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
resolvedPatterns
Returns the value of theresolvedPatternsrecord component.- Returns:
- the value of the
resolvedPatternsrecord component
-