Record Class EntityMetadataTranslator<E extends Entity,​T,​EM extends com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<T,​? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T>>>

java.lang.Object
java.lang.Record
org.geysermc.geyser.translator.entity.EntityMetadataTranslator<E,​T,​EM>

public record EntityMetadataTranslator<E extends Entity,​T,​EM extends com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<T,​? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T>>>(com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E extends Entity,​EM extends com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<T,​? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T>>> translateFunction) extends Record
Translates a given Java EntityMetadata into a similar/same construct for Bedrock
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityMetadataTranslator​(com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E,​EM> translateFunction)
    Creates an instance of a EntityMetadataTranslator record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T>
    Returns the value of the acceptedType record component.
    boolean
    equals​(Object o)
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    Returns a string representation of this record class.
    void
    translate​(E entity, EM metadata)
     
    Returns the value of the translateFunction record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EntityMetadataTranslator

      public EntityMetadataTranslator(com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E,​EM> translateFunction)
      Creates an instance of a EntityMetadataTranslator record class.
      Parameters:
      acceptedType - the value for the acceptedType record component
      translateFunction - the value for the translateFunction record component
  • Method Details

    • translate

      public void translate(E entity, EM metadata)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • acceptedType

      public com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T> acceptedType()
      Returns the value of the acceptedType record component.
      Returns:
      the value of the acceptedType record component
    • translateFunction

      public BiConsumer<E,​EM> translateFunction()
      Returns the value of the translateFunction record component.
      Returns:
      the value of the translateFunction record component