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 width, float height, boolean fixed) 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 height) 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 width, float height) final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.makeBoundingBox(double x, double y, double z) makeBoundingBox(Vec3 pos) static EntityDimensionsscalable(float width, float height) scale(float scaleFactor) scale(float widthScaleFactor, float heightScaleFactor) final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.withAttachments(EntityAttachments.Builder attachments) withEyeHeight(float eyeHeight)
-
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 width, float height, boolean fixed) -
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 height) -
makeBoundingBox
-
makeBoundingBox
-
scale
-
scale
-
scalable
-
fixed
-
withEyeHeight
-
withAttachments
-
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. -
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
-