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, ContainerInput containerInput, 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 intThe field for thecontainerIdrecord component.private final ContainerInputThe field for thecontainerInputrecord 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.static final StreamCodec<RegistryFriendlyByteBuf, ServerboundContainerClickPacket> -
Constructor Summary
ConstructorsConstructorDescriptionServerboundContainerClickPacket(int containerId, int stateId, short slotNum, byte buttonNum, ContainerInput containerInput, 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.intReturns the value of thecontainerIdrecord component.Returns the value of thecontainerInputrecord component.final booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerGamePacketListener listener) 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 interface 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. -
containerInput
The field for thecontainerInputrecord 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, ContainerInput containerInput, 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 componentcontainerInput- the value for thecontainerInputrecord 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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
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
-
containerInput
Returns the value of thecontainerInputrecord component.- Returns:
- the value of the
containerInputrecord 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
-