Package net.minecraftforge.network
Record Class SimpleChannel.HandlerProtocol<BUF extends FriendlyByteBuf,CTX,BASE extends SimplePacket<CTX>>
java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.HandlerProtocol<BUF,CTX,BASE>
- All Implemented Interfaces:
ChannelBuildable<Object>,BaseProtocol<SimpleHandlerFlow<BUF,,BASE>, SimpleHandlerProtocol<BUF, BASE>> SimpleHandlerProtocol<BUF,,BASE> SimpleBuildable,SimpleConnection<BASE>,SimpleChannel.ProtocolFactory<BUF,BASE>
- Enclosing class:
SimpleChannel
private static record SimpleChannel.HandlerProtocol<BUF extends FriendlyByteBuf,CTX,BASE extends SimplePacket<CTX>> (io.netty.util.AttributeKey<CTX> key, SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE extends SimplePacket<CTX>> ctx)
extends Record
implements SimpleChannel.ProtocolFactory<BUF,BASE>, SimpleHandlerProtocol<BUF,BASE>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateHandlerProtocol(io.netty.util.AttributeKey<CTX> key, SimpleChannel.SimpleContext<BUF, BASE> ctx) Creates an instance of aHandlerProtocolrecord class. -
Method Summary
Modifier and TypeMethodDescriptionctx()Returns the value of thectxrecord component.final booleanIndicates whether some other object is "equal to" this one.flow(@Nullable PacketFlow flow) final inthashCode()Returns a hash code value for this object.io.netty.util.AttributeKey<CTX> key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.network.simple.BaseProtocol
bidirectional, bidirectional, clientbound, clientbound, flow, flow, serverbound, serverboundMethods inherited from interface net.minecraftforge.network.SimpleChannel.ProtocolFactory
build, protocol, protocolMethods inherited from interface net.minecraftforge.network.simple.SimpleConnection
any, any, any, any, configuration, configuration, configuration, configuration, login, login, login, login, play, play, play, play, protocol, protocol
-
Field Details
-
key
The field for thekeyrecord component. -
ctx
private final SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE extends SimplePacket<CTX>> ctxThe field for thectxrecord component.
-
-
Constructor Details
-
HandlerProtocol
private HandlerProtocol(io.netty.util.AttributeKey<CTX> key, SimpleChannel.SimpleContext<BUF, BASE> ctx) Creates an instance of aHandlerProtocolrecord class.- Parameters:
key- the value for thekeyrecord componentctx- the value for thectxrecord component
-
-
Method Details
-
flow
- Specified by:
flowin interfaceBaseProtocol<BUF extends FriendlyByteBuf,CTX>
-
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 withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
ctx
Returns the value of thectxrecord component.- Specified by:
ctxin interfaceSimpleChannel.ProtocolFactory<BUF extends FriendlyByteBuf,CTX> - Returns:
- the value of the
ctxrecord component
-