Interface DataComponent<T>
- Type Parameters:
T- The value type of the component
- All Superinterfaces:
Codec<T>, Decoder<T>, Encoder<T>, Holder<DataComponent<T>>, Keyed, RegistryKey<DataComponent<T>>, StaticProtocolObject<DataComponent<T>>
A common type to represent all forms of component in the game. Each group of component types has its own declaration
file (see
DataComponent for example).- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents any type which can hold data components.static final recordNested classes/interfaces inherited from interface Codec
Codec.RawValueNested classes/interfaces inherited from interface Holder
Holder.Direct<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<DataComponent<?>> static final Codec<DataComponentMap> static final NetworkBuffer.Type<DataComponentMap> static final NetworkBuffer.Type<DataComponent<?>> static final Codec<DataComponentMap> static final NetworkBuffer.Type<DataComponentMap> static final NetworkBuffer.Type<DataComponentMap> Fields inherited from interface Codec
BLOCK_POSITION, BOOLEAN, BYTE, BYTE_ARRAY, COMPONENT, COMPONENT_STYLE, DOUBLE, FLOAT, INT, INT_ARRAY, KEY, LONG, LONG_ARRAY, NBT, NBT_COMPOUND, RAW_VALUE, SHORT, STRING, UNIT, UUID, UUID_COERCED, UUID_STRING, VECTOR3D -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> DataComponent<T> createHeadless(int id, Key key, NetworkBuffer.Type<T> network, @Nullable Codec<T> codec) static @Nullable DataComponent<?> fromId(int id) static @Nullable DataComponent<?> static @Nullable DataComponent<?> booleanbooleanisSynced()read(NetworkBuffer reader) static Collection<DataComponent<?>> values()voidwrite(NetworkBuffer writer, T value) Methods inherited from interface Codec
list, list, listOrSingle, listOrSingle, mapValue, mapValue, optional, optional, orElse, set, set, transform, unionType, unionTypeMethods inherited from interface StaticProtocolObject
id, key, name, registry
-
Field Details
-
NETWORK_TYPE
-
CODEC
-
MAP_NETWORK_TYPE
-
MAP_NBT_TYPE
-
PATCH_NETWORK_TYPE
-
UNTRUSTED_PATCH_NETWORK_TYPE
-
PATCH_CODEC
-
-
Method Details
-
isSynced
boolean isSynced() -
isSerialized
boolean isSerialized() -
read
-
write
-
fromKey
-
fromKey
-
fromId
-
values
-
createHeadless
@Internal static <T> DataComponent<T> createHeadless(int id, Key key, @Nullable NetworkBuffer.Type<T> network, @Nullable @Nullable Codec<T> codec)
-