Record Class PlanetProperties

java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.PlanetProperties
Record Components:
centralBody - the body around which this body orbits
orbit - the planet's orbit
type - the type key, planet, star, gas_giant, etc...
scienceWeightExp - the weight exponent
requiredScience - the total needed science to unlock this planet_
rotationPeriodDays - the amount of days it takes for the planet to complete a full cycle on itself
diameter - the planet diameter, in kilometers.
obliquity - the axial tilt, in radians.
axialPrecession - the axial precession, in radians per year
initialAxialPrecession - the initial axial precession at T=0
renderer - the renderer for the planet
texture - the texture of the planet when rendering during takeoffs/landings and orbits

@ParametersAreNonnullByDefault public record PlanetProperties(@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> centralBody, OrbitProvider orbit, String type, float scienceWeightExp, float requiredScience, double rotationPeriodDays, double diameter, double obliquity, double axialPrecession, double initialAxialPrecession, PlanetSpriteRenderer renderer, List<PlanetProperties.TextureLayer> texture, @Nullable net.minecraft.network.chat.Component notes) extends Record
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<PlanetProperties> CODEC
  • Constructor Details

    • PlanetProperties

      public PlanetProperties(Optional<net.minecraft.resources.ResourceKey<PlanetProperties>> centralBody, OrbitProvider orbit, String type, float scienceWeightExp, float requiredScience, double rotationPeriodDays, double diameter, double axialTilt, double axialPrecession, double initialAxialPrecession, PlanetSpriteRenderer renderer, List<PlanetProperties.TextureLayer> texture, Optional<net.minecraft.network.chat.Component> notes)
    • PlanetProperties

      public PlanetProperties(@Nullable @Nullable net.minecraft.resources.ResourceKey<PlanetProperties> centralBody, OrbitProvider orbit, String type, float scienceWeightExp, float requiredScience, double rotationPeriodDays, double diameter, double obliquity, double axialPrecession, double initialAxialPrecession, PlanetSpriteRenderer renderer, List<PlanetProperties.TextureLayer> texture, @Nullable @Nullable net.minecraft.network.chat.Component notes)
      Creates an instance of a PlanetProperties record class.
      Parameters:
      centralBody - the value for the centralBody record component
      orbit - the value for the orbit record component
      type - the value for the type record component
      scienceWeightExp - the value for the scienceWeightExp record component
      requiredScience - the value for the requiredScience record component
      rotationPeriodDays - the value for the rotationPeriodDays record component
      diameter - the value for the diameter record component
      obliquity - the value for the obliquity record component
      axialPrecession - the value for the axialPrecession record component
      initialAxialPrecession - the value for the initialAxialPrecession record component
      renderer - the value for the renderer record component
      texture - the value for the texture record component
      notes - the value for the notes record component
  • Method Details

    • circumference

      public double circumference()
    • isInterplanetary

      public static boolean isInterplanetary(net.minecraft.core.RegistryAccess registry, net.minecraft.resources.ResourceKey<PlanetProperties> origin, net.minecraft.resources.ResourceKey<PlanetProperties> dest)
    • isInterplanetary

      public static boolean isInterplanetary(Planet origin, Planet dest)
    • builder

      public static PlanetProperties.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.
    • centralBody

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

      public OrbitProvider orbit()
      Returns the value of the orbit record component.
      Returns:
      the value of the orbit record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • scienceWeightExp

      public float scienceWeightExp()
      Returns the value of the scienceWeightExp record component.
      Returns:
      the value of the scienceWeightExp record component
    • requiredScience

      public float requiredScience()
      Returns the value of the requiredScience record component.
      Returns:
      the value of the requiredScience record component
    • rotationPeriodDays

      public double rotationPeriodDays()
      Returns the value of the rotationPeriodDays record component.
      Returns:
      the value of the rotationPeriodDays record component
    • diameter

      public double diameter()
      Returns the value of the diameter record component.
      Returns:
      the value of the diameter record component
    • obliquity

      public double obliquity()
      Returns the value of the obliquity record component.
      Returns:
      the value of the obliquity record component
    • axialPrecession

      public double axialPrecession()
      Returns the value of the axialPrecession record component.
      Returns:
      the value of the axialPrecession record component
    • initialAxialPrecession

      public double initialAxialPrecession()
      Returns the value of the initialAxialPrecession record component.
      Returns:
      the value of the initialAxialPrecession record component
    • renderer

      public PlanetSpriteRenderer renderer()
      Returns the value of the renderer record component.
      Returns:
      the value of the renderer record component
    • texture

      Returns the value of the texture record component.
      Returns:
      the value of the texture record component
    • notes

      @Nullable public @Nullable net.minecraft.network.chat.Component notes()
      Returns the value of the notes record component.
      Returns:
      the value of the notes record component