Record Class SkyContext
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.sky.SkyContext
- Record Components:
skybox- the skybox being updatedplayer- the local player, if in a worldlevel- the client level, if in a worldpartialTick- the partial tick of the frametime- seconds of real time since the game started, wrapping every hourdeltaTime- seconds of real time since the previous frameage- seconds since the skybox last became visible, 0 while hiddenvisibility- how visible the skybox is, from its fade: 0 to 1dayTime- ticks into the day of the dimension's clock, 0 to 24000 (0 is sunrise)rain- the rain level, 0 to 1thunder- the thunder level, 0 to 1
public record SkyContext(Skybox skybox, @Nullable net.minecraft.client.player.LocalPlayer player, @Nullable net.minecraft.client.multiplayer.ClientLevel level, float partialTick, float time, float deltaTime, float age, float visibility, float dayTime, float rain, float thunder)
extends Record
What a skybox's callbacks see of the current frame.
-
Constructor Summary
ConstructorsConstructorDescriptionSkyContext(Skybox skybox, @Nullable net.minecraft.client.player.LocalPlayer player, @Nullable net.minecraft.client.multiplayer.ClientLevel level, float partialTick, float time, float deltaTime, float age, float visibility, float dayTime, float rain, float thunder) Creates an instance of aSkyContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatage()Returns the value of theagerecord component.floatdayTime()Returns the value of thedayTimerecord component.floatReturns the value of thedeltaTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) booleaninWorld()booleanisNight()Whether it's night: between dusk (13000) and dawn (23000).@Nullable net.minecraft.client.multiplayer.ClientLevellevel()Returns the value of thelevelrecord component.net.minecraft.client.MinecraftfloatReturns the value of thepartialTickrecord component.@Nullable net.minecraft.client.player.LocalPlayerplayer()Returns the value of theplayerrecord component.floatrain()Returns the value of therainrecord component.skybox()Returns the value of theskyboxrecord component.floatthunder()Returns the value of thethunderrecord component.floattime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of thevisibilityrecord component.
-
Constructor Details
-
SkyContext
public SkyContext(Skybox skybox, @Nullable @Nullable net.minecraft.client.player.LocalPlayer player, @Nullable @Nullable net.minecraft.client.multiplayer.ClientLevel level, float partialTick, float time, float deltaTime, float age, float visibility, float dayTime, float rain, float thunder) Creates an instance of aSkyContextrecord class.- Parameters:
skybox- the value for theskyboxrecord componentplayer- the value for theplayerrecord componentlevel- the value for thelevelrecord componentpartialTick- the value for thepartialTickrecord componenttime- the value for thetimerecord componentdeltaTime- the value for thedeltaTimerecord componentage- the value for theagerecord componentvisibility- the value for thevisibilityrecord componentdayTime- the value for thedayTimerecord componentrain- the value for therainrecord componentthunder- the value for thethunderrecord component
-
-
Method Details
-
minecraft
public net.minecraft.client.Minecraft minecraft() -
inWorld
public boolean inWorld() -
inDimension
public boolean inDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) -
isNight
public boolean isNight()Whether it's night: between dusk (13000) and dawn (23000). -
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 '=='. -
skybox
Returns the value of theskyboxrecord component.- Returns:
- the value of the
skyboxrecord component
-
player
@Nullable public @Nullable net.minecraft.client.player.LocalPlayer player()Returns the value of theplayerrecord component.- Returns:
- the value of the
playerrecord component
-
level
@Nullable public @Nullable net.minecraft.client.multiplayer.ClientLevel level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
partialTick
public float partialTick()Returns the value of thepartialTickrecord component.- Returns:
- the value of the
partialTickrecord component
-
time
public float time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord component
-
deltaTime
public float deltaTime()Returns the value of thedeltaTimerecord component.- Returns:
- the value of the
deltaTimerecord component
-
age
public float age()Returns the value of theagerecord component.- Returns:
- the value of the
agerecord component
-
visibility
public float visibility()Returns the value of thevisibilityrecord component.- Returns:
- the value of the
visibilityrecord component
-
dayTime
public float dayTime()Returns the value of thedayTimerecord component.- Returns:
- the value of the
dayTimerecord component
-
rain
public float rain()Returns the value of therainrecord component.- Returns:
- the value of the
rainrecord component
-
thunder
public float thunder()Returns the value of thethunderrecord component.- Returns:
- the value of the
thunderrecord component
-