Record Class AdvancedContainerSetDataPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.AdvancedContainerSetDataPayload
- Record Components:
containerId- The containerId for the container.dataId- The ID of the dataslot.value- The value of the dataslot.
- All Implemented Interfaces:
CustomPacketPayload,ClientDispatchPayload
@Internal
public record AdvancedContainerSetDataPayload(byte containerId, short dataId, int value)
extends Record
implements ClientDispatchPayload
A custom payload that updates the full dataslot value instead of just the short value
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
CustomPacketPayload.FallbackProvider<B extends FriendlyByteBuf>, CustomPacketPayload.Type<T extends CustomPacketPayload>, CustomPacketPayload.TypeAndCodec<B extends FriendlyByteBuf,T extends CustomPacketPayload> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byteThe field for thecontainerIdrecord component.private final shortThe field for thedataIdrecord component.static final CustomPacketPayload.Type<AdvancedContainerSetDataPayload> private final intThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedContainerSetDataPayload(byte containerId, short dataId, int value) Creates an instance of aAdvancedContainerSetDataPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyteReturns the value of thecontainerIdrecord component.shortdataId()Returns the value of thedataIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()intvalue()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
containerId
private final byte containerIdThe field for thecontainerIdrecord component. -
dataId
private final short dataIdThe field for thedataIdrecord component. -
value
private final int valueThe field for thevaluerecord component. -
TYPE
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf,AdvancedContainerSetDataPayload> STREAM_CODEC
-
-
Constructor Details
-
AdvancedContainerSetDataPayload
public AdvancedContainerSetDataPayload(byte containerId, short dataId, int value) Creates an instance of aAdvancedContainerSetDataPayloadrecord class.- Parameters:
containerId- the value for thecontainerIdrecord componentdataId- the value for thedataIdrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
toVanillaPacket
-
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 '=='. -
containerId
public byte containerId()Returns the value of thecontainerIdrecord component.- Returns:
- the value of the
containerIdrecord component
-
dataId
public short dataId()Returns the value of thedataIdrecord component.- Returns:
- the value of the
dataIdrecord component
-
value
public int value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-