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
@Internal
public record AdvancedContainerSetDataPayload(int containerId, int dataId, int value)
extends Record
implements CustomPacketPayload
A custom payload that updates the full dataslot value instead of just the short value
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thecontainerIdrecord component.private final intThe field for thedataIdrecord component.static final ResourceLocationprivate final intThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAdvancedContainerSetDataPayload(int containerId, int dataId, int value) Creates an instance of aAdvancedContainerSetDataPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecontainerIdrecord component.intdataId()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.id()final StringtoString()Returns a string representation of this record class.intvalue()Returns the value of thevaluerecord component.voidwrite(FriendlyByteBuf buffer)
-
Field Details
-
containerId
private final int containerIdThe field for thecontainerIdrecord component. -
dataId
private final int dataIdThe field for thedataIdrecord component. -
value
private final int valueThe field for thevaluerecord component. -
ID
-
-
Constructor Details
-
AdvancedContainerSetDataPayload
-
AdvancedContainerSetDataPayload
public AdvancedContainerSetDataPayload(int containerId, int 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
-
write
- Specified by:
writein interfaceCustomPacketPayload
-
id
- Specified by:
idin 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 int containerId()Returns the value of thecontainerIdrecord component.- Returns:
- the value of the
containerIdrecord component
-
dataId
public int 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
-