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
ConstructorDescriptionServerboundContainerSlotStateChangedPacket
(int slotId, int containerId, boolean newState) Creates an instance of aServerboundContainerSlotStateChangedPacket
record class. -
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_307397_) 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.void
write
(FriendlyByteBuf p_307330_) 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, nextProtocol
-
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.
-
-
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
- Specified by:
write
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
-