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
ConstructorDescriptionEntityMetadataTranslator(com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E,EM> translateFunction)
Creates an instance of aEntityMetadataTranslator
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<T>
Returns the value of theacceptedType
record component.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.toString()
Returns a string representation of this record class.void
BiConsumer<E,EM>
Returns the value of thetranslateFunction
record 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 aEntityMetadataTranslator
record class.- Parameters:
acceptedType
- the value for theacceptedType
record componenttranslateFunction
- the value for thetranslateFunction
record 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 theacceptedType
record component.- Returns:
- the value of the
acceptedType
record component
-
translateFunction
Returns the value of thetranslateFunction
record component.- Returns:
- the value of the
translateFunction
record component
-