Record Class ServerboundContainerSlotStateChangedPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ServerboundContainerSlotStateChangedPacket
- All Implemented Interfaces:
Packet<ServerGamePacketListener>
public record ServerboundContainerSlotStateChangedPacket(int slotId, int containerId, boolean newState)
extends Record
implements Packet<ServerGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
The field for thecontainerId
record component.private final boolean
The field for thenewState
record component.private final int
The field for theslotId
record component. -
Constructor Summary
ModifierConstructorDescriptionServerboundContainerSlotStateChangedPacket
(int slotId, int containerId, boolean newState) Creates an instance of aServerboundContainerSlotStateChangedPacket
record class.private
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thecontainerId
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ServerGamePacketListener p_309835_) final int
hashCode()
Returns a hash code value for this object.boolean
newState()
Returns the value of thenewState
record component.int
slotId()
Returns the value of theslotId
record component.final String
toString()
Returns a string representation of this record class.type()
private void
write
(FriendlyByteBuf p_310021_) 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
-
slotId
private final int slotIdThe field for theslotId
record component. -
containerId
private final int containerIdThe field for thecontainerId
record component. -
newState
private final boolean newStateThe field for thenewState
record component. -
STREAM_CODEC
public static final StreamCodec<FriendlyByteBuf,ServerboundContainerSlotStateChangedPacket> STREAM_CODEC
-
-
Constructor Details
-
ServerboundContainerSlotStateChangedPacket
-
ServerboundContainerSlotStateChangedPacket
public ServerboundContainerSlotStateChangedPacket(int slotId, int containerId, boolean newState) Creates an instance of aServerboundContainerSlotStateChangedPacket
record class.- Parameters:
slotId
- the value for theslotId
record componentcontainerId
- the value for thecontainerId
record componentnewState
- the value for thenewState
record component
-
-
Method Details
-
write
-
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. All components in this record class are compared with '=='. -
slotId
public int slotId()Returns the value of theslotId
record component.- Returns:
- the value of the
slotId
record component
-
containerId
public int containerId()Returns the value of thecontainerId
record component.- Returns:
- the value of the
containerId
record component
-
newState
public boolean newState()Returns the value of thenewState
record component.- Returns:
- the value of the
newState
record component
-