Package net.minestom.server.collision
Record Class Aerodynamics
java.lang.Object
java.lang.Record
net.minestom.server.collision.Aerodynamics
- Record Components:
gravity
- the entity's downward acceleration per tickhorizontalAirResistance
- the horizontal drag coefficient; the entity's current horizontal velocity is multiplied by this every tickverticalAirResistance
- the vertical drag coefficient; the entity's current vertical * velocity is multiplied by this every tick
public record Aerodynamics(double gravity, double horizontalAirResistance, double verticalAirResistance)
extends Record
Represents the aerodynamic properties of an entity
-
Constructor Summary
ConstructorDescriptionAerodynamics
(double gravity, double horizontalAirResistance, double verticalAirResistance) Creates an instance of aAerodynamics
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.double
gravity()
Returns the value of thegravity
record component.final int
hashCode()
Returns a hash code value for this object.double
Returns the value of thehorizontalAirResistance
record component.final String
toString()
Returns a string representation of this record class.double
Returns the value of theverticalAirResistance
record component.@NotNull Aerodynamics
withAirResistance
(double horizontalAirResistance, double verticalAirResistance) @NotNull Aerodynamics
withGravity
(double gravity) @NotNull Aerodynamics
withGravity
(@NotNull it.unimi.dsi.fastutil.doubles.DoubleUnaryOperator operator) @NotNull Aerodynamics
withHorizontalAirResistance
(double horizontalAirResistance) @NotNull Aerodynamics
withHorizontalAirResistance
(@NotNull it.unimi.dsi.fastutil.doubles.DoubleUnaryOperator operator) @NotNull Aerodynamics
withVerticalAirResistance
(double verticalAirResistance) @NotNull Aerodynamics
withVerticalAirResistance
(@NotNull it.unimi.dsi.fastutil.doubles.DoubleUnaryOperator operator)
-
Constructor Details
-
Aerodynamics
public Aerodynamics(double gravity, double horizontalAirResistance, double verticalAirResistance) Creates an instance of aAerodynamics
record class.- Parameters:
gravity
- the value for thegravity
record componenthorizontalAirResistance
- the value for thehorizontalAirResistance
record componentverticalAirResistance
- the value for theverticalAirResistance
record component
-
-
Method Details
-
withGravity
-
withGravity
@Contract(pure=true) @NotNull public @NotNull Aerodynamics withGravity(@NotNull @NotNull it.unimi.dsi.fastutil.doubles.DoubleUnaryOperator operator) -
withHorizontalAirResistance
@Contract(pure=true) @NotNull public @NotNull Aerodynamics withHorizontalAirResistance(double horizontalAirResistance) -
withHorizontalAirResistance
@Contract(pure=true) @NotNull public @NotNull Aerodynamics withHorizontalAirResistance(@NotNull @NotNull it.unimi.dsi.fastutil.doubles.DoubleUnaryOperator operator) -
withVerticalAirResistance
@Contract(pure=true) @NotNull public @NotNull Aerodynamics withVerticalAirResistance(double verticalAirResistance) -
withVerticalAirResistance
@Contract(pure=true) @NotNull public @NotNull Aerodynamics withVerticalAirResistance(@NotNull @NotNull it.unimi.dsi.fastutil.doubles.DoubleUnaryOperator operator) -
withAirResistance
@Contract(pure=true) @NotNull public @NotNull Aerodynamics withAirResistance(double horizontalAirResistance, double verticalAirResistance) -
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 with '=='. -
gravity
public double gravity()Returns the value of thegravity
record component.- Returns:
- the value of the
gravity
record component
-
horizontalAirResistance
public double horizontalAirResistance()Returns the value of thehorizontalAirResistance
record component.- Returns:
- the value of the
horizontalAirResistance
record component
-
verticalAirResistance
public double verticalAirResistance()Returns the value of theverticalAirResistance
record component.- Returns:
- the value of the
verticalAirResistance
record component
-