Interface DataConsumer<D,A>
- Type Parameters:
D- the type to be encodedA- the context available to process metadata from
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a function that can process any metadata necessary for encoding into an encodable form, given the object
to encode and the context of encoding.
-
Method Summary
-
Method Details
-
encode
<T> @NonNull com.mojang.serialization.DataResult<T> encode(com.mojang.serialization.DynamicOps<T> ops, D data, A object) Given the provided object to encode and the context of encoding, encodes the metadata into an encodable form.- Type Parameters:
T- the type to encode into- Parameters:
ops- allows encoding into the proper formatdata- the context available to construct metadataobject- the object to encode- Returns:
- the encoded metadata
-