Package org.geysermc.geyser.entity
Record Class EntityDefinition<T extends Entity>
java.lang.Object
java.lang.Record
org.geysermc.geyser.entity.EntityDefinition<T>
- Type Parameters:
 T- the entity type this definition represents
public record EntityDefinition<T extends Entity>(EntityFactory<T extends Entity> factory, com.github.steveice10.mc.protocol.data.game.entity.type.EntityType entityType, String identifier, float width, float height, float offset, List<EntityMetadataTranslator<? super T extends Entity,?,?>> translators)
extends Record
Represents data for an entity. This includes properties such as height and width, as well as the list of entity
 metadata translators needed to translate the properties sent from the server. The translators are structured in such
 a way that inserting a new one (for example in version updates) is convenient.
- 
Nested Class Summary
Nested Classes - 
Constructor Summary
ConstructorsConstructorDescriptionEntityDefinition(EntityFactory<T> factory, com.github.steveice10.mc.protocol.data.game.entity.type.EntityType entityType, String identifier, float width, float height, float offset, List<EntityMetadataTranslator<? super T,?,?>> translators)Creates an instance of aEntityDefinitionrecord class. - 
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Entity>
EntityDefinition.Builder<T>builder(EntityFactory<T> factory)com.github.steveice10.mc.protocol.data.game.entity.type.EntityTypeReturns the value of theentityTyperecord component.booleanIndicates whether some other object is "equal to" this one.factory()Returns the value of thefactoryrecord component.inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.Returns the value of theidentifierrecord component.static <T extends Entity>
EntityDefinition.Builder<T>inherited(BaseEntityFactory<T> factory, EntityDefinition<? super T> parent)static <T extends Entity>
EntityDefinition.Builder<T>inherited(EntityFactory<T> factory, EntityDefinition<? super T> parent)floatoffset()Returns the value of theoffsetrecord component.toString()Returns a string representation of this record class.<M> voidtranslateMetadata(T entity, com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<M,? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<M>> metadata)List<EntityMetadataTranslator<? super T,?,?>>Returns the value of thetranslatorsrecord component.floatwidth()Returns the value of thewidthrecord component. 
- 
Constructor Details
- 
EntityDefinition
public EntityDefinition(EntityFactory<T> factory, com.github.steveice10.mc.protocol.data.game.entity.type.EntityType entityType, String identifier, float width, float height, float offset, List<EntityMetadataTranslator<? super T,?,?>> translators)Creates an instance of aEntityDefinitionrecord class.- Parameters:
 factory- the value for thefactoryrecord componententityType- the value for theentityTyperecord componentidentifier- the value for theidentifierrecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentoffset- the value for theoffsetrecord componenttranslators- the value for thetranslatorsrecord component
 
 - 
 - 
Method Details
- 
inherited
public static <T extends Entity> EntityDefinition.Builder<T> inherited(BaseEntityFactory<T> factory, EntityDefinition<? super T> parent) - 
inherited
public static <T extends Entity> EntityDefinition.Builder<T> inherited(EntityFactory<T> factory, EntityDefinition<? super T> parent) - 
builder
 - 
translateMetadata
public <M> void translateMetadata(T entity, com.github.steveice10.mc.protocol.data.game.entity.metadata.EntityMetadata<M,? extends com.github.steveice10.mc.protocol.data.game.entity.metadata.MetadataType<M>> metadata) - 
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. - 
factory
Returns the value of thefactoryrecord component.- Returns:
 - the value of the 
factoryrecord component 
 - 
entityType
public com.github.steveice10.mc.protocol.data.game.entity.type.EntityType entityType()Returns the value of theentityTyperecord component.- Returns:
 - the value of the 
entityTyperecord component 
 - 
identifier
Returns the value of theidentifierrecord component.- Returns:
 - the value of the 
identifierrecord component 
 - 
width
public float width()Returns the value of thewidthrecord component.- Returns:
 - the value of the 
widthrecord component 
 - 
height
public float height()Returns the value of theheightrecord component.- Returns:
 - the value of the 
heightrecord component 
 - 
offset
public float offset()Returns the value of theoffsetrecord component.- Returns:
 - the value of the 
offsetrecord component 
 - 
translators
Returns the value of thetranslatorsrecord component.- Returns:
 - the value of the 
translatorsrecord component 
 
 -