Record Class LightFunction
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.func.LightFunction
- All Implemented Interfaces:
LevelFunction
@ParametersAreNonnullByDefault
public record LightFunction(LightFunction.Mode mode, boolean normalize)
extends Record
implements LevelFunction
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<LightFunction> static final net.minecraft.resources.ResourceLocationFields inherited from interface com.lightning.northstar.planet.data.func.LevelFunction
CODEC_NO_INLINE, REGISTRY -
Constructor Summary
ConstructorsConstructorDescriptionLightFunction(LightFunction.Mode mode, boolean normalize) Creates an instance of aLightFunctionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.floatget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) static intget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, LightFunction.Mode mode) final inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.booleanReturns the value of thenormalizerecord 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
-
LightFunction
Creates an instance of aLightFunctionrecord class.- Parameters:
mode- the value for themoderecord componentnormalize- the value for thenormalizerecord 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
-
get
public static int get(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, LightFunction.Mode mode) -
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 '=='. -
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
normalize
public boolean normalize()Returns the value of thenormalizerecord component.- Returns:
- the value of the
normalizerecord component
-