Skip to content

Commit

Permalink
Merge pull request #14 from Cosmic-Mod/blockninja124-post-sky-update
Browse files Browse the repository at this point in the history
Blockninja124 post sky update
  • Loading branch information
blockninja124 authored Sep 18, 2024
2 parents 258a8e1 + a489a69 commit c4f66f0
Show file tree
Hide file tree
Showing 6 changed files with 367 additions and 10 deletions.
4 changes: 4 additions & 0 deletions _data/docs_menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
items:
- name: Getting started
link: /addonsupport/gettingstarted/
- name: Cosmic data files
link: /addonsupport/cosmicdata/
- name: Solar Systems
link: /addonsupport/solarsystems/
- name: Planets
Expand All @@ -10,6 +12,8 @@
link: /addonsupport/dimensions/
- name: Skyboxes
link: /addonsupport/skyboxes/
- name: Sky data
link: /addonsupport/skydata/
- name: Fancy JSON text
link: /addonsupport/fancytext/
- name: Contributing
Expand Down
202 changes: 202 additions & 0 deletions addonsupport/cosmicdata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
---
title: Cosmic data
layout: page
show_sidebar: false
menubar: docs_menu
---

Most parts of the datapack system all stem from the same files. JSON files in the cosmic data section of a datapack.

They are stored under the cosmic namespace, in the cosmic_data folder.

> data
> > your_namespace
> > > etc
> > cosmos
> > > cosmic_data
> > > > solar_system_1.json
> > > >
> > > > solar_system_2.json
> > > >
> > > > planet_1.json
> > > >
> > > > planet_2.json
> > > >
> > > > overworld.json
> > > >
> > > > other_dimension.json
While all of these files are simply a "cosmic dimension data" file, they are commonly in two forms.

Either used to [setup a space dimension](/addonsupport/solarsystems/), or used to [configure settings for a planet/dimension](/addonsupport/dimensions/).

They will always include an `"attached_dimention_id"`, specifying which dimension they control.


| | Solar systems | Planets | Dimensions |
|-----------------------------------------------|---------------|---------|------------|
| [attached_dimension_id]() | ☑ | ☑ | ☑ |
| [planet_data](/addonsupport/planets/) | ☑ | ☐ | ☐ |
| [gui_data](/addonsupport/solarsystems/) | ☑ | ☐ | ☐ |
| [skybox_data](/addonsupport/skyboxes/) | ☐ | ☑ | ☑ |
| [dimensional_data](/addonsupport/dimensions/) | ☑ | ☑ | ☑ |


{% capture example_solar %}
```json
{
"planet_data": {
//...
},
"attached_dimention_id": "cosmos:solar_sys_d",
"local_id": "Solar Sys.",
"skybox_data": {
//...
},
"dimensional_data": {
"dimension_type": "space",
"weather": false,
"clouds": false,
"sky_objects": false,
"gravity": 0,
"air_resistance": 1
},
"gui_data": {
"solar_sys": {
"object_data": {
//...
},
"travel_dimension": "cosmos:solar_sys_d",
"origin_x": -24100,
"origin_y": 1000,
"origin_z": 5100,
"unlocking_dimension": "none",
"background": "solar_bg",
"title": "Solar Sys.",
"order": -4
}
}
}
```
{% endcapture %} {% include spoiler.html name="Example solar system file" content=example_solar %}

{% capture example_planet %}
```json
{
"attached_dimention_id": "cosmos:marslands",
"skybox_data": {
//...
},
"dimensional_data": {
"dimension_type": "planet",
"weather": false,
"clouds": false,
"sky_objects": false,
"gravity": 38,
"air_resistance": 0.98,
"atmospheric_data": {
"atmosphere_y": 560,
"travel_to": "cosmos:solar_sys_d",
"origin_x": -41000,
"origin_y": 860,
"origin_z": 18000,
"overlay_texture_id": "mars_bar",
"shipbit_y": 24,
"ship_min_y": 120
}
},
"sky_data": {
"sun": {
"type": "object",
"phased": false,
"object_yaw": 45,
"object_pitch": 40,
"object_roll": 35,
"yaw": 0,
"pitch": 0,
"roll": 0,
"yaw_speed": 0,
"pitch_speed": 0,
"roll_speed": 1,
"scale": 0.1,
"core_color": {
"r": 255,
"g": 255,
"b": 255
},
"bloom_color": {
"r": 64,
"g": 16,
"b": 8
}
},
"earth": {
"type": "object",
"phased": false,
"texture_id": "earth",
"object_yaw": 40,
"object_pitch": 30,
"object_roll": 20,
"yaw": 45,
"pitch": 0,
"roll": 180,
"yaw_speed": 0.5,
"pitch_speed": 0,
"roll_speed": 1,
"scale": 0.008
},
"saturn": {
"type": "object",
"phased": false,
"texture_id": "saturn",
"object_yaw": 45,
"object_pitch": 40,
"object_roll": 45,
"yaw": 0,
"pitch": 0,
"roll": 180,
"yaw_speed": 0,
"pitch_speed": 0,
"roll_speed": 1,
"scale": 0.02,
"ring_data": {
"ring1": {
"texture_id": "sat",
"scale_radius": 0.04,
"radius": 10
}
}
}
}
}
```
{% endcapture %} {% include spoiler.html name="Example planet file" content=example_planet %}

{% capture example_dim %}
```json
{
"attached_dimention_id": "minecraft:overworld",
"skybox_data": {
//...
},
"dimensional_data": {
"dimension_type": "planet",
"sky_objects": false,
"atmospheric_data": {
"atmosphere_y": 560,
"travel_to": "cosmos:solar_sys_d",
"origin_x": -24100,
"origin_y": 1000,
"origin_z": 5100,
"overlay_texture_id": "earth_bar",
"shipbit_y": 24,
"ship_min_y": 120
}
},
"sky_data": {
//...
}
}
```
{% endcapture %} {% include spoiler.html name="Example dimension with custom sky (e.g. overworld)" content=example_dim %}
77 changes: 69 additions & 8 deletions addonsupport/dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,81 @@ show_sidebar: false
menubar: docs_menu
---

Dimension data is commonly used in a [solar system file](/addonsupport/solarsystems/) to set the dimension settings. It will also be used to set the settings of a [planet](/addonsupport/planets)*
Dimension data is commonly used in a [cosmic data file](/addonsupport/cosmicdata/) to set a dimensions settings. Its used in both solar system files and standalone planet dimension files.

## Attributes:

`"dimension_type"`: string, can be space or planet*
`"dimension_type"`: string, can be "space" or "planet"

`"weather"`: boolean, controls whether or not the the dimension will rain and snow
`"sky_objects"`: boolean, if false it will disable vanilla stars, sun and moon for this dimension. If not included, will default to true.

`"clouds"`: boolean, controls whether or not the dimension will have clouds
`"weather"`: boolean, controls whether or not the the dimension will have vanilla rain and snow. If not included, will default to true.

`"gravity"`: float or int, is the percentage of earths gravity the dimension will have. Can be 0.1 for 10% or 10 for 10%
`"clouds"`: boolean, controls whether or not the dimension will have clouds. If not included, will default to true.

`"air_resistance"`: float, in the range of 0 to 1. Don’t let the name confuse you, 0 is maximum friction in the air and 1 is none. 1 will simulate space where when floating you have no control over your character, whereas 0 will prevent players from moving at all in the air
`"gravity"`: float or int, is the percentage of earths gravity the dimension will have. Can be 0.1 for 10% or 10 for 10%. If not included, will default to 100 (vanilla overworld).

***
`"air_resistance"`: float, in the range of 0 to 1. Don’t let the name confuse you, 0 is maximum friction in the air and 1 is none. 1 will simulate space where when floating you have no control over your character, whereas 0 will prevent players from moving at all in the air. If not included, will default to 0 (vanilla).

*planet dimensions have not been implemented yet
`"fog_data"`: JSON object, optional. If not included, will default to vanilla. If included, must contain the following:

{% capture fog_data %}

`"color"`: JSON object, must contain a "r", "g" and "b" key, each giving an int between 0 and 255 to control the fog color

Example:
```json
"color": {
"r": 255,
"b": 255,
"g": 255
}
```

`"level"`: float, controls the density of the fog. 0.1 is vanilla.

{% endcapture %} {% include spoiler.html name="Fog data" content=fog_data %}

`"weather_data"`: JSON object, optional. `"weather"` must be false for this setting to work. This setting will override vanilla rain/snow for custom particles, sounds etc. Must contain the following:

{% capture weather_data %}

`"condition"`: string, must be "rain", "snow" or "none". Controls when the custom weather will render.

`"texture_id"`: the name of the texture in assets/cosmos/... to be used for the particles

`"speed"`: float, the speed of the weather. Vanilla snow is 0.5, and vanilla rain is 2.

`"sound_generic"`: string, the sound played when the player is in an open area with this weather. Should be the name of a sound as shown with the /playsound command. (e.g. block.snow.fall)

`"sound_special"`: string, same as above, but will be player when the player is in an inclosed space instead. E.g. a house or a cave.

`"power"`: int, basically the volume of this weather. Recommended to be 1-5

`"hurt"`: boolean, controls whether the weather will hurt players. (E.g. acid rain)

`"damage"`: int, only needed if `"hurt"` is true. Controls the damage the weather does to the player. Each 1 is half a heart, so 5 would be 2 hearts and a half.

{% endcapture %} {% include spoiler.html name="Weather data" content=weather_data %}

`"atmospheric_data"`: JSON object, optional. If not included, will default to overworld. If included, must contain the following:

{% capture atmo_data %}

`"atmosphere_y"`: int, the Y level where players will be transported to space.

`"travel_to"`: string, the dimension players will be transported to on reaching the `"atmosphere_y"`. Usually the solar system dimension this planet is in. Should be in `namespace:dimension` form.

`"origin_x"`: int, the x position players will be sent to on entering this planet by default

`"origin_y"`: int, same as above but y position

`"origin_z"`: int, same as above but z position

`"overlay_texture_id"`: string, the name of a texture in assets/cosmos/... Will be used for the sidebar showing height progress when launching a rocket. MUST be 16x128

`"shipbit_y"`: int, the offset of pixels from the bottom of the overlay image that will be the lowest point the ship icon can reach.

`"ship_min_y"`: int, the y position at which the rocket icon will be at the lowest point, at `"shipbit_y"` on the overlay texture

{% endcapture %} {% include spoiler.html name="Atmospheric data" content=atmo_data %}
4 changes: 2 additions & 2 deletions addonsupport/planets.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ flip_z
{% endcapture %}
{% include spoiler.html name="Ringed data" content=ringed_data %}

`attached_dimention_id`: string, todo: figure out
`attached_dimension_id`: string, the dimension the planet will teleport you to

`skybox_data`: dictionary, contains the skybox?
`skybox_data`: JSON object, see [skybox data](/addonsupport/skyboxes/)
20 changes: 20 additions & 0 deletions addonsupport/skyboxes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,24 @@ Skybox data is a JSON object, commonly used in [solar system data](/addonsupport

`"roll"`: int, roll of the skybox texture

`"alpha"`: int, from 0 to 255. Transparency of the skybox. Behind the skybox is simply sky fog. 0 is no skybox visible, 255 is no fog visible.

`"rotation_plane"`: string, can be either "yaw", "pitch" or "roll". Controls which axis the skybox will rotate around. (Optional)

`"fade"`: string, can be "day" or "night". Defines when the skybox will fade away. (Optional)

`"vanilla_sunlight"`: boolean, controls weather the sunlight color will be vanilla or not.

`"sunlight_color"`: JSON object, must be included if `"vanilla_sunlight"` is false. Must include the following:

{% capture light_data %}

"r": int, from 0 to 255. Controls the red in the sunlight color

"g": int, from 0 to 255. Controls the green in the sunlight color

"b": int, from 0 to 255. Controls the blue in the sunlight color

"alpha": int, from 0 to 255. Controls the transparency of the sunlight. Basically the brightness of the sunlight. 255 is full brightness, 0 is darkness.

{% endcapture %} {% include spoiler.html name="Sunlight color" content=light_data %}
Loading

0 comments on commit c4f66f0

Please sign in to comment.