Package net.frozenblock.lib.gravity.api
Record Class GravityBelt<T extends GravityFunction>
java.lang.Object
java.lang.Record
net.frozenblock.lib.gravity.api.GravityBelt<T>
public record GravityBelt<T extends GravityFunction>(double minY, double maxY, boolean renderBottom, boolean renderTop, T extends GravityFunction function)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionGravityBelt(double minY, double maxY, boolean renderBottom, boolean renderTop, T function) Creates an instance of aGravityBeltrecord class.GravityBelt(double minY, double maxY, T function) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaffectsPosition(double y) static <T extends SerializableGravityFunction<T>>
com.mojang.serialization.Codec<GravityBelt<T>> codec(com.mojang.serialization.Codec<T> gravityFunction) static <T extends SerializableGravityFunction<T>>
@Nullable com.mojang.serialization.Codec<GravityBelt<T>> codec(T gravityFunction) final booleanIndicates whether some other object is "equal to" this one.function()Returns the value of thefunctionrecord component.net.minecraft.world.phys.Vec3getGravity(@Nullable net.minecraft.world.entity.Entity entity, double y) final inthashCode()Returns a hash code value for this object.doublemaxY()Returns the value of themaxYrecord component.doubleminY()Returns the value of theminYrecord component.booleanReturns the value of therenderBottomrecord component.booleanReturns the value of therenderToprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GravityBelt
-
GravityBelt
Creates an instance of aGravityBeltrecord class.- Parameters:
minY- the value for theminYrecord componentmaxY- the value for themaxYrecord componentrenderBottom- the value for therenderBottomrecord componentrenderTop- the value for therenderToprecord componentfunction- the value for thefunctionrecord component
-
-
Method Details
-
affectsPosition
public boolean affectsPosition(double y) -
getGravity
public net.minecraft.world.phys.Vec3 getGravity(@Nullable @Nullable net.minecraft.world.entity.Entity entity, double y) -
codec
public static <T extends SerializableGravityFunction<T>> com.mojang.serialization.Codec<GravityBelt<T>> codec(com.mojang.serialization.Codec<T> gravityFunction) -
codec
@Nullable public static <T extends SerializableGravityFunction<T>> @Nullable com.mojang.serialization.Codec<GravityBelt<T>> codec(T gravityFunction) -
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 '=='. -
minY
public double minY()Returns the value of theminYrecord component.- Returns:
- the value of the
minYrecord component
-
maxY
public double maxY()Returns the value of themaxYrecord component.- Returns:
- the value of the
maxYrecord component
-
renderBottom
public boolean renderBottom()Returns the value of therenderBottomrecord component.- Returns:
- the value of the
renderBottomrecord component
-
renderTop
public boolean renderTop()Returns the value of therenderToprecord component.- Returns:
- the value of the
renderToprecord component
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-