Record Class PlanetProperties
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.PlanetProperties
- Record Components:
centralBody- the body around which this body orbitsorbit- the planet's orbital propertiestype- the type key, planet, star, gas_giant, etc...scienceDecayExp- the science decay exponent for readings of the same origin planetrequiredScience- the total required science to unlock this planet, -1 to disable accessing via a space atlascanBeObserved- if the planet can be observed in the telescope to obtain astronomical readingsrotationPeriodDays- the amount of days it takes for the planet to complete a full cycle on itselfdiameter- the planet diameter, in kilometers.obliquity- the axial tilt, in radians.axialPrecession- the axial precession, in radians per yearinitialAxialPrecession- the initial axial precession at T=0renderer- the renderer for the planettexture- 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 scienceDecayExp, float requiredScience, boolean canBeObserved, 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final record -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlanetProperties(Optional<net.minecraft.resources.ResourceKey<PlanetProperties>> centralBody, OrbitProvider orbit, String type, float scienceWeightExp, float requiredScience, boolean canBeObserved, double rotationPeriodDays, double diameter, double axialTilt, double axialPrecession, double initialAxialPrecession, PlanetSpriteRenderer renderer, List<PlanetProperties.TextureLayer> texture, Optional<net.minecraft.network.chat.Component> notes) PlanetProperties(@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> centralBody, OrbitProvider orbit, String type, float scienceDecayExp, float requiredScience, boolean canBeObserved, double rotationPeriodDays, double diameter, double obliquity, double axialPrecession, double initialAxialPrecession, PlanetSpriteRenderer renderer, List<PlanetProperties.TextureLayer> texture, @Nullable net.minecraft.network.chat.Component notes) Creates an instance of aPlanetPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theaxialPrecessionrecord component.static PlanetProperties.Builderbuilder()booleanReturns the value of thecanBeObservedrecord component.@Nullable net.minecraft.resources.ResourceKey<PlanetProperties> Returns the value of thecentralBodyrecord component.doubledoublediameter()Returns the value of thediameterrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinitialAxialPrecessionrecord component.static booleanisInterplanetary(Planet origin, Planet dest) static booleanisInterplanetary(net.minecraft.core.RegistryAccess registry, net.minecraft.resources.ResourceKey<PlanetProperties> origin, net.minecraft.resources.ResourceKey<PlanetProperties> dest) @Nullable net.minecraft.network.chat.Componentnotes()Returns the value of thenotesrecord component.doubleReturns the value of theobliquityrecord component.orbit()Returns the value of theorbitrecord component.renderer()Returns the value of therendererrecord component.floatReturns the value of therequiredSciencerecord component.doubleReturns the value of therotationPeriodDaysrecord component.floatReturns the value of thescienceDecayExprecord component.texture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
CODEC
-
-
Constructor Details
-
PlanetProperties
public PlanetProperties(Optional<net.minecraft.resources.ResourceKey<PlanetProperties>> centralBody, OrbitProvider orbit, String type, float scienceWeightExp, float requiredScience, boolean canBeObserved, 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 scienceDecayExp, float requiredScience, boolean canBeObserved, 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 aPlanetPropertiesrecord class.- Parameters:
centralBody- the value for thecentralBodyrecord componentorbit- the value for theorbitrecord componenttype- the value for thetyperecord componentscienceDecayExp- the value for thescienceDecayExprecord componentrequiredScience- the value for therequiredSciencerecord componentcanBeObserved- the value for thecanBeObservedrecord componentrotationPeriodDays- the value for therotationPeriodDaysrecord componentdiameter- the value for thediameterrecord componentobliquity- the value for theobliquityrecord componentaxialPrecession- the value for theaxialPrecessionrecord componentinitialAxialPrecession- the value for theinitialAxialPrecessionrecord componentrenderer- the value for therendererrecord componenttexture- the value for thetexturerecord componentnotes- the value for thenotesrecord 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
-
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 '=='. -
centralBody
Returns the value of thecentralBodyrecord component.- Returns:
- the value of the
centralBodyrecord component
-
orbit
Returns the value of theorbitrecord component.- Returns:
- the value of the
orbitrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
scienceDecayExp
public float scienceDecayExp()Returns the value of thescienceDecayExprecord component.- Returns:
- the value of the
scienceDecayExprecord component
-
requiredScience
public float requiredScience()Returns the value of therequiredSciencerecord component.- Returns:
- the value of the
requiredSciencerecord component
-
canBeObserved
public boolean canBeObserved()Returns the value of thecanBeObservedrecord component.- Returns:
- the value of the
canBeObservedrecord component
-
rotationPeriodDays
public double rotationPeriodDays()Returns the value of therotationPeriodDaysrecord component.- Returns:
- the value of the
rotationPeriodDaysrecord component
-
diameter
public double diameter()Returns the value of thediameterrecord component.- Returns:
- the value of the
diameterrecord component
-
obliquity
public double obliquity()Returns the value of theobliquityrecord component.- Returns:
- the value of the
obliquityrecord component
-
axialPrecession
public double axialPrecession()Returns the value of theaxialPrecessionrecord component.- Returns:
- the value of the
axialPrecessionrecord component
-
initialAxialPrecession
public double initialAxialPrecession()Returns the value of theinitialAxialPrecessionrecord component.- Returns:
- the value of the
initialAxialPrecessionrecord component
-
renderer
Returns the value of therendererrecord component.- Returns:
- the value of the
rendererrecord component
-
texture
Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
notes
@Nullable public @Nullable net.minecraft.network.chat.Component notes()Returns the value of thenotesrecord component.- Returns:
- the value of the
notesrecord component
-