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 byte
The field for thebuttonNum
record component.private final HashedStack
The field for thecarriedItem
record component.private final it.unimi.dsi.fastutil.ints.Int2ObjectMap
<HashedStack> The field for thechangedSlots
record component.private final ClickType
The field for theclickType
record component.private final int
The field for thecontainerId
record component.private static final int
private final short
The field for theslotNum
record component.private static final StreamCodec
<RegistryFriendlyByteBuf, it.unimi.dsi.fastutil.ints.Int2ObjectMap<HashedStack>> private final int
The field for thestateId
record 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 aServerboundContainerClickPacket
record class. -
Method Summary
Modifier and TypeMethodDescriptionbyte
Returns the value of thebuttonNum
record component.Returns the value of thecarriedItem
record component.it.unimi.dsi.fastutil.ints.Int2ObjectMap
<HashedStack> Returns the value of thechangedSlots
record component.Returns the value of theclickType
record component.int
Returns the value of thecontainerId
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ServerGamePacketListener p_133958_) final int
hashCode()
Returns a hash code value for this object.short
slotNum()
Returns the value of theslotNum
record component.int
stateId()
Returns the value of thestateId
record component.final String
toString()
Returns a string representation of this record class.type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
containerId
private final int containerIdThe field for thecontainerId
record component. -
stateId
private final int stateIdThe field for thestateId
record component. -
slotNum
private final short slotNumThe field for theslotNum
record component. -
buttonNum
private final byte buttonNumThe field for thebuttonNum
record component. -
clickType
The field for theclickType
record component. -
changedSlots
The field for thechangedSlots
record component. -
carriedItem
The field for thecarriedItem
record 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 aServerboundContainerClickPacket
record class.- Parameters:
containerId
- the value for thecontainerId
record componentstateId
- the value for thestateId
record componentslotNum
- the value for theslotNum
record componentbuttonNum
- the value for thebuttonNum
record componentclickType
- the value for theclickType
record componentchangedSlots
- the value for thechangedSlots
record componentcarriedItem
- the value for thecarriedItem
record component
-
-
Method Details
-
type
- Specified by:
type
in interfacePacket<ServerGamePacketListener>
-
handle
- Specified by:
handle
in 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 thecontainerId
record component.- Returns:
- the value of the
containerId
record component
-
stateId
public int stateId()Returns the value of thestateId
record component.- Returns:
- the value of the
stateId
record component
-
slotNum
public short slotNum()Returns the value of theslotNum
record component.- Returns:
- the value of the
slotNum
record component
-
buttonNum
public byte buttonNum()Returns the value of thebuttonNum
record component.- Returns:
- the value of the
buttonNum
record component
-
clickType
Returns the value of theclickType
record component.- Returns:
- the value of the
clickType
record component
-
changedSlots
Returns the value of thechangedSlots
record component.- Returns:
- the value of the
changedSlots
record component
-
carriedItem
Returns the value of thecarriedItem
record component.- Returns:
- the value of the
carriedItem
record component
-