Record Class ArithmeticFunction
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.func.ArithmeticFunction
- All Implemented Interfaces:
LevelFunction
@ParametersAreNonnullByDefault
public record ArithmeticFunction(ArithmeticFunction.Mode mode, LevelFunction a, LevelFunction b)
extends Record
implements LevelFunction
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ArithmeticFunction> static final net.minecraft.resources.ResourceLocationFields inherited from interface com.lightning.northstar.planet.data.func.LevelFunction
CODEC_NO_INLINE, REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aArithmeticFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptiona()Returns the value of thearecord component.b()Returns the value of thebrecord component.final booleanIndicates whether some other object is "equal to" this one.floatget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.resources.ResourceLocationtype()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.lightning.northstar.planet.data.func.LevelFunction
add, div, mul, sub
-
Field Details
-
TYPE
public static final net.minecraft.resources.ResourceLocation TYPE -
CODEC
-
-
Constructor Details
-
ArithmeticFunction
Creates an instance of aArithmeticFunctionrecord class.- Parameters:
mode- the value for themoderecord componenta- the value for thearecord componentb- the value for thebrecord component
-
-
Method Details
-
type
public net.minecraft.resources.ResourceLocation type()- Specified by:
typein interfaceLevelFunction
-
get
public float get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) - Specified by:
getin interfaceLevelFunction
-
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 withObjects::equals(Object,Object). -
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
a
Returns the value of thearecord component.- Returns:
- the value of the
arecord component
-
b
Returns the value of thebrecord component.- Returns:
- the value of the
brecord component
-