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 sky
hide - the parts of vanilla's sky hidden while the skybox shows
dimensions - where the skybox shows by itself; empty to leave it to code (or the server) to enable
priority - skyboxes are drawn by ascending priority, so higher ones end up on top
fadeIn - ticks it takes to fade in
fadeOut - 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.
  • Field Details

  • 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 a SkyboxDefinition record class.
      Parameters:
      layers - the value for the layers record component
      hide - the value for the hide record component
      dimensions - the value for the dimensions record component
      priority - the value for the priority record component
      fadeIn - the value for the fadeIn record component
      fadeOut - the value for the fadeOut record component
  • Method Details

    • builder

      public static SkyboxDefinition.Builder builder()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • layers

      public List<SkyLayerDefinition> layers()
      Returns the value of the layers record component.
      Returns:
      the value of the layers record component
    • hide

      public Set<VanillaSky> hide()
      Returns the value of the hide record component.
      Returns:
      the value of the hide record component
    • dimensions

      public List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> dimensions()
      Returns the value of the dimensions record component.
      Returns:
      the value of the dimensions record component
    • priority

      public int priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • fadeIn

      public int fadeIn()
      Returns the value of the fadeIn record component.
      Returns:
      the value of the fadeIn record component
    • fadeOut

      public int fadeOut()
      Returns the value of the fadeOut record component.
      Returns:
      the value of the fadeOut record component