-
Notifications
You must be signed in to change notification settings - Fork 26
Cube Planets
Cube planets are the most straightforward celestial body. They are loaded from /data/<namespace>/universe_planets/<name>.json.
Cube planets are constructed in a "priority override" system, where the non-empty fields of higher priority files override the fields of lower priority files. As such, all fields are by default optional and only present fields will override the settings of lower priority files. However, the planet will fail to construct and an error will be logged if critical information is missing after the composition is finished. Note that celestial positions and rotations cannot be partially overridden, but must be swapped out completely.
Certain fields are "paired" with other fields. This means that at least one of the paired fields must be present, but some will override others if present. As an example, either mu or acceleration_at_surface must be provided, but mu will take priority over acceleration_at_surface.
While Cube Planets can be linked to custom dimensions, we do not provide any tools to add dimensions. However, datapacks are entirely capable of adding custom dimensions, and tutorials exist for this.
parent (critical): The name of the parent body. If the planet has no parent body, such as sol by default, use root here.
name (required): The name field is extremely important. In the vast majority of cases it will be the same as the file name. The name field is used to determine what files stack on each other during the "priority override" phase.
radius (critical): The radius of the cube planet, equivalent to half its side length.
mu (critical, paired with acceleration_at_surface) the standard gravitational parameter (μ) of this cube planet.
acceleration_at_surface (critical, paired with mu) the acceleration that physics objects are subject to at a distance of radius from the center of the cube planet.
position (critical) A Celestial Position
rotation (critical) A Celestial Rotation
dimension_data (optional) A compound object consisting of the following fields:
linked_dimension(critical) The resource location of the dimension linked to this cube planet.
allowed_transfer(optional, defaultnone) Which transitions between deep space and the dimension are allowed. Options areall,none,to_space, andto_dimension.
dimension_transfer_height(optional, default20_000) The height of the transition point. Applies to both deep space and the dimension. Must be an integer.
render_universe_in_dimension(optional, defaultfalse) Whether the universe should render in the dimension's skybox. The dimension's default skybox must be manually disabled elsewhere.
dimension_day_time_controller_name(optional) The name of the celestial body that will be compared against to determine the time of day in the linked dimension. Recommended if the universe is rendered in the dimension.
apply_gravity_correction_to_entities_in_dimension(optional, defaultfalse) Whether a gravity correction should be applied to entities in the dimension. Normal gravity is assumed to be11m/s^2at surface because this is the Sable default, and the correction will be proportional to the ratio between this and the cube planet's acceleration at surface. The acceleration at surface can be derived frommu.
planet_extras (optional) A compound object consisting of the following fields:
is_star(optional, defaultfalse) Whether the cube planet is a star and should have a star render.
has_clouds(optional, defaultfalse) Whether the cube planet should have clouds render above its surface.
light_source_name(optional) The name of the celestial body that will be used to determine shadows cast across the planet's surface.
texture_override (optional) A resource location to a texture to use instead of generating the texture from biome data. Changing how the texture is generated from biome data is not yet supported.
use_texture_override (optional, default true) Whether the texture_override should actually be used, if it is present.
priority (optional, default 1000) The priority of this file in the "priority override" phase. Must be an integer. Cube planets added by the base mod have a priority of 0.
disabled (optional, default false) Whether this planet should be loaded. Useful for disabling planets added by the base mod.