Record Class PacketAdapter
java.lang.Object
java.lang.Record
net.darkhax.bookshelf.common.impl.registry.adapter.PacketAdapter
public record PacketAdapter(RegistrationContext context, Consumer<IPacket<?>> registerFunc)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPacketAdapter(RegistrationContext context, Consumer<IPacket<?>> registerFunc) Creates an instance of aPacketAdapterrecord class. -
Method Summary
Modifier and TypeMethodDescription<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
IPacket<T> context()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theregisterFuncrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PacketAdapter
Creates an instance of aPacketAdapterrecord class.- Parameters:
context- the value for thecontextrecord componentregisterFunc- the value for theregisterFuncrecord component
-
-
Method Details
-
add
-
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). -
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-
registerFunc
-