记录类 NetworkPayloadSetup
java.lang.Object
java.lang.Record
net.neoforged.neoforge.network.registration.NetworkPayloadSetup
- 记录组件:
configuration
- The configuration channels.play
- The play channels.
@Internal
public record NetworkPayloadSetup(Map<ConnectionProtocol,Map<ResourceLocation,NetworkChannel>> channels)
extends Record
Represents a complete negotiated network, which is stored on the client and server.
-
字段概要
字段修饰符和类型字段说明private final Map
<ConnectionProtocol, Map<ResourceLocation, NetworkChannel>> channels
记录组件的字段。 -
构造器概要
构造器构造器说明创建NetworkPayloadSetup
记录类的实例。 -
方法概要
修饰符和类型方法说明channels()
返回channels
记录组件的值。static NetworkPayloadSetup
empty()
返回 An empty modded network.。final boolean
指示某个其他对象是否“等于”此对象。static NetworkPayloadSetup
from
(Map<ConnectionProtocol, NegotiationResult> results) 返回 A modded network with the given configuration and play channels.。@Nullable NetworkChannel
getChannel
(ConnectionProtocol protocol, ResourceLocation id) getChannels
(ConnectionProtocol protocol) final int
hashCode()
返回此对象的哈希代码值。final String
toString()
返回此记录类的字符串表示形式。
-
字段详细资料
-
channels
channels
记录组件的字段。 -
STREAM_CODEC
-
-
构造器详细资料
-
NetworkPayloadSetup
创建NetworkPayloadSetup
记录类的实例。- 参数:
channels
-channels
记录组件的值
-
-
方法详细资料
-
getChannels
-
getChannel
@Nullable public @Nullable NetworkChannel getChannel(ConnectionProtocol protocol, ResourceLocation id) -
empty
返回 An empty modded network.。- 返回:
- An empty modded network.
-
from
返回 A modded network with the given configuration and play channels.。- 返回:
- A modded network with the given configuration and play channels.
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)
进行比较。 -
channels
返回channels
记录组件的值。- 返回:
channels
记录组件的值
-