Record Class ServerboundContainerClickPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundContainerClickPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundContainerClickPacket(int containerId, int stateId, short slotNum, byte buttonNum, ClickType clickType, it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack> changedSlots, HashedStack carriedItem)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byteThe field for thebuttonNumrecord component.private final HashedStackThe field for thecarriedItemrecord component.private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack> The field for thechangedSlotsrecord component.private final ClickTypeThe field for theclickTyperecord component.private final intThe field for thecontainerIdrecord component.private static final intprivate final shortThe field for theslotNumrecord component.private static final StreamCodec<RegistryFriendlyByteBuf, it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack>> private final intThe field for thestateIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionServerboundContainerClickPacket(int containerId, int stateId, short slotNum, byte buttonNum, ClickType clickType, it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack> changedSlots, HashedStack carriedItem) Creates an instance of aServerboundContainerClickPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyteReturns the value of thebuttonNumrecord component.Returns the value of thecarriedItemrecord component.it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack> Returns the value of thechangedSlotsrecord component.Returns the value of theclickTyperecord component.intReturns the value of thecontainerIdrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener pHandler) Passes this Packet on to the NetHandler for processing.final inthashCode()Returns a hash code value for this object.shortslotNum()Returns the value of theslotNumrecord component.intstateId()Returns the value of thestateIdrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
containerId
private final int containerIdThe field for thecontainerIdrecord component. -
stateId
private final int stateIdThe field for thestateIdrecord component. -
slotNum
private final short slotNumThe field for theslotNumrecord component. -
buttonNum
private final byte buttonNumThe field for thebuttonNumrecord component. -
clickType
The field for theclickTyperecord component. -
changedSlots
The field for thechangedSlotsrecord component. -
carriedItem
The field for thecarriedItemrecord component. -
MAX_SLOT_COUNT
private static final int MAX_SLOT_COUNT- See Also:
-
SLOTS_STREAM_CODEC
private static final StreamCodec<RegistryFriendlyByteBuf,it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack>> SLOTS_STREAM_CODEC -
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf,ServerboundContainerClickPacket> STREAM_CODEC
-
-
Constructor Details
-
ServerboundContainerClickPacket
public ServerboundContainerClickPacket(int containerId, int stateId, short slotNum, byte buttonNum, ClickType clickType, it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack> changedSlots, HashedStack carriedItem) Creates an instance of aServerboundContainerClickPacketrecord class.- Parameters:
containerId- the value for thecontainerIdrecord componentstateId- the value for thestateIdrecord componentslotNum- the value for theslotNumrecord componentbuttonNum- the value for thebuttonNumrecord componentclickType- the value for theclickTyperecord componentchangedSlots- the value for thechangedSlotsrecord componentcarriedItem- the value for thecarriedItemrecord component
-
-
Method Details
-
type
- Specified by:
typein interfacePacket<ServerGamePacketListener>
-
handle
Passes this Packet on to the NetHandler for processing.- Specified by:
handlein interfacePacket<ServerGamePacketListener>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
containerId
public int containerId()Returns the value of thecontainerIdrecord component.- Returns:
- the value of the
containerIdrecord component
-
stateId
public int stateId()Returns the value of thestateIdrecord component.- Returns:
- the value of the
stateIdrecord component
-
slotNum
public short slotNum()Returns the value of theslotNumrecord component.- Returns:
- the value of the
slotNumrecord component
-
buttonNum
public byte buttonNum()Returns the value of thebuttonNumrecord component.- Returns:
- the value of the
buttonNumrecord component
-
clickType
Returns the value of theclickTyperecord component.- Returns:
- the value of the
clickTyperecord component
-
changedSlots
Returns the value of thechangedSlotsrecord component.- Returns:
- the value of the
changedSlotsrecord component
-
carriedItem
Returns the value of thecarriedItemrecord component.- Returns:
- the value of the
carriedItemrecord component
-