Record Class AstronomicalReadingData
java.lang.Object
java.lang.Record
com.lightning.northstar.block.tech.telescope.AstronomicalReadingData
public record AstronomicalReadingData(net.minecraft.resources.ResourceLocation originPlanet, net.minecraft.resources.ResourceLocation targetPlanet, float science, int day)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AstronomicalReadingData> -
Constructor Summary
ConstructorsConstructorDescriptionAstronomicalReadingData(net.minecraft.resources.ResourceLocation originPlanet, net.minecraft.resources.ResourceLocation targetPlanet, float science, int day) Creates an instance of aAstronomicalReadingDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionintday()Returns the value of thedayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationReturns the value of theoriginPlanetrecord component.floatscience()Returns the value of thesciencerecord component.net.minecraft.resources.ResourceLocationReturns the value of thetargetPlanetrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
AstronomicalReadingData
public AstronomicalReadingData(net.minecraft.resources.ResourceLocation originPlanet, net.minecraft.resources.ResourceLocation targetPlanet, float science, int day) Creates an instance of aAstronomicalReadingDatarecord class.- Parameters:
originPlanet- the value for theoriginPlanetrecord componenttargetPlanet- the value for thetargetPlanetrecord componentscience- the value for thesciencerecord componentday- the value for thedayrecord component
-
-
Method Details
-
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 '=='. -
originPlanet
public net.minecraft.resources.ResourceLocation originPlanet()Returns the value of theoriginPlanetrecord component.- Returns:
- the value of the
originPlanetrecord component
-
targetPlanet
public net.minecraft.resources.ResourceLocation targetPlanet()Returns the value of thetargetPlanetrecord component.- Returns:
- the value of the
targetPlanetrecord component
-
science
public float science()Returns the value of thesciencerecord component.- Returns:
- the value of the
sciencerecord component
-
day
public int day()Returns the value of thedayrecord component.- Returns:
- the value of the
dayrecord component
-