Record Class SkyLayerDefinition.DayFade
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.sky.SkyLayerDefinition.DayFade
- Enclosing class:
SkyLayerDefinition
public static record SkyLayerDefinition.DayFade(int startFadeIn, int endFadeIn, int startFadeOut, int endFadeOut)
extends Record
Shows the layer during part of the day: it fades in over
[startFadeIn, endFadeIn], stays, then fades
out over [startFadeOut, endFadeOut]. Times are ticks of the day, 0 to 24000 (0 is sunrise, 6000 noon,
13000 dusk, 18000 midnight), and may wrap around midnight.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SkyLayerDefinition.DayFade> static final SkyLayerDefinition.DayFadeVisible by day only, fading around dawn and dusk.static final intstatic final SkyLayerDefinition.DayFadeVisible at night only, fading around dusk and dawn. -
Constructor Summary
ConstructorsConstructorDescriptionDayFade(int startFadeIn, int endFadeIn, int startFadeOut, int endFadeOut) Creates an instance of aDayFaderecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theendFadeInrecord component.intReturns the value of theendFadeOutrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thestartFadeInrecord component.intReturns the value of thestartFadeOutrecord component.final StringtoString()Returns a string representation of this record class.floatvisibility(float dayTime) How visible the layer is atdayTimeticks into the day, from 0 to 1.
-
Field Details
-
DAY_LENGTH
public static final int DAY_LENGTH- See Also:
-
CODEC
-
NIGHT
Visible at night only, fading around dusk and dawn. -
DAY
Visible by day only, fading around dawn and dusk.
-
-
Constructor Details
-
DayFade
public DayFade(int startFadeIn, int endFadeIn, int startFadeOut, int endFadeOut) Creates an instance of aDayFaderecord class.- Parameters:
startFadeIn- the value for thestartFadeInrecord componentendFadeIn- the value for theendFadeInrecord componentstartFadeOut- the value for thestartFadeOutrecord componentendFadeOut- the value for theendFadeOutrecord component
-
-
Method Details
-
visibility
public float visibility(float dayTime) How visible the layer is atdayTimeticks into the day, from 0 to 1. -
toString
-
hashCode
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
startFadeIn
public int startFadeIn()Returns the value of thestartFadeInrecord component.- Returns:
- the value of the
startFadeInrecord component
-
endFadeIn
public int endFadeIn()Returns the value of theendFadeInrecord component.- Returns:
- the value of the
endFadeInrecord component
-
startFadeOut
public int startFadeOut()Returns the value of thestartFadeOutrecord component.- Returns:
- the value of the
startFadeOutrecord component
-
endFadeOut
public int endFadeOut()Returns the value of theendFadeOutrecord component.- Returns:
- the value of the
endFadeOutrecord component
-