Celestial Object Entry - fishcute/Celestial GitHub Wiki

Celestial Objects can be registered in sky.json


Registered celestial objects must be located in assets/celestial/sky/(Dimension ID)/objects, otherwise they will not be loaded. Celestial objects can also be located in folders within the objects folder.

If an object is located in a folder within the objects folder, the object's registration ID must start with the folder name.

Examples:

assets/celestial/sky/overworld/objects/moon.json, Registration ID: moon

assets/celestial/sky/the_end/objects/folder/end_sun.json, Registration ID: folder/end_sun

Objects cannot have the same name (even if they are in different folders), otherwise they will be overridden.


Celestial objects are things that are rendered in the sky. The vanilla sun and moon are examples of celestial objects.

Entries:


Display

Entries:

  • scale, Equation: Scale of the object.
  • pos_x, Equation: Added position X of the object.
  • pos_y, Equation: Added position Y of the object.
  • pos_z, Equation: Added position Z of the object.
  • distance, Equation: Distance of the object to the camera.

Object types

skybox:

Renders the object as a skybox.

Entries:

  • texture, String: Texture of the skybox (Optional).

color:

Renders the object with a solid color.

Entries:

  • solid_color: Color Entry: Color of the skybox.

texture:

Renders the object with a texture.

Entries:

  • texture, String: Texture of the object.

Properties

Extra miscellaneous properties for objects

Entries:

  • has_moon_phases, Boolean: Determines if the object has moon phases. Texture should be formatted like vanilla moon_phases texture.
  • moon_phase, Equation: The moon phase of the object. Only works if has_moon_phase is enabled.
  • is_solid, Boolean: Determines if other objects can render through the object. Removes alpha from the object too.
  • color, Color Entry: Color of the object.
  • alpha, Equation: Alpha of object.

If an object is a populate object, and has per_object_calculations enabled, the following variables may be used in equations:

  • populateDegreesX: The rotation X added onto the populate object's rotation X.
  • populateDegreesY: The rotation Y added onto the populate object's rotation Y.
  • populateDegreesZ: The rotation Z added onto the populate object's rotation Z.
  • populatePosX: The pos X added onto the populate object's pos X.
  • populatePosY: The pos Y added onto the populate object's pos Y.
  • populatePosZ: The pos Z added onto the populate object's pos Z.
  • populateDistance: The distance added onto the populate object's distance.
  • populateScale: The scale added onto the populate object's scale.
  • populateId: The populate object number (Will be from 0 to the count of populate objects).

Populate

Allows for multiple duplicate objects to be rendered in different places, scales, and rotations. If enabled, the display and rotation categories will be ignored. Populate objects cannot be a skybox.

Entries:

As of the 1.2 update, the rotation, position, and other things are calculated once, and applied to every single populate object. With per_object_calculations, the rotation, position, and other things are calculated for each populate object.

Rotation (Populate)

Values from the original rotation category will be added onto these values.

Entries:

  • min_degrees_x, Float: The minimum degrees X objects can have.
  • max_degrees_x, Float: The minimum degrees X objects can have.
  • min_degrees_y, Float: The minimum degrees Y objects can have.
  • max_degrees_y, Float: The minimum degrees Y objects can have.
  • min_degrees_z, Float: The minimum degrees Z objects can have.
  • max_degrees_z, Float: The minimum degrees Z objects can have.

Display (Populate)

Entries:

  • min_scale, Float: The minimum scale objects can have.
  • max_scale, Float: The maximum scale objects can have.
  • min_pos_x, Float: The minimum added position X the object can have.
  • max_pos_x, Float: The maximum added position X the object can have.
  • min_pos_y, Float: The minimum added position Y the object can have.
  • max_pos_y, Float: The maximum added position Y the object can have.
  • min_pos_z, Float: The minimum added position Z the object can have.
  • max_pos_z, Float: The maximum added position Z the object can have.
  • min_distance, Float: The minimum distance to the camera the object can have.
  • max_distance, Float: The maximum distance to the camera the object can have.

Objects (Populate)

The object list is a JSON Object list. Contains populate object entries.

Will be added on to existing populate objects created using the default populate object creation system.

Example:

{
	"populate": {
		"objects": [{
				"degrees_x": 0,
				"degrees_y": 0,
				"degrees_z": 0,
				"scale": 0
			},
			{
				"degrees_x": 30,
				"degrees_y": 0,
				"degrees_z": 30,
				"scale": 10
			}
		]
	}
}

Populate object entry (Populate)

An entry for a populate object with specific values. Will still have values from the original rotation value added on, and will ignore values in the populate rotation entries and the populate display entries.

Entries:

  • scale, Float: The scale of the populate object
  • pos_x, Float: The X position of the populate object.
  • pos_y, Float: The Y position of the populate object.
  • pos_z, Float: The Z position of the populate object.
  • degrees_x, Float: The X rotation of the populate object.
  • degrees_y, Float: The Y rotation of the populate object.
  • degrees_z, Float: The Z rotation of the populate object.
  • distance, Float: The distance of the populate object.

Example:

{
  	"pos_x": 0,
	"pos_y": 0,
	"pos_z": 0,
	"degrees_x": 45,
	"degrees_y": 0,
	"degrees_z": 0,
	"scale": 0
}