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
ConstructorsConstructorDescriptionEntityMetadataTranslator(com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E,EM> translateFunction)Creates an instance of aEntityMetadataTranslatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T>Returns the value of theacceptedTyperecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.voidBiConsumer<E,EM>Returns the value of thetranslateFunctionrecord component.
-
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 aEntityMetadataTranslatorrecord class.- Parameters:
acceptedType- the value for theacceptedTyperecord componenttranslateFunction- the value for thetranslateFunctionrecord component
-
-
Method Details
-
translate
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
acceptedType
Returns the value of theacceptedTyperecord component.- Returns:
- the value of the
acceptedTyperecord component
-
translateFunction
Returns the value of thetranslateFunctionrecord component.- Returns:
- the value of the
translateFunctionrecord component
-