Interface DataConsumer<D,A>

Type Parameters:
D - the type to be encoded
A - 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.

@FunctionalInterface public interface DataConsumer<D,A>
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

    Modifier and Type
    Method
    Description
    <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.
  • 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 format
      data - the context available to construct metadata
      object - the object to encode
      Returns:
      the encoded metadata