类 NeoForgeStreamCodecs
java.lang.Object
net.neoforged.neoforge.network.codec.NeoForgeStreamCodecs
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final StreamCodec
<FriendlyByteBuf, ChunkPos> static final StreamCodec
<FriendlyByteBuf, byte[]> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <V> StreamCodec
<RegistryFriendlyByteBuf, V> connectionAware
(StreamCodec<? super RegistryFriendlyByteBuf, V> neoForgeCodec, StreamCodec<? super RegistryFriendlyByteBuf, V> otherCodec) Creates a stream codec that uses different implementation depending on theConnectionType
.static <B extends FriendlyByteBuf,
V extends Enum<V>>
StreamCodec<B, V> static <B,
V> StreamCodec <B, V> lazy
(Supplier<StreamCodec<B, V>> streamCodecSupplier) static <B extends FriendlyByteBuf>
StreamCodec<B, ResourceKey<? extends Registry<?>>> Creates a stream codec to encode and decode aResourceKey
that identifies a registry.static <B,
V> StreamCodec <B, V> uncheckedUnit
(V defaultValue) Similar toStreamCodec.unit(Object)
, but without checks for the value to be encoded.
-
字段详细资料
-
UNBOUNDED_BYTE_ARRAY
-
CHUNK_POS
-
-
构造器详细资料
-
NeoForgeStreamCodecs
public NeoForgeStreamCodecs()
-
-
方法详细资料
-
lazy
-
enumCodec
public static <B extends FriendlyByteBuf,V extends Enum<V>> StreamCodec<B,V> enumCodec(Class<V> enumClass) -
registryKey
public static <B extends FriendlyByteBuf> StreamCodec<B,ResourceKey<? extends Registry<?>>> registryKey()Creates a stream codec to encode and decode aResourceKey
that identifies a registry. -
connectionAware
public static <V> StreamCodec<RegistryFriendlyByteBuf,V> connectionAware(StreamCodec<? super RegistryFriendlyByteBuf, V> neoForgeCodec, StreamCodec<? super RegistryFriendlyByteBuf, V> otherCodec) Creates a stream codec that uses different implementation depending on theConnectionType
. Should be used to keep vanilla connection compatibility. -
uncheckedUnit
Similar toStreamCodec.unit(Object)
, but without checks for the value to be encoded.
-