Package at.petrak.hexcasting.common.msgs
Record Class MsgShiftScrollC2S
java.lang.Object
java.lang.Record
at.petrak.hexcasting.common.msgs.MsgShiftScrollC2S
- All Implemented Interfaces:
IMessage
public record MsgShiftScrollC2S(double mainHandDelta, double offHandDelta, boolean isCtrl, boolean invertSpellbook, boolean invertAbacus)
extends Record
implements IMessage
Sent client->server when the client shift+scrolls with a shift-scrollable item
or scrolls in the spellcasting UI.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMsgShiftScrollC2S(double mainHandDelta, double offHandDelta, boolean isCtrl, boolean invertSpellbook, boolean invertAbacus) Creates an instance of aMsgShiftScrollC2Srecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic MsgShiftScrollC2Sdeserialize(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) final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinvertAbacusrecord component.booleanReturns the value of theinvertSpellbookrecord component.booleanisCtrl()Returns the value of theisCtrlrecord component.doubleReturns the value of themainHandDeltarecord component.doubleReturns the value of theoffHandDeltarecord 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
-
MsgShiftScrollC2S
public MsgShiftScrollC2S(double mainHandDelta, double offHandDelta, boolean isCtrl, boolean invertSpellbook, boolean invertAbacus) Creates an instance of aMsgShiftScrollC2Srecord class.- Parameters:
mainHandDelta- the value for themainHandDeltarecord componentoffHandDelta- the value for theoffHandDeltarecord componentisCtrl- the value for theisCtrlrecord componentinvertSpellbook- the value for theinvertSpellbookrecord componentinvertAbacus- the value for theinvertAbacusrecord 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 with '=='. -
mainHandDelta
public double mainHandDelta()Returns the value of themainHandDeltarecord component.- Returns:
- the value of the
mainHandDeltarecord component
-
offHandDelta
public double offHandDelta()Returns the value of theoffHandDeltarecord component.- Returns:
- the value of the
offHandDeltarecord component
-
isCtrl
public boolean isCtrl()Returns the value of theisCtrlrecord component.- Returns:
- the value of the
isCtrlrecord component
-
invertSpellbook
public boolean invertSpellbook()Returns the value of theinvertSpellbookrecord component.- Returns:
- the value of the
invertSpellbookrecord component
-
invertAbacus
public boolean invertAbacus()Returns the value of theinvertAbacusrecord component.- Returns:
- the value of the
invertAbacusrecord component
-