Record Class SplitPacketPayload
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.payload.SplitPacketPayload
- Record Components:
payload- The slice of the original packet.
- All Implemented Interfaces:
CustomPacketPayload
@Internal
public record SplitPacketPayload(byte[] payload)
extends Record
implements CustomPacketPayload
A payload that is used to split a packet into multiple payloads.
This single payload will contain a slice of the original packet.
-
Nested Class Summary
Nested classes/interfaces inherited from interface CustomPacketPayload
CustomPacketPayload.FallbackProvider<B>, CustomPacketPayload.Type<T>, CustomPacketPayload.TypeAndCodec<B,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]The field for thepayloadrecord component.static final StreamCodec<FriendlyByteBuf, SplitPacketPayload> static final CustomPacketPayload.Type<SplitPacketPayload> -
Constructor Summary
ConstructorsConstructorDescriptionSplitPacketPayload(byte[] payload) Creates an instance of aSplitPacketPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.byte[]payload()Returns the value of thepayloadrecord component.final StringtoString()Returns a string representation of this record class.type()Methods inherited from interface CustomPacketPayload
toVanillaClientbound, toVanillaServerbound
-
Field Details
-
payload
private final byte[] payloadThe field for thepayloadrecord component. -
TYPE
-
STREAM_CODEC
-
-
Constructor Details
-
SplitPacketPayload
public SplitPacketPayload(byte[] payload) Creates an instance of aSplitPacketPayloadrecord class.- Parameters:
payload- the value for thepayloadrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomPacketPayload
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
payload
-