Package net.minecraftforge.network
Record Class SimpleChannel.Protocol<BUF extends FriendlyByteBuf,BASE>
java.lang.Object
java.lang.Record
net.minecraftforge.network.SimpleChannel.Protocol<BUF,BASE>
- All Implemented Interfaces:
ChannelBuildable<Object>
,BaseProtocol<SimpleFlow<BUF,
,BASE>, SimpleProtocol<BUF, BASE>> SimpleBuildable
,SimpleConnection<BASE>
,SimpleProtocol<BUF,
,BASE> SimpleChannel.ProtocolFactory<BUF,
BASE>
- Enclosing class:
SimpleChannel
private static record SimpleChannel.Protocol<BUF extends FriendlyByteBuf,BASE> (SimpleChannel.SimpleContext<BUF extends FriendlyByteBuf,BASE> ctx)
extends Record
implements SimpleChannel.ProtocolFactory<BUF,BASE>, SimpleProtocol<BUF,BASE>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final SimpleChannel.SimpleContext
<BUF, BASE> The field for thectx
record component. -
Constructor Summary
ModifierConstructorDescriptionprivate
Creates an instance of aProtocol
record class. -
Method Summary
Modifier and TypeMethodDescriptionctx()
Returns the value of thectx
record component.final boolean
Indicates whether some other object is "equal to" this one.flow
(@Nullable PacketFlow flow) final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.network.simple.BaseProtocol
bidirectional, bidirectional, clientbound, clientbound, flow, flow, serverbound, serverbound
Methods inherited from interface net.minecraftforge.network.SimpleChannel.ProtocolFactory
build, protocol, protocol
Methods 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
-
ctx
The field for thectx
record component.
-
-
Constructor Details
-
Protocol
Creates an instance of aProtocol
record class.- Parameters:
ctx
- the value for thectx
record component
-
-
Method Details
-
flow
- Specified by:
flow
in interfaceBaseProtocol<BUF extends FriendlyByteBuf,
BASE>
-
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)
. -
ctx
Returns the value of thectx
record component.- Specified by:
ctx
in interfaceSimpleChannel.ProtocolFactory<BUF extends FriendlyByteBuf,
BASE> - Returns:
- the value of the
ctx
record component
-