Package net.minecraft.world.entity
Record Class EntityDimensions
java.lang.Object
java.lang.Record
net.minecraft.world.entity.EntityDimensions
public record EntityDimensions(float width, float height, float eyeHeight, EntityAttachments attachments, boolean fixed)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EntityAttachmentsThe field for theattachmentsrecord component.private final floatThe field for theeyeHeightrecord component.private final booleanThe field for thefixedrecord component.private final floatThe field for theheightrecord component.private final floatThe field for thewidthrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEntityDimensions(float p_20381_, float p_20382_, boolean p_20383_) EntityDimensions(float width, float height, float eyeHeight, EntityAttachments attachments, boolean fixed) Creates an instance of aEntityDimensionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachmentsrecord component.private static floatdefaultEyeHeight(float pHeight) final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of theeyeHeightrecord component.booleanfixed()Returns the value of thefixedrecord component.static EntityDimensionsfixed(float pWidth, float pHeight) final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.makeBoundingBox(double pX, double pY, double pZ) makeBoundingBox(Vec3 pPos) static EntityDimensionsscalable(float pWidth, float pHeight) scale(float pFactor) scale(float pWidthFactor, float pHeightFactor) final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.withAttachments(EntityAttachments.Builder pAttachments) withEyeHeight(float pEyeHeight)
-
Field Details
-
width
private final float widthThe field for thewidthrecord component. -
height
private final float heightThe field for theheightrecord component. -
eyeHeight
private final float eyeHeightThe field for theeyeHeightrecord component. -
attachments
The field for theattachmentsrecord component. -
fixed
private final boolean fixedThe field for thefixedrecord component.
-
-
Constructor Details
-
EntityDimensions
private EntityDimensions(float p_20381_, float p_20382_, boolean p_20383_) -
EntityDimensions
public EntityDimensions(float width, float height, float eyeHeight, EntityAttachments attachments, boolean fixed) Creates an instance of aEntityDimensionsrecord class.- Parameters:
width- the value for thewidthrecord componentheight- the value for theheightrecord componenteyeHeight- the value for theeyeHeightrecord componentattachments- the value for theattachmentsrecord componentfixed- the value for thefixedrecord component
-
-
Method Details
-
defaultEyeHeight
private static float defaultEyeHeight(float pHeight) -
makeBoundingBox
-
makeBoundingBox
-
scale
-
scale
-
scalable
-
fixed
-
withEyeHeight
-
withAttachments
-
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 '=='. -
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
-
eyeHeight
public float eyeHeight()Returns the value of theeyeHeightrecord component.- Returns:
- the value of the
eyeHeightrecord component
-
attachments
Returns the value of theattachmentsrecord component.- Returns:
- the value of the
attachmentsrecord component
-
fixed
public boolean fixed()Returns the value of thefixedrecord component.- Returns:
- the value of the
fixedrecord component
-