Record Class EntityType
java.lang.Object
java.lang.Record
fr.fidorial.entity.EntityType
- Record Components:
key- the entity type key, for instanceminecraft:cowcategory- the spawn category of the entitywidth- the width of the hitbox, in blocksheight- the height of the hitbox, in blocks
public record EntityType(Key key, EntityType.Category category, float width, float height)
extends Record
A kind of entity, with the dimensions of its hitbox.
- Since:
- 0.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe spawn category an entity type belongs to. -
Constructor Summary
ConstructorsConstructorDescriptionEntityType(Key key, EntityType.Category category, float width, float height) Validates the components. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
EntityType
Validates the components.
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
key
-
category
-
width
-
height
-