Record Class Atmosphere
java.lang.Object
java.lang.Record
com.lightning.northstar.planet.data.Atmosphere
- Record Components:
fluid- a fluid that represents the atmosphere, used to know if the planet is breathable and what the atmospheric concentrator collectfluidNbt- the nbt compound associated with the fluidcollectionRate- the collection rate of atmospheric concentrators in mB/t at 256 RPMpressure- the atmosphere pressure in Pascals (Pa)daytimeStarBrightness- the minimum brightness of stars during the day
public record Atmosphere(net.minecraft.world.level.material.Fluid fluid, net.minecraft.core.component.DataComponentPatch fluidNbt, float collectionRate, float pressure, float daytimeStarBrightness)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Atmosphere> static final net.neoforged.neoforge.common.util.Lazy<Atmosphere> -
Constructor Summary
ConstructorsConstructorDescriptionAtmosphere(net.minecraft.world.level.material.Fluid fluid, net.minecraft.core.component.DataComponentPatch fluidNbt, float collectionRate, float pressure, float daytimeStarBrightness) Creates an instance of aAtmosphererecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.neoforged.neoforge.fluids.FluidStackasFluidStack(int amount) static Atmosphere.Builderbuilder()floatReturns the value of thecollectionRaterecord component.floatReturns the value of thedaytimeStarBrightnessrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.level.material.Fluidfluid()Returns the value of thefluidrecord component.net.minecraft.core.component.DataComponentPatchfluidNbt()Returns the value of thefluidNbtrecord component.final inthashCode()Returns a hash code value for this object.booleanisVacuum()floatpressure()Returns the value of thepressurerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
DEFAULT
-
-
Constructor Details
-
Atmosphere
public Atmosphere(net.minecraft.world.level.material.Fluid fluid, net.minecraft.core.component.DataComponentPatch fluidNbt, float collectionRate, float pressure, float daytimeStarBrightness) Creates an instance of aAtmosphererecord class.- Parameters:
fluid- the value for thefluidrecord componentfluidNbt- the value for thefluidNbtrecord componentcollectionRate- the value for thecollectionRaterecord componentpressure- the value for thepressurerecord componentdaytimeStarBrightness- the value for thedaytimeStarBrightnessrecord component
-
-
Method Details
-
builder
-
isVacuum
public boolean isVacuum() -
asFluidStack
public net.neoforged.neoforge.fluids.FluidStack asFluidStack(int amount) -
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 '=='. -
fluid
public net.minecraft.world.level.material.Fluid fluid()Returns the value of thefluidrecord component.- Returns:
- the value of the
fluidrecord component
-
fluidNbt
public net.minecraft.core.component.DataComponentPatch fluidNbt()Returns the value of thefluidNbtrecord component.- Returns:
- the value of the
fluidNbtrecord component
-
collectionRate
public float collectionRate()Returns the value of thecollectionRaterecord component.- Returns:
- the value of the
collectionRaterecord component
-
pressure
public float pressure()Returns the value of thepressurerecord component.- Returns:
- the value of the
pressurerecord component
-
daytimeStarBrightness
public float daytimeStarBrightness()Returns the value of thedaytimeStarBrightnessrecord component.- Returns:
- the value of the
daytimeStarBrightnessrecord component
-