Record Class PlanetDimension
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.PlanetDimension
- Record Components:
planet- the planet that this dimension is attached toname- the name of that dimensiondimensionId- the id of the dimensionisOrbit- if the dimension is an orbit and the rocket should stop in the air if no blocks are presentatmosphere- the atmosphere of this dimensiongravity- the gravity in m/s^2averageTemperature- the average temperature to be displayed on the telescopetemperature- the surface temperature in Celsiuswind- the surface wind multiplierheatIntercept- the first parameter of the heat functionheatGradient- the second parameter of the heat functionlongitudeOffset- the offset in the camera longitude, in radianslatitudeOffset- the offset in the camera latitude, in radians
@ParametersAreNonnullByDefault
public record PlanetDimension(@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionId, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionAbove, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow, boolean isOrbit, Atmosphere atmosphere, float gravity, org.joml.Vector2f averageTemperature, LevelFunction temperature, LevelFunction wind, LevelFunction sun, float heatIntercept, float heatGradient, double longitudeOffset, double latitudeOffset)
extends Record
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PlanetDimension> static final LevelFunctionstatic final floatstatic final floatOverworld gravity, used as a reference when calculating gravity on other dimensions -
Constructor Summary
ConstructorsConstructorDescriptionPlanetDimension(@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionId, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionAbove, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow, boolean isOrbit, Atmosphere atmosphere, float gravity, org.joml.Vector2f averageTemperature, LevelFunction temperature, LevelFunction wind, LevelFunction sun, float heatIntercept, float heatGradient, double longitudeOffset, double latitudeOffset) Creates an instance of aPlanetDimensionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theatmosphererecord component.org.joml.Vector2fReturns the value of theaverageTemperaturerecord component.static PlanetDimension.Builderbuilder()@Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> Returns the value of thedimensionAboverecord component.@Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> Returns the value of thedimensionBelowrecord component.net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> Returns the value of thedimensionIdrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.chat.MutableComponentfloatgravity()Returns the value of thegravityrecord component.floatbooleanfinal inthashCode()Returns a hash code value for this object.floatReturns the value of theheatGradientrecord component.floatReturns the value of theheatInterceptrecord component.floatheatShieldingRequirement(int blockCount) Calculates the heat shielding requirement based on the block count using the linear functionheatIntercept+heatGradient* blockCountbooleanisOrbit()Returns the value of theisOrbitrecord component.doubleReturns the value of thelatitudeOffsetrecord component.doubleReturns the value of thelongitudeOffsetrecord component.name()Returns the value of thenamerecord component.static PlanetDimensionorbit(@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow) static PlanetDimension.BuilderorbitBuilder(@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow) @Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet()Returns the value of theplanetrecord component.sun()Returns the value of thesunrecord component.Returns the value of thetemperaturerecord component.final StringtoString()Returns a string representation of this record class.wind()Returns the value of thewindrecord component.
-
Field Details
-
EARTH_GRAVITY
public static final float EARTH_GRAVITYOverworld gravity, used as a reference when calculating gravity on other dimensions- See Also:
-
EARTH_ATMOSPHERE_PRESSURE
public static final float EARTH_ATMOSPHERE_PRESSURE- See Also:
-
DEFAULT_SUN
-
CODEC
-
-
Constructor Details
-
PlanetDimension
public PlanetDimension(@Nullable @Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, String name, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionId, @Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionAbove, @Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow, boolean isOrbit, Atmosphere atmosphere, float gravity, org.joml.Vector2f averageTemperature, LevelFunction temperature, LevelFunction wind, LevelFunction sun, float heatIntercept, float heatGradient, double longitudeOffset, double latitudeOffset) Creates an instance of aPlanetDimensionrecord class.- Parameters:
planet- the value for theplanetrecord componentname- the value for thenamerecord componentdimensionId- the value for thedimensionIdrecord componentdimensionAbove- the value for thedimensionAboverecord componentdimensionBelow- the value for thedimensionBelowrecord componentisOrbit- the value for theisOrbitrecord componentatmosphere- the value for theatmosphererecord componentgravity- the value for thegravityrecord componentaverageTemperature- the value for theaverageTemperaturerecord componenttemperature- the value for thetemperaturerecord componentwind- the value for thewindrecord componentsun- the value for thesunrecord componentheatIntercept- the value for theheatInterceptrecord componentheatGradient- the value for theheatGradientrecord componentlongitudeOffset- the value for thelongitudeOffsetrecord componentlatitudeOffset- the value for thelatitudeOffsetrecord component
-
-
Method Details
-
gravityScale
public float gravityScale() -
hasAtmosphere
public boolean hasAtmosphere() -
formattedName
@Contract("-> new") public net.minecraft.network.chat.MutableComponent formattedName() -
heatShieldingRequirement
public float heatShieldingRequirement(int blockCount) Calculates the heat shielding requirement based on the block count using the linear functionheatIntercept+heatGradient* blockCount -
orbit
public static PlanetDimension orbit(@Nullable @Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, @Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow) -
orbitBuilder
public static PlanetDimension.Builder orbitBuilder(@Nullable @Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, @Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow) -
builder
-
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 '=='. -
planet
Returns the value of theplanetrecord component.- Returns:
- the value of the
planetrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
dimensionId
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionId()Returns the value of thedimensionIdrecord component.- Returns:
- the value of the
dimensionIdrecord component
-
dimensionAbove
@Nullable public @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionAbove()Returns the value of thedimensionAboverecord component.- Returns:
- the value of the
dimensionAboverecord component
-
dimensionBelow
@Nullable public @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow()Returns the value of thedimensionBelowrecord component.- Returns:
- the value of the
dimensionBelowrecord component
-
isOrbit
public boolean isOrbit()Returns the value of theisOrbitrecord component.- Returns:
- the value of the
isOrbitrecord component
-
atmosphere
Returns the value of theatmosphererecord component.- Returns:
- the value of the
atmosphererecord component
-
gravity
public float gravity()Returns the value of thegravityrecord component.- Returns:
- the value of the
gravityrecord component
-
averageTemperature
public org.joml.Vector2f averageTemperature()Returns the value of theaverageTemperaturerecord component.- Returns:
- the value of the
averageTemperaturerecord component
-
temperature
Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
wind
Returns the value of thewindrecord component.- Returns:
- the value of the
windrecord component
-
sun
Returns the value of thesunrecord component.- Returns:
- the value of the
sunrecord component
-
heatIntercept
public float heatIntercept()Returns the value of theheatInterceptrecord component.- Returns:
- the value of the
heatInterceptrecord component
-
heatGradient
public float heatGradient()Returns the value of theheatGradientrecord component.- Returns:
- the value of the
heatGradientrecord component
-
longitudeOffset
public double longitudeOffset()Returns the value of thelongitudeOffsetrecord component.- Returns:
- the value of the
longitudeOffsetrecord component
-
latitudeOffset
public double latitudeOffset()Returns the value of thelatitudeOffsetrecord component.- Returns:
- the value of the
latitudeOffsetrecord component
-