Record Class EntityMetadataTranslator<E extends Entity,T,EM extends org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<T,? extends org.geysermc.mcprotocollib.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 org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<T,? extends org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.MetadataType<T>>> (org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E extends Entity,EM extends org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<T,? extends org.geysermc.mcprotocollib.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(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.MetadataType<T> acceptedType, BiConsumer<E, EM> translateFunction) Creates an instance of aEntityMetadataTranslatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.geysermc.mcprotocollib.protocol.data.game.entity.metadata.MetadataType<T> Returns the value of theacceptedTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.voidReturns the value of thetranslateFunctionrecord component.
-
Constructor Details
-
EntityMetadataTranslator
public EntityMetadataTranslator(org.geysermc.mcprotocollib.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
-