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 to
name - the name of that dimension
dimensionId - the id of the dimension
isOrbit - if the dimension is an orbit and the rocket should stop in the air if no blocks are present
atmosphere - the atmosphere of this dimension
gravity - the gravity in m/s^2
averageTemperature - the average temperature to be displayed on the telescope
temperature - the surface temperature in Celsius
wind - the surface wind multiplier
heatIntercept - the first parameter of the heat function
heatGradient - the second parameter of the heat function
longitudeOffset - the offset in the camera longitude, in radians
latitudeOffset - 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:
  • Field Details

    • EARTH_GRAVITY

      public static final float EARTH_GRAVITY
      Overworld 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

      public static final LevelFunction DEFAULT_SUN
    • CODEC

      public static final com.mojang.serialization.Codec<PlanetDimension> 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 a PlanetDimension record class.
      Parameters:
      planet - the value for the planet record component
      name - the value for the name record component
      dimensionId - the value for the dimensionId record component
      dimensionAbove - the value for the dimensionAbove record component
      dimensionBelow - the value for the dimensionBelow record component
      isOrbit - the value for the isOrbit record component
      atmosphere - the value for the atmosphere record component
      gravity - the value for the gravity record component
      averageTemperature - the value for the averageTemperature record component
      temperature - the value for the temperature record component
      wind - the value for the wind record component
      sun - the value for the sun record component
      heatIntercept - the value for the heatIntercept record component
      heatGradient - the value for the heatGradient record component
      longitudeOffset - the value for the longitudeOffset record component
      latitudeOffset - the value for the latitudeOffset record 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 function heatIntercept + 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

      public static PlanetDimension.Builder builder()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • planet

      @Nullable public @Nullable net.minecraft.resources.ResourceKey<PlanetProperties> planet()
      Returns the value of the planet record component.
      Returns:
      the value of the planet record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • dimensionId

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionId()
      Returns the value of the dimensionId record component.
      Returns:
      the value of the dimensionId record component
    • dimensionAbove

      @Nullable public @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionAbove()
      Returns the value of the dimensionAbove record component.
      Returns:
      the value of the dimensionAbove record component
    • dimensionBelow

      @Nullable public @Nullable net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionBelow()
      Returns the value of the dimensionBelow record component.
      Returns:
      the value of the dimensionBelow record component
    • isOrbit

      public boolean isOrbit()
      Returns the value of the isOrbit record component.
      Returns:
      the value of the isOrbit record component
    • atmosphere

      public Atmosphere atmosphere()
      Returns the value of the atmosphere record component.
      Returns:
      the value of the atmosphere record component
    • gravity

      public float gravity()
      Returns the value of the gravity record component.
      Returns:
      the value of the gravity record component
    • averageTemperature

      public org.joml.Vector2f averageTemperature()
      Returns the value of the averageTemperature record component.
      Returns:
      the value of the averageTemperature record component
    • temperature

      public LevelFunction temperature()
      Returns the value of the temperature record component.
      Returns:
      the value of the temperature record component
    • wind

      public LevelFunction wind()
      Returns the value of the wind record component.
      Returns:
      the value of the wind record component
    • sun

      public LevelFunction sun()
      Returns the value of the sun record component.
      Returns:
      the value of the sun record component
    • heatIntercept

      public float heatIntercept()
      Returns the value of the heatIntercept record component.
      Returns:
      the value of the heatIntercept record component
    • heatGradient

      public float heatGradient()
      Returns the value of the heatGradient record component.
      Returns:
      the value of the heatGradient record component
    • longitudeOffset

      public double longitudeOffset()
      Returns the value of the longitudeOffset record component.
      Returns:
      the value of the longitudeOffset record component
    • latitudeOffset

      public double latitudeOffset()
      Returns the value of the latitudeOffset record component.
      Returns:
      the value of the latitudeOffset record component