Record Class SkyboxDefinition
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.sky.SkyboxDefinition
- Record Components:
layers- drawn in order, each in its stage; may be empty, to only hide parts of vanilla's skyhide- the parts of vanilla's sky hidden while the skybox showsdimensions- where the skybox shows by itself; empty to leave it to code (or the server) to enablepriority- skyboxes are drawn by ascending priority, so higher ones end up on topfadeIn- ticks it takes to fade infadeOut- ticks it takes to fade out
public record SkyboxDefinition(List<SkyLayerDefinition> layers, Set<VanillaSky> hide, List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> dimensions, int priority, int fadeIn, int fadeOut)
extends Record
The layers of a skybox and what it hides of vanilla's sky. Loaded from
assets/<namespace>/skybox/<path>.json,
or built with builder():
{
"dimensions": ["minecraft:overworld"],
"hide": ["sky", "sunrise", "stars"],
"priority": 0,
"fade_in": 20,
"fade_out": 20,
"layers": [
{"type": "cubemap", "texture": "mymod:textures/sky/day.png", "day_fade": {"fade_in": [22500, 0], "fade_out": [12000, 13500]}},
{"type": "panorama", "texture": "mymod:textures/sky/night.png", "day_fade": {"fade_in": [12000, 13500], "fade_out": [22500, 0]}}
]
}
A resource pack can add a skybox with no code at all: every file in a skybox folder that lists
dimensions is shown in those dimensions.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SkyboxDefinition> static final int -
Constructor Summary
ConstructorsConstructorDescriptionSkyboxDefinition(List<SkyLayerDefinition> layers, Set<VanillaSky> hide, List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> dimensions, int priority, int fadeIn, int fadeOut) Creates an instance of aSkyboxDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SkyboxDefinition.Builderbuilder()List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> Returns the value of thedimensionsrecord component.final booleanIndicates whether some other object is "equal to" this one.intfadeIn()Returns the value of thefadeInrecord component.intfadeOut()Returns the value of thefadeOutrecord component.final inthashCode()Returns a hash code value for this object.hide()Returns the value of thehiderecord component.layers()Returns the value of thelayersrecord component.intpriority()Returns the value of thepriorityrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_FADE
public static final int DEFAULT_FADE- See Also:
-
CODEC
-
-
Constructor Details
-
SkyboxDefinition
public SkyboxDefinition(List<SkyLayerDefinition> layers, Set<VanillaSky> hide, List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> dimensions, int priority, int fadeIn, int fadeOut) Creates an instance of aSkyboxDefinitionrecord class.- Parameters:
layers- the value for thelayersrecord componenthide- the value for thehiderecord componentdimensions- the value for thedimensionsrecord componentpriority- the value for thepriorityrecord componentfadeIn- the value for thefadeInrecord componentfadeOut- the value for thefadeOutrecord component
-
-
Method Details
-
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 '=='. -
layers
Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
hide
Returns the value of thehiderecord component.- Returns:
- the value of the
hiderecord component
-
dimensions
Returns the value of thedimensionsrecord component.- Returns:
- the value of the
dimensionsrecord component
-
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
fadeIn
public int fadeIn()Returns the value of thefadeInrecord component.- Returns:
- the value of the
fadeInrecord component
-
fadeOut
public int fadeOut()Returns the value of thefadeOutrecord component.- Returns:
- the value of the
fadeOutrecord component
-