├── docs ├── .gitignore ├── serve.sh ├── src │ ├── 'Celestial-Object-Entry.md' │ ├── '[Removed]-Star-Details.md' │ ├── '[Removed]-Sky-Render-Type.md' │ ├── FontAwesome │ │ └── fonts │ │ │ ├── FontAwesome.ttf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ ├── Dimension-Entry.md │ ├── SUMMARY.md │ ├── Rotation-Entry.md │ ├── [Removed]-Sky-Render-Type.md │ ├── [Removed]-Star-Details.md │ ├── searchindex.json │ ├── Environment-Details.md │ ├── JSON-Files.md │ ├── Vertex-List.md │ ├── Color-Entry.md │ ├── Improving-Performance.md │ ├── Updating-to-2.0.md │ ├── Home.md │ ├── Skybox-Objects.md │ ├── Custom-Variables.md │ ├── Celestial-Object-Entry.md │ └── Equations.md └── book.toml ├── modpage ├── icon.png ├── line.png ├── logo.png ├── note.png ├── icon_small.png ├── logo_small.png ├── demo_banner.png └── features_banner.png ├── TemplateResourcePack2.0.zip ├── .gitignore ├── .github └── ISSUE_TEMPLATE │ ├── suggestion.md │ ├── bug-report.md │ └── crash.md ├── LICENSE └── README.md /docs/.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | -------------------------------------------------------------------------------- /docs/serve.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mdbook serve -p 3000 -n 0.0.0.0 3 | -------------------------------------------------------------------------------- /docs/src/'Celestial-Object-Entry.md': -------------------------------------------------------------------------------- 1 | # Celestial Object Entry 2 | -------------------------------------------------------------------------------- /docs/src/'[Removed]-Star-Details.md': -------------------------------------------------------------------------------- 1 | # REMOVED - Star Details 2 | -------------------------------------------------------------------------------- /docs/src/'[Removed]-Sky-Render-Type.md': -------------------------------------------------------------------------------- 1 | # REMOVED - SkyRender Type 2 | -------------------------------------------------------------------------------- /modpage/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/icon.png -------------------------------------------------------------------------------- /modpage/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/line.png -------------------------------------------------------------------------------- /modpage/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/logo.png -------------------------------------------------------------------------------- /modpage/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/note.png -------------------------------------------------------------------------------- /modpage/icon_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/icon_small.png -------------------------------------------------------------------------------- /modpage/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/logo_small.png -------------------------------------------------------------------------------- /docs/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = [] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | -------------------------------------------------------------------------------- /modpage/demo_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/demo_banner.png -------------------------------------------------------------------------------- /TemplateResourcePack2.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/TemplateResourcePack2.0.zip -------------------------------------------------------------------------------- /modpage/features_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/modpage/features_banner.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.html 2 | **/*.css 3 | **/*.js 4 | **/*.svg 5 | **/*.png 6 | docs/book/ 7 | docs/src/fonts/ 8 | docs/src/css/ 9 | -------------------------------------------------------------------------------- /docs/src/FontAwesome/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/docs/src/FontAwesome/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /docs/src/FontAwesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/docs/src/FontAwesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/src/FontAwesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/docs/src/FontAwesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/src/FontAwesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/docs/src/FontAwesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/src/FontAwesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fishcute/Celestial/HEAD/docs/src/FontAwesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/suggestion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Suggestion 3 | about: Suggest ideas, can be new variables for Equations, or other things. 4 | title: "[Suggestion]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Feature** 11 | What is your feature idea? 12 | 13 | **Potential uses** 14 | How could this feature be useful? 15 | 16 | **Details** 17 | Extra details for your suggestion 18 | -------------------------------------------------------------------------------- /docs/src/Dimension-Entry.md: -------------------------------------------------------------------------------- 1 | Dimensions can be registered in [`dimensions.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#dimensionsjson) 2 | 3 | *** 4 | 5 | Registered dimensions must have a folder in `assets\celestial\sky` named after the dimension's in-game id. 6 | 7 | _For example: The overworld would be registered as `overworld`, and the end would be registered as `the_end`._ 8 | 9 | *** 10 | 11 | Registering modded dimensions is supported. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Any issues that do not cause a crash 4 | title: "[Bug]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Bug description** 11 | Describe the issue here 12 | 13 | **Fabric or Forge** 14 | Which version did the crash occur on? 15 | 16 | **Mod version** 17 | What version of the mod were you using? 18 | 19 | **Game version** 20 | What version of Minecraft were you using? 21 | 22 | **Other details** 23 | Any other details that might be useful. 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/crash.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Crash 3 | about: Use if a crash occured 4 | title: "[Crash]" 5 | labels: crash 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Crash report** 11 | Paste your crash report here. 12 | 13 | **Fabric or Forge** 14 | Which version did the crash occur on? 15 | 16 | **Mod version** 17 | What version of the mod were you using? 18 | 19 | **Game version** 20 | What version of Minecraft were you using? 21 | 22 | **Other mods** 23 | Put a list of other mods you are using. 24 | 25 | **Other details** 26 | Other details that might be useful. 27 | -------------------------------------------------------------------------------- /docs/src/SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | [Introduction](Home.md) 4 | 5 | - Test 6 | - [REMOVED - SkyRender Type]('[Removed]-Sky-Render-Type.md') 7 | - [REMOVED - Star Details]('[Removed]-Star-Details.md') 8 | - [Celestial Object Entry]('Celestial-Object-Entry.md') 9 | - [Color Entry](Color-Entry.md) 10 | - [Custom Variables](Custom-Variables.md) 11 | - [Dimension Entry](Dimension-Entry.md) 12 | - [Environment Details](Environment-Details.md) 13 | - [Equations](Equations.md) 14 | - [Improving Performance](Improving-Performance.md) 15 | - [JSON Files](JSON-Files.md) 16 | - [Rotation Entry](Rotation-Entry.md) 17 | - [Skybox Objects](Skybox-Objects.md) 18 | - [Updating to 2.0](Updating-to-2.0.md) 19 | - [Vertex List](Vertex-List.md) 20 | -------------------------------------------------------------------------------- /docs/src/Rotation-Entry.md: -------------------------------------------------------------------------------- 1 | All `rotation` entries have a common format. This will go over that format. 2 | 3 | ### Entries: 4 | - `degrees_x`, _Equation_: The X degrees of the rotation. 5 | - `degrees_y`, _Equation_: The Y degrees of the rotation. 6 | - `degrees_z`, _Equation_: The Z degrees of the rotation. 7 | - `base_degrees_x`, _Equation_: The base X degrees of the rotation. 8 | - `base_degrees_y`, _Equation_: The base Y degrees of the rotation. 9 | - `base_degrees_z`, _Equation_: The base Z degrees of the rotation. 10 | 11 | ### Base degrees 12 | Base degrees are the rotations applied before any transformations occur. This allows for more control over rotations, but does not need to be used for basic rotations. By default, the base rotation is -90, 0, -90. 13 | 14 | -------------------------------------------------------------------------------- /docs/src/[Removed]-Sky-Render-Type.md: -------------------------------------------------------------------------------- 1 | # Note: As of the 1.3 update, this feature has been removed. 2 | 3 | [Skybox objects](https://github.com/fishcute/Celestial/wiki/Skybox-Objects) can be used to render skyboxes instead. 4 | 5 | *** 6 | 7 | The sky render type can be set in [`sky.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#skyjson). 8 | 9 | *** 10 | 11 | ### Render types 12 | Currently, there are two sky render types: 13 | - `normal`: Renders the sky like the overworld (Solid color, twilight colors). 14 | - `skybox`: Renders the sky like the end sky box (Box with repeating textures). 15 | ### Skybox 16 | The `skybox` render type has an extra variable that sets the file path to the texture, named `skybox_texture`. This can be found in [`sky.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#skyjson). 17 | 18 | -------------------------------------------------------------------------------- /docs/src/[Removed]-Star-Details.md: -------------------------------------------------------------------------------- 1 | # Note: As of the 1.2 update, this feature has been removed. 2 | 3 | [Populate celestial objects](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#populate) with a solid color can be used to render stars instead. 4 | 5 | *** 6 | 7 | The environment details section in [`sky.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#skyjson) allows resource packs to change environmental details, such as fog, sky colors, and other various things. 8 | 9 | *** 10 | 11 | ### Entries: 12 | - `rotation`, _JSON Object_: Controls the rotation of the stars. [[More details]](https://github.com/fishcute/Celestial/wiki/Rotation-Entry) 13 | - `count`, _Integer_: Number of stars in the sky. 14 | - `brightness`, _Equation_: Alpha of stars. 15 | - `min_size`, _Float_: Minimum size of stars. 16 | - `max_size`, _Float_: Maximum size of stars. 17 | - `colors`, _String list_: List of hex colors of stars. 18 | 19 | Variables for `brightness`: 20 | - #starAlpha: Brightness of stars -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 fishcute 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/src/searchindex.json: -------------------------------------------------------------------------------- 1 | {"doc_urls":["chapter_1.html#chapter-1"],"index":{"documentStore":{"docInfo":{"0":{"body":0,"breadcrumbs":4,"title":2}},"docs":{"0":{"body":"","breadcrumbs":"Chapter 1 » Chapter 1","id":"0","title":"Chapter 1"}},"length":1,"save":true},"fields":["title","body","breadcrumbs"],"index":{"body":{"root":{"1":{"df":1,"docs":{"0":{"tf":1.0}}},"c":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"p":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.0}}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}},"breadcrumbs":{"root":{"1":{"df":1,"docs":{"0":{"tf":1.7320508075688772}}},"c":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"p":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.7320508075688772}}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}},"title":{"root":{"1":{"df":1,"docs":{"0":{"tf":1.0}}},"c":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"p":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.0}}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}}},"lang":"English","pipeline":["trimmer","stopWordFilter","stemmer"],"ref":"id","version":"0.9.5"},"results_options":{"limit_results":30,"teaser_word_count":30},"search_options":{"bool":"OR","expand":true,"fields":{"body":{"boost":1},"breadcrumbs":{"boost":1},"title":{"boost":2}}}} -------------------------------------------------------------------------------- /docs/src/Environment-Details.md: -------------------------------------------------------------------------------- 1 | The environment details section in [`sky.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#skyjson) allows resource packs to change environmental details, such as fog, sky colors, and other various things. 2 | 3 | *** 4 | 5 | ### Entries: 6 | - `fog_color`, _Color Entry_: The hex color of fog. 7 | - `sky_color`, _Color Entry_: The hex color of the sky. 8 | - `twilight_color`, _Color Entry_: The hex color of sunrises/sunsets. 9 | - `twilight_alpha`, _Equation_: The alpha value of sunrises/sunsets. 10 | - `clouds`, _JSON Object_: Details for cloud rendering. [[More details]](https://github.com/fishcute/Celestial/wiki/Environment-Details#cloud-details) 11 | - `fog`, _JSON Object_: Details for fog rendering. [[More details]](https://github.com/fishcute/Celestial/wiki/Environment-Details#fog-details) 12 | - `void_culling_level`, _Equation_: How high or low the void culling effect should appear. 13 | 14 | *** 15 | 16 | ## Cloud Details 17 | 18 | ### Entries: 19 | - `height`, _Equation_: The y-level of clouds. 20 | - `color`, _Color Entry_: The hex color of clouds. 21 | 22 | *** 23 | 24 | ## Fog Details 25 | 26 | ### Entries: 27 | - `has_thick_fog`, _Boolean_: Use nether fog. 28 | - `fog_start`, _Equation_: The start distance of fog. Will not have an effect if `has_thick_fog` is enabled. 29 | - `fog_end`, _Equation_: The end distance of fog. Will not have an effect if `has_thick_fog` is enabled. 30 | 31 | (Will be changed soon) To use default fog, set `fog_start` and `fog_end` to `-1` -------------------------------------------------------------------------------- /docs/src/JSON-Files.md: -------------------------------------------------------------------------------- 1 | All the JSON files that are used. 2 | 3 | *** 4 | 5 | ## dimensions.json 6 | 7 | This is the file that will allow you to register skies for specific dimensions. 8 | 9 | *** 10 | 11 | `dimensions.json` will only function if the file is located in `assets\celestial\sky`. 12 | 13 | ### Entries: 14 | - `dimensions`, _String list_: The list of all dimensions to be loaded. 15 | 16 | ## variables.json 17 | 18 | This is the file where [custom variables](https://github.com/fishcute/Celestial/wiki/Custom-Variables) can be registered. 19 | 20 | *** 21 | 22 | `variables.json` will only function if the file is located in `assets\celestial\sky`. 23 | 24 | ### Entries: 25 | - `variables`, _JSON Object list_: The list of all custom variables to be registered. 26 | 27 | ## sky.json 28 | 29 | This is the file that will allow you to register skies for specific dimensions. 30 | 31 | *** 32 | 33 | `sky.json` will only function if the file is located in `assets\celestial\sky\(Dimension ID)`. 34 | 35 | ### Entries: 36 | - `sky_objects`, _String list_: The list of registration IDs for all [celestial object](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry) to be rendered. The order of entries will determine which objects are rendered when (First in the list will be rendered first, making it render under every other object, and the last in the list will make it render last, making it render over everything). File names should not include ".json". 37 | - `environment`, _JSON Object_: Details for environment rendering. [[More details]](https://github.com/fishcute/Celestial/wiki/Environment-Details#fog-details) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](https://raw.githubusercontent.com/fishcute/Celestial/main/modpage/logo.png) 2 | 3 | A Minecraft mod for Fabric and Forge that allows you to customize the sky. 4 | 5 | View the wiki on how to make custom resource packs [here](https://github.com/fishcute/Celestial/wiki) 6 | 7 | [Curseforge Page](https://www.curseforge.com/minecraft/mc-mods/celestial) 8 | 9 | [Modrinth Page](https://modrinth.com/mod/celestial) 10 | 11 | # Links to repositories 12 | 13 | ## [Celestial (Current Repository)](https://github.com/fishcute/Celestial) 14 | This repository does not contain updated code for Celestial. It is used as a unifier for all Celestial repositories, and contains the Celestial wiki. 15 | 16 | ## [CelestialMain](https://github.com/fishcute/CelestialMain) 17 | This repository contains versionless code that every version of Celestial uses. It helps keep Celestial unified and mostly consistent between versions. 18 | 19 | ## [CelestialExpressions](https://github.com/block36underscore/CelestialExpressions) 20 | This repository contains the code that is used to solve equations containing variables and functions. 21 | 22 | ## [Celestial1.16.5](https://github.com/fishcute/Celestial1.16.5) 23 | This repository contains the code for Celestial 1.16.5. 24 | 25 | ## [Celestial1.18.2](https://github.com/fishcute/Celestial1.18.2) 26 | This repository contains the code for Celestial 1.18.2. 27 | 28 | ## [Celestial1.19.4](https://github.com/fishcute/Celestial1.19.4) 29 | This repository contains the code for Celestial 1.19.4. 30 | 31 | ## [Celestial1.21](https://github.com/fishcute/Celestial1.21) 32 | This repository contains the code for Celestial 1.21. 33 | -------------------------------------------------------------------------------- /docs/src/Vertex-List.md: -------------------------------------------------------------------------------- 1 | Vertex lists allow you to customize the shape and UV mappings of an object's vertex. 2 | 3 | Vertex lists consist of [vertex points](https://github.com/fishcute/Celestial/wiki/Vertex-List#vertex-points). 4 | 5 | Example: 6 | ``` 7 | "vertex": [ 8 | { "x": "-100", "y": "50", "z": "-100", "uv_x": 0, "uv_y": 0 }, 9 | { "x": " 100", "y": "50", "z": "-100", "uv_x": 1, "uv_y": 0 }, 10 | { "x": " 100", "y": "50", "z": " 100", "uv_x": 1, "uv_y": 1 }, 11 | { "x": "-100", "y": "50", "z": " 100", "uv_x": 0, "uv_y": 1 } 12 | ] 13 | ``` 14 | 15 | This would render a textured object that has a size of 100, and a distance of 50. 16 | 17 | *** 18 | 19 | ## Vertex points 20 | 21 | Vertex points are entries in a vertex list, and are formatted as JSON objects. 22 | 23 | ### Entries: 24 | 25 | - `x`, _Equation_: The X position of the vertex. 26 | - `y`, _Equation_: The Y position of the vertex. 27 | - `z`, _Equation_: The Z position of the vertex. 28 | - `uv_x`, _Equation_: The X position of the UV (Optional). 29 | - `uv_z`, _Equation_: The Z position of the UV (Optional). 30 | 31 | If an object's [type](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#object-types) is `color`, the `uv_x` and `uv_z` values do not need to be present. 32 | 33 | *** 34 | 35 | ### Examples 36 | 37 | Renders a square with a texture. 38 | 39 | ``` 40 | "vertex": [ 41 | { "x": "-100", "y": "50", "z": "-100", "uv_x": 0, "uv_y": 0 }, 42 | { "x": " 100", "y": "50", "z": "-100", "uv_x": 1, "uv_y": 0 }, 43 | { "x": " 100", "y": "50", "z": " 100", "uv_x": 1, "uv_y": 1 }, 44 | { "x": "-100", "y": "50", "z": " 100", "uv_x": 0, "uv_y": 1 } 45 | ] 46 | ``` 47 | 48 | Renders a right triangle with a texture. 49 | 50 | ``` 51 | "vertex": [ 52 | { "x": "-100", "y": "50", "z": "-100", "uv_x": 0, "uv_y": 0 }, 53 | { "x": " 100", "y": "50", "z": "-100", "uv_x": 1, "uv_y": 0 }, 54 | { "x": " 100", "y": "50", "z": " 100", "uv_x": 1, "uv_y": 1 }, 55 | { "x": "0", "y": "0", "z": "0", "uv_x": 0, "uv_y": 0 } 56 | ] 57 | ``` 58 | 59 | Renders a square without a texture. 60 | 61 | ``` 62 | "vertex": [ 63 | { "x": "-100", "y": "50", "z": "-100" }, 64 | { "x": " 100", "y": "50", "z": "-100" }, 65 | { "x": " 100", "y": "50", "z": " 100" }, 66 | { "x": "-100", "y": "50", "z": " 100" } 67 | ] 68 | ``` 69 | -------------------------------------------------------------------------------- /docs/src/Color-Entry.md: -------------------------------------------------------------------------------- 1 | Color entries allow for more customization for colors of objects. 2 | 3 | *** 4 | 5 | Color entries can be formatted in two ways: 6 | 7 | `(name): "#ffffff"` 8 | 9 | Or as a JSON Object: 10 | 11 | `(name): {}` 12 | 13 | The first method of formatting color entries allows you to set a simple color that won't be changed in any way. This method will usually be better for performance. 14 | 15 | The second method is a complex color entry. Complex color entries allow for changing colors and more complicated things. 16 | 17 | Color entries can also have their value set to either `#skyColor` or `#fogColor`. If the value is set to one of these, it will take either the sky color or fog color depending on which one was used. 18 | 19 | ## Complex Color Entries 20 | 21 | Complex color entries allow you to set a base color, and color overrides. 22 | 23 | *** 24 | 25 | ### Entries: 26 | 27 | - `base_color`, _String/HEX Color_: The base color that other colors will be added onto. Can be set to `inherit` to inherit the original color (ex. If this color entry is used for the sky color, it will inherit the default sky color). 28 | - `colors`, _JSON Object list_: The list of [color overrides](https://github.com/fishcute/Celestial/wiki/Color-Entry#color-override). 29 | - `update_frequency`, _Integer_: How often the color will be updated (Higher values will make the color update less frequently, but will improve performance). 30 | - `red`, _Equation_: How much red will be present in the color. 31 | - `green`, _Equation_: How much green will be present in the color. 32 | - `blue`, _Equation_: How much blue will be present in the color. 33 | - `ignore_sky_effects`, _Boolean_: Whether or not the color should change depending on various environmental factors (night, rain, wither effect). This entry will only work for `fog_color`, `sky_color`, and the `color` entry in the cloud environmental details section. 34 | 35 | Example: 36 | ``` 37 | "color": { 38 | "update_frequency": 0, 39 | "base_color": "#ffffff", 40 | "colors": [{ 41 | "color": "ff0000", 42 | "alpha": "1 - #dayLight" 43 | }, 44 | { 45 | "color": "0800ff", 46 | "alpha": "#isHolding(stone)" 47 | } 48 | ] 49 | } 50 | ``` 51 | 52 | This color would be fully white in the morning, and get more red as the night comes. If the player is holding a block of stone, the color will turn blue. 53 | 54 | Another Example: 55 | 56 | ``` 57 | "fog_color": { 58 | "update_frequency": 0, 59 | "base_color": "inherit", 60 | "colors": [{ 61 | "color": "c4ac6a", 62 | "alpha": "#distanceToBiome(desert)" 63 | } 64 | ] 65 | } 66 | ``` 67 | 68 | If this were to be used as the fog color, it would use the default fog color and make the fog turn more sand-colored as the player goes closer to a desert. 69 | 70 | ## Color Override 71 | 72 | An entry in the colors list. 73 | 74 | *** 75 | 76 | ### Entries: 77 | - `color`, _String/HEX Color_: The color that will override the base color. 78 | - `alpha`, _Equation_: The alpha/prominence of the color. If this value is equal to 1, it will completely override the base color and any other color entries before this entry. If this value is 0, it will not be present at all. 79 | 80 | -------------------------------------------------------------------------------- /docs/src/Improving-Performance.md: -------------------------------------------------------------------------------- 1 | # This page is still being developed! 2 | If you would like to suggest anything for here, feel free to create a suggestion in the issue tracker or message me on discord. 3 | 4 | *** 5 | 6 | It is important to keep performance in mind when creating a resource pack. While Celestial will try to be relatively optimized, there are some things that can cause performance issues if used incorrectly or poorly. 7 | *** 8 | ## Improving Performance with Custom Variables 9 | Variables can allow for complicated equations to only be calculated once per a specified frequency. Rather than having a complicated equation be calculated multiple times, a custom variable with a value set as the equation can drastically improve performance. 10 | 11 | While equations themselves are not particularly performance heavy, some things such as [special variables](https://github.com/fishcute/Celestial/wiki/Equations#special-variables) can be more performance heavy. When using special variables for multiple things, it is strongly recommended to use a custom variable instead. 12 | 13 | For example, say you want multiple celestial objects to appear when you are in a plains biome. 14 | 15 | Instead of setting each object's value to something like this: 16 | 17 | `"alpha": "#distanceToBiome(plains, 8)"` 18 | 19 | `"alpha": "#distanceToBiome(plains, 8) / 2"` 20 | 21 | `"alpha": "#distanceToBiome(plains, 8) + 0.1"` 22 | 23 | You can create a custom variable and do something like this instead: 24 | 25 | ``` 26 | "variables": [ 27 | { 28 | "name": "customVariable", 29 | "value": "#distanceToBiome(plains, 8)" 30 | } 31 | ] 32 | ``` 33 | 34 | `"alpha": "#customVariable"` 35 | 36 | `"alpha": "#customVariable / 2"` 37 | 38 | `"alpha": "#customVariable + 0.1"` 39 | 40 | This will improve performance drastically, as #distanceToBiome can be very performance heavy. It is recommended to do this for other custom variables too. 41 | 42 | ## Improving Equation Performance 43 | 44 | While equations aren't particularly performance intensive, there are ways that they can be optimized. One way they can be optimized is by decreasing the amount of math that needs to be done. Along with this, equations that have single values (such as `10`, or `#skyAngle`) can be better for performance. 45 | 46 | For example, instead of doing something like this: 47 | 48 | `"distance": "10 + 5 + 2"` 49 | 50 | `"alpha": "0.5 * 2"` 51 | 52 | `"pos_x": "15 / 5"` 53 | 54 | This should be done instead: 55 | 56 | `"distance": "17"` 57 | 58 | `"alpha": "1"` 59 | 60 | `"pos_x": "3"` 61 | 62 | ## Improving Populate Object Performance 63 | 64 | There are many advantages to using populate objects, but due to their ability to create a lot of objects, they can also easily cause performance issues. 65 | 66 | Below is a list of things that could impact performance negatively (Do not do these): 67 | - A high count populate object using a texture (Causes FPS issues due to many textures being rendered) 68 | - An extremely high count populate object 69 | - A high count populate object using `per_object_calculations` 70 | 71 | It is recommended to not use `per_object_calculations` when having a high count of populate objects. If for example you set `per_object_calculations` to true and have a populate count of 1000, that means the mod would have to do 1000 more calculations per tick. 72 | 73 | *** 74 | 75 | Keep in mind these are only suggestions for improving performance. They do not need to be followed but are strongly recommended. -------------------------------------------------------------------------------- /docs/src/Updating-to-2.0.md: -------------------------------------------------------------------------------- 1 | Celestial 2.0 changes a few important things that will affect existing Celestial resource packs. This will go through how to update your Celestial resource pack to version 2.0. 2 | 3 | ## Base Degree Rotations 4 | In this update, [base degree rotations](https://github.com/fishcute/Celestial/wiki/Rotation-Entry#base-degrees) **no longer default to -90, 0, -90**. It instead defaults to 0, 0, 0. Rotations for sky objects affected by this can be easily fixed by adding this to each sky object: 5 | ``` 6 | "rotation": { 7 | "base_degrees_x": "-90", 8 | "base_degrees_z": "-90" 9 | } 10 | ``` 11 | Alternatively, if you wish for sky object base degrees to default to -90, 0, -90, a new option `legacy_rotations` can be enabled in your resource pack's `dimensions.json` 12 | ``` 13 | "legacy_rotations": true 14 | ``` 15 | It is encouraged to convert all sky objects using the first method, however, this second option will remain available in the future. 16 | 17 | ## Variables and Functions 18 | In this update, variables and functions have received two changes. The first change is that the hashtag (#skyAngle) is no longer required (skyAngle). Existing hash tags will be ignored, so removing them is not necessary. It is still recommended to remove them, as they may be repurposed for other features in the future. 19 | 20 | More importantly, multiple variables and functions have been renamed. This change was made to maintain consistency in Celestial variables, and another mass-renaming will likely never occur again. 21 | 22 | Renaming every variable in a Celestial resource pack can take a while, but if you have [Notepad++](https://notepad-plus-plus.org/), you can easily rename variables and functions in a resource pack using its `Find in File` feature in the Find menu. 23 | 24 | ![find in file](https://github.com/user-attachments/assets/1860a6d0-ecb3-4a70-853e-1d74cf64d00e) 25 | 26 | Below is a list of all renamed variables and functions: 27 | 28 | ### Variables 29 | - `rainLevel` -> `rainAlpha` 30 | - `thunderGradient` -> `thunderAlpha` 31 | - `isRightClicking` -> `rightClicking` 32 | - `isLeftClicking` -> `leftClicking` 33 | - `isSubmerged` -> `submerged` 34 | - `getGameTime` -> `gameTime` 35 | - `getWorldTime` -> `worldTime` 36 | - `getDayTime` -> `dayTime` 37 | - `xPos` -> `posX` 38 | - `yPos` -> `posY` 39 | - `zPos` -> `posZ` 40 | 41 | ### Functions 42 | - `isInBiome(...)` -> `inBiome(...)` 43 | - `isUsing(...)` -> `rightClickingWith(...)` 44 | - `isMiningWith(...)` -> `leftClickingWith(...)` 45 | - `isHolding(...)` -> `holding(...)` 46 | - `isInArea(...)` -> `inArea(...)` 47 | - `distanceToBiomeIgnoreY(...)` -> `distanceToBiomeFlat(...)` 48 | - `()m()` -> `min(x, y)` 49 | - `()M()` -> `max(x, y)` 50 | 51 | Along with this, a few function arguments have changed. 52 | 53 | - `distanceToBiome([Distance], [Biome Name]...)` 54 | - `distanceToBiomeFlat([Distance], [Y Position], [Biome Name]...)` 55 | 56 | ## Color Entries 57 | Color entries have received a few small changes. 58 | - `alpha` has been renamed to `ratio` 59 | - `inherit` has been removed. Instead, use the respective color variable (`#skyColor`, `#fogColor`). 60 | 61 | ## Celestial Objects 62 | Blank values in Celestial objects have been given new default values that are greater than zero. Some populate objects (ex. stars in the demo packs) may rely on these values defaulting to zero, so it may be necessary to manually set these values to zero in the celestial object file. 63 | 64 | ## Twilight Settings 65 | Twilight settings in the [environment settings](https://github.com/fishcute/Celestial/wiki/Environment-Details#entries) have been deprecated, and will be removed in a future update. An alternative solution for twilight has been added in this update, so it is recommended to use this if anything in your resource pack relies on these settings. 66 | 67 | ## Fog 68 | `fog_start` and `fog_end` no longer use `-1` as a default value. Instead, they both use the `fogStart` and `fogEnd` variables respectively. 69 | ``` 70 | "fog": { 71 | "fog_start": "fogStart", 72 | "fog_end": "fogEnd" 73 | } 74 | ``` 75 | 76 | ## Final Notes 77 | If you have any difficulties updating your resource pack, or even have the smallest questions, do not be afraid to ask for help on the [discord](https://discord.gg/9KsHkDE6u2)! -------------------------------------------------------------------------------- /docs/src/Home.md: -------------------------------------------------------------------------------- 1 | ![logo](https://raw.githubusercontent.com/fishcute/Celestial/main/modpage/logo.png) 2 | 3 | # This wiki is currently updated for version 1.3.5, which is NOT the latest version. It will be updated in the following days! 4 | 5 | A Minecraft mod for Fabric and Forge that allows you to customize the sky. 6 | 7 | If you find anything missing or incorrect, please create an issue or ping me on the discord. 8 | 9 | *** 10 | 11 | Celestial uses resource packs to customize the sky. 12 | 13 | Celestial can be reloaded using F3-T, or by using the reload keybind, which is by default F10 (This will not reload textures. In order to apply changes to textures, use F3-T). 14 | 15 | *** 16 | 17 | This will go over how to create your own resource pack for Celestial. 18 | 19 | [Creating the `dimension.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#dimensionsjson) 20 | 21 | [Adding dimension entries](https://github.com/fishcute/Celestial/wiki/Dimension-Entry) 22 | 23 | [Creating the `sky.json` for a dimension](https://github.com/fishcute/Celestial/wiki/JSON-Files#skyjson) 24 | 25 | [Changing sky colors, fog, and cloud details](https://github.com/fishcute/Celestial/wiki/Environment-Details) 26 | 27 | [Adding an object in the sky](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry) 28 | 29 | [Populating the sky with multiple objects](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#populate) 30 | 31 | [Creating a skybox](https://github.com/fishcute/Celestial/wiki/Skybox-Objects) 32 | 33 | [Adding custom variables](https://github.com/fishcute/Celestial/wiki/Custom-Variables) 34 | 35 | [Improving performance](https://github.com/fishcute/Celestial/wiki/Improving-Performance) 36 | 37 | All files for Celestial must be located in `assets\celestial\sky` 38 | 39 | *** 40 | 41 | ## Entry types: 42 | 43 | When looking at this wiki, you might see a list of entries. Entry types are the italicized text in the list entries. 44 | 45 | This will go over what each entry type is. 46 | 47 | ### String 48 | A character, or text. 49 | 50 | Example: 51 | 52 | ``` 53 | "type": "skybox" 54 | ``` 55 | ### Boolean 56 | A true or false value. 57 | 58 | Example: 59 | 60 | ``` 61 | "has_moon_phases": true 62 | ``` 63 | ### Integer 64 | A number without a decimal point. 65 | 66 | Example: 67 | 68 | ``` 69 | "update_frequency" : 20 70 | ``` 71 | ### Double 72 | A number with a decimal point. 73 | 74 | Example: 75 | 76 | ``` 77 | "min_scale": 10.5 78 | ``` 79 | ### String list 80 | A list of strings/text. Holds multiple values. 81 | 82 | Example: 83 | ``` 84 | "dimensions": [ 85 | "overworld", 86 | "the_end" 87 | ] 88 | ``` 89 | ### JSON Object 90 | A json element. There will usually be an explanation available as to how the JSON object should be formatted. 91 | 92 | Example: 93 | ``` 94 | "skybox": { 95 | "texture": "celestial:sky/overworld/objects/skybox_texture.png", 96 | "uv_size": "16", 97 | "texture_width": "48", 98 | "texture_height": "32" 99 | } 100 | ``` 101 | ### JSON Object List 102 | A list of JSON objects. There will usually be an explanation available as to how the list should be formatted. Holds multiple values. 103 | 104 | Example: 105 | ``` 106 | "colors": [ 107 | { 108 | "color": "ff0000", 109 | "alpha": "1 - #dayLight" 110 | }, 111 | { 112 | "color": "0800ff", 113 | "alpha": "#isHolding(stone)" 114 | } 115 | ] 116 | ``` 117 | ### Equation 118 | Can be entered as a double or a string. If entered as a string, it will be solved as a math equation. [[More Details]](https://github.com/fishcute/Celestial/wiki/Equations) 119 | 120 | Examples: 121 | ``` 122 | "scale": "(#dayLight + 10) / 2" 123 | ``` 124 | Or... 125 | ``` 126 | "scale": 10.0 127 | ``` 128 | 129 | ### Color Entry 130 | Can be entered as a string, or a JSON object. If entered as a string, value must be a HEX color code. [[More Details]](https://github.com/fishcute/Celestial/wiki/Color-Entry) 131 | 132 | Examples: 133 | ``` 134 | "sky_color": "#ffffff" 135 | ``` 136 | Or... 137 | ``` 138 | "sky_color": "00ffff" 139 | ``` 140 | Or... 141 | ``` 142 | "sky_color": { 143 | "update_frequency": 0, 144 | "base_color": "#ffffff", 145 | "colors": [{ 146 | "color": "0000ff", 147 | "alpha": "#dayLight" 148 | } 149 | ] 150 | } 151 | ``` 152 | ### File Path 153 | The path to a texture file. Should include a namespace at the start. 154 | 155 | Example: 156 | ``` 157 | "texture": "minecraft:textures/block/diamond_block.png" 158 | ``` 159 | 160 | *** 161 | 162 | ## Outdated Wiki Pages: 163 | 164 | [Changing star details (1.0.1-)](https://github.com/fishcute/Celestial/wiki/%5BRemoved%5D-Star-Details) 165 | 166 | Why this was removed: In versions above 1.0.1, stars can be created using [celestial objects](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry). 167 | 168 | [Sky render types (1.2-)](https://github.com/fishcute/Celestial/wiki/%5BRemoved%5D-Sky-Render-Type) 169 | 170 | Why this was removed: In versions above 1.2, [skybox objects](https://github.com/fishcute/Celestial/wiki/Skybox-Objects) can now be created. 171 | 172 | *** 173 | 174 | Download the template resource pack [here](https://github.com/fishcute/Celestial/raw/forgefabric-1.2-1.19/TemplateResourcePack1.2.zip) 175 | 176 | The template resource pack includes all vanilla features (Nothing should appear different), and allows for them to be customized or removed. 177 | 178 | Confused, or don't know what to do? [Check out the demo packs](https://www.curseforge.com/minecraft/texture-packs/celestial-demo-packs) 179 | 180 | If you need assistance, or have a question about something, feel free to [ask on the discord](https://discord.gg/9KsHkDE6u2). -------------------------------------------------------------------------------- /docs/src/Skybox-Objects.md: -------------------------------------------------------------------------------- 1 | Skybox celestial objects allow you to create skyboxes easily. 2 | 3 | *** 4 | 5 | Skybox objects are [celestial objects](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry) that have their `type` value set to `skybox`. 6 | 7 | It is possible to make a skybox without using this method, but this method is probably more efficient for performance and effort. 8 | 9 | Skybox data is stored in the `skybox` entry in [celestial object entries](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry). 10 | 11 | Skybox objects will use all default [celestial object](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry) properties except for rotation, position (These may change in a future update), vertex, and population. Skyboxes will also use the `solid_color` entry if it is present, and if there are no given textures. 12 | 13 | There are two types of skyboxes: 14 | 15 | - Simple skyboxes: All sides of the skybox use a single texture. [[More Info]](https://github.com/fishcute/Celestial/wiki/Skybox-Objects#simple-skyboxes) 16 | - Complex skyboxes: Sides can have different textures, UV mappings, or can be missing. [[More Info]](https://github.com/fishcute/Celestial/wiki/Skybox-Objects#complex-skyboxes) 17 | 18 | The scale of skybox objects are still controlled by the `scale` value in `display`. 19 | 20 | ## Simple Skyboxes 21 | Simple skyboxes allow for a low amount of customization, but can be very simple to create. 22 | 23 | *** 24 | 25 | ### Entries: 26 | - `texture`, _File path_: The texture of the skybox. If this entry does not exist, it will attempt to get the texture from the celestial object `texture` entry instead. 27 | - `uv_size`, _Equation_: The size of the UV of each side on the skybox. 28 | - `texture_width`, _Equation_: (Optional) The width (in pixels) of the entire texture (Not the width of the side UV). Should be the UV size multiplied by 3. 29 | - `texture_height`, _Equation_: (Optional) The height (in pixels) of the entire texture (Not the height of the side UV). Should be the UV size multiplied by 2. 30 | 31 | If the `texture_width` and `texture_height` values are not defined, they will automatically be set to the texture width and height. 32 | 33 | Each section of the texture corresponds to a side of the skybox. 34 | 35 | Simple skybox textures are formatted like below: 36 | 37 | ![simpleskybox](https://user-images.githubusercontent.com/47741160/196559281-91c980ff-6c78-4aab-9949-8fb148fe97dd.png) 38 | 39 | Example: 40 | ``` 41 | "skybox": { 42 | "texture": "celestial:sky/overworld/objects/skybox_texture.png", 43 | "uv_size": "16", 44 | "texture_width": "48", 45 | "texture_height": "32" 46 | } 47 | ``` 48 | 49 | This would render a skybox that has a 48x32 texture, with each side's UV being 16x16. 50 | 51 | ## Complex Skyboxes 52 | Complex skyboxes can be more complicated to make, as one might assume from the name. 53 | 54 | *** 55 | 56 | In order to make a skybox a complex skybox, it must have a `sides` entry. 57 | 58 | ### Entries: 59 | - `texture`, _File path_: The texture of the skybox (Optional). 60 | - `texture_width`, _Equation_: (Optional) The width of the entire texture. 61 | - `texture_height`, _Equation_: (Optional) The height of the entire texture. 62 | - `sides`, _JSON Object list_: The list of the faces of the skybox [[More Details]](https://github.com/fishcute/Celestial/wiki/Skybox-Objects#skybox-face). 63 | 64 | The name of the JSON element must be the ID of the side the element corresponds to. 65 | 66 | Below shows which ID corresponds to which side: 67 | - `0`: Bottom 68 | - `1`: North 69 | - `2`: South 70 | - `3`: Up 71 | - `4`: East 72 | - `5`: West 73 | 74 | Example: 75 | ``` 76 | "skybox": { 77 | "texture": "minecraft:textures/block/stone.png", 78 | "texture_width": "16", 79 | "texture_height": "16", 80 | "sides": { 81 | "0": { 82 | "uv_x": "0", 83 | "uv_y": "0", 84 | "uv_width": "16", 85 | "uv_height": "16" 86 | }, 87 | "1": { 88 | "texture": "minecraft:textures/block/bricks.png", 89 | "uv_x": "0", 90 | "uv_y": "0", 91 | "uv_width": "8", 92 | "uv_height": "8" 93 | } 94 | } 95 | } 96 | ``` 97 | This would render the bottom side of the skybox as the stone texture, and the northern side as the brick texture. 98 | 99 | ## Skybox Face 100 | The sides of a complex skybox. Can have a different texture to the main skybox, and is more customizable. 101 | 102 | *** 103 | 104 | A skybox face can either be for individual faces, or for every single face of the skybox. 105 | 106 | If the UV width or height are greater than the size of the texture, the texture will repeat. For example, if you had a 8x8 skybox texture and set the UV width and height to 32, the face will be rendered as a 4x4 grid of that texture. 107 | 108 | All faces of the skybox must have the same texture dimensions. 109 | 110 | ### Entries: 111 | - `texture`, _File path_: The texture of the skybox face. If this is not present, the texture value from the skybox entry will be used. 112 | - `uv_x`, _Equation_: The X starting point of the UV. 113 | - `uv_y`, _Equation_: The Y starting point of the UV. 114 | - `uv_width`, _Equation_: The width of the UV. 115 | - `uv_height`, _Equation_: The height of the UV. 116 | 117 | Skybox face ID numbers go from 0 to 5. 118 | 119 | Skybox faces are formatted like this: 120 | ``` 121 | "0": { 122 | ... 123 | }, 124 | "1": { 125 | ... 126 | }, 127 | "2": { 128 | ... 129 | }, 130 | "3": { 131 | ... 132 | }, 133 | "4": { 134 | ... 135 | }, 136 | "5": { 137 | ... 138 | } 139 | ``` 140 | 141 | Skybox faces can also be formatted like this to apply to every face: 142 | ``` 143 | "all": { 144 | ... 145 | } 146 | ``` 147 | 148 | If any UV x starting point, y starting point, width, or height is less than 0, the face will not be rendered. 149 | 150 | Example Skybox Face: 151 | ``` 152 | "all": { 153 | "texture": "minecraft:textures/item/egg.png", 154 | "uv_x": "0", 155 | "uv_y": "0", 156 | "uv_width": "16", 157 | "uv_height": "16" 158 | } 159 | ``` 160 | This would render the minecraft egg texture on all sides of a skybox. 161 | 162 | It might just be eggsactly what you need. -------------------------------------------------------------------------------- /docs/src/Custom-Variables.md: -------------------------------------------------------------------------------- 1 | Custom variables allow you to decrease the number of calculations made, and make things look cleaner. 2 | 3 | Custom variables can also be used to perform [special functions](https://github.com/fishcute/Celestial/wiki/Custom-Variables#variables-with-different-functions). 4 | 5 | *** 6 | 7 | Custom variables can be registered in [`variables.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#variablesjson). 8 | In this JSON file, you can register custom variables that you can use in equations. 9 | 10 | ### Entries: 11 | - `variables`, _JSON Object list_: The list of [variables](https://github.com/fishcute/Celestial/wiki/Custom-Variables#variable) to register 12 | 13 | Example: 14 | ``` 15 | "variables": [ 16 | { 17 | "name": "variableA", 18 | "value": "#skyAngle / 2" 19 | }, 20 | { 21 | "name": "isUsingRangedWeapon", 22 | "value": "(#isUsing(bow) | #isUsing(crossbow)) | #isUsing(trident)" 23 | }, 24 | { 25 | "name": "incrementValue", 26 | "value": "#incrementValue + 1", 27 | "update_frequency": 20 28 | } 29 | ] 30 | ``` 31 | This will create three variables. 32 | - The first variable is named "variableA", and it will return the angle of the sky divided by two. 33 | - The second variable is named "isUsingRangedWeapon", and will return whether or not the player is using a bow, a crossbow, or a trident. 34 | - The third variable is named "incrementValue", and every second it will increment its value by 1. 35 | 36 | ## Variable 37 | 38 | Allows you to store values and make equations look more organized. 39 | 40 | *** 41 | 42 | Variables will only be updated once per tick (unless the update_frequency value is greater than 0, then it will be updated after a number of ticks have passed). 43 | 44 | Variables can be registered in the `variables` list. 45 | 46 | [Pre-existing variables](https://github.com/fishcute/Celestial/wiki/Equations#variables) cannot be overridden. If a variable is named after a pre-existing variable, it will return the value of the pre-existing variable. 47 | 48 | ### Entries: 49 | - `name`, _String_: The name of the variable. Does not need to include a # at the start. Example: If the variable name is "getObjectAlpha", the usable variable will be named "#getObjectAlpha". 50 | - `value`, _Equation_: The value of the variable. Can include other custom variables and itself. 51 | - `update_frequency`, _Integer_: How often the value of the variable will be updated (Higher values will make the variable update less frequently, but will improve performance). 52 | 53 | ### Incremental Values 54 | Custom variables can have an incremental value. This can be achieved by including a variable in it's own value. 55 | 56 | As an example, say we have a variable named "moonRotation". In order to make this variable have an incremental value, the variable must be included in it's own value along with another value to be incremented by. 57 | 58 | ``` 59 | { 60 | "name": "moonRotation", 61 | "value": "#moonRotation + 1" 62 | } 63 | ``` 64 | 65 | Every tick, moonRotation will be incremented by 1. How often this variable is incremented by can be changed using `update_frequency`. 66 | 67 | ``` 68 | { 69 | "name": "moonRotation", 70 | "value": "#moonRotation + 1", 71 | "update_frequency": 20 72 | } 73 | ``` 74 | 75 | Now this variable will only be updated every second. 76 | 77 | If we wanted to add this value to another value, say "#skyAngle", we would not change moonRotation. Instead, we would want to create a new variable like this: 78 | ``` 79 | { 80 | "name": "moonRotationAngle", 81 | "value": "#moonRotation + #skyAngle" 82 | } 83 | ``` 84 | 85 | If we were to add #skyAngle to the value of moonRotation, then the value of that variable would increment by the value of #skyAngle. With this variable above, it will not affect moonRotation, and both values will be added on to each other. 86 | 87 | When a resource pack reload occurs, the value of the variable will get reset to its original value. 88 | 89 | ### Variables with Different Functions 90 | 91 | Below is a list of different variables that can be used to perform useful functions. Multiple can be combined to perform specific functions. 92 | 93 | In all these examples: 94 | - `#this` is referring to the variable itself. 95 | - `#condition` is referring to a condition (Ex. `#isUsing(minecraft:spyglass)`) 96 | - `#deactivationCondition` is referring to the condition that will reset the trigger when active (Only for trigger variables). 97 | 98 | All these examples assume that any condition variable will return either 0 or 1. 99 | 100 | 101 | **Trigger Variable:** Remains at 1 once a condition is met, and will reset to 0 when a different condition is met. 102 | 103 | `((#this + #condition)m1) * (1 - #deactivationCondition)` 104 | 105 | **Conditional Increment Variable:** Increments while a condition is met. 106 | 107 | `(#this + ([Increment Amount] * #condition))` 108 | 109 | **Conditional Reset Increment Variable:** Increments until a condition is met, then resets to 0. 110 | 111 | `(#this + [Increment Amount]) * (1 - #condition)` 112 | 113 | **Capped Increment Variable:** Increments until the variable reaches a value, then resets to 0. Similar to Conditional Reset Increment Variables. 114 | 115 | `(#this + [Increment Amount]) * (#this < [Variable Cap])` 116 | 117 | **Toggle Variable:** Toggles between 1 and 0 when a condition is met. Note: This variable will continuously toggle while the condition is met. Using a Single Time Trigger Variable for a condition is recommended. 118 | 119 | `#this + ((#condition = 1) * 1 * (((#this = 1) * -1) + ((#this = 0) * 1)))` 120 | 121 | **Single Time Trigger Variable:** Stays active for one update tick when a condition is met, then remains at 2 until a different condition is met. 122 | 123 | `((#this + (#condition * (#this = 0)) + (1 * (#this = 1))) * (1 - (#deactivationCondition = 1))M(0))m2` 124 | 125 | **Percent Chance Variable**: Returns 1 or 0 depending on a percent chance (Out of 100). 126 | 127 | `#random < ([Percent Chance] / 100)` 128 | 129 | **Goal Variable**: Increases/decreases by 1 every update tick until it reaches a goal number. Goal number must be a whole number. 130 | 131 | `#this + ((#this) > ([Goal Number]) * -1) + ((#this) < ([Goal Number]) * 1)` 132 | 133 | **Conditional Value Change Variable**: Sets the value of a variable when a condition is met. 134 | 135 | `#this * (1 - #condition) + ([New Value] * #condition)` 136 | 137 | ### Conditions 138 | 139 | Conditions that return either 1 or 0. 140 | 141 | **Not Condition** Returns 1 if `#a` is not equal to 1 142 | 143 | `1 - #a` 144 | 145 | **Greater Than Condition**: Returns 1 if `#a` is greater than `#b` 146 | 147 | `(#a) > (#b)` 148 | 149 | **Less Than Condition**: Returns 1 if `#a` is less than `#b` 150 | 151 | `(#a) < (#b)` 152 | 153 | **Equals Condition**: Returns 1 if `#a` is equal to `#b` 154 | 155 | `(#a) = (#b)` 156 | 157 | **Greater Than or Equal to Condition**: Returns 1 if `#a` is greater than or equal to `#b` 158 | 159 | `((#a) > (#b)) | ((#a) = (#b))` 160 | 161 | **Less Than or Equal to Condition**: Returns 1 if `#a` is less than or equal to `#b` 162 | 163 | `((#a) < (#b)) | ((#a) = (#b))` 164 | 165 | **And Condition**: Returns 1 if `#a` and `#b` are both equal to 1. (Note: There is currently an issue with this condition, and any other conditions that use this condition) 166 | 167 | `(#a) & (#b)` 168 | 169 | Alternative: 170 | 171 | `(#a) * (#b)` 172 | 173 | **Or Condition**: Returns 1 if `#a` or `#b` are equal to 1. 174 | 175 | `(#a) | (#b)` 176 | 177 | **XOr Condition**: Returns 1 if `#a` or `#b` are equal to 1, but not if both are equal to 1. 178 | 179 | `((#a) | (#b)) - ((#a) & (#b))` 180 | -------------------------------------------------------------------------------- /docs/src/Celestial-Object-Entry.md: -------------------------------------------------------------------------------- 1 | Celestial Objects can be registered in [`sky.json`](https://github.com/fishcute/Celestial/wiki/JSON-Files#skyjson) 2 | 3 | *** 4 | 5 | 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. 6 | 7 | If an object is located in a folder within the `objects` folder, the object's registration ID must start with the folder name. 8 | 9 | Examples: 10 | 11 | `assets/celestial/sky/overworld/objects/moon.json`, Registration ID: `moon` 12 | 13 | `assets/celestial/sky/the_end/objects/folder/end_sun.json`, Registration ID: `folder/end_sun` 14 | 15 | Objects cannot have the same name (even if they are in different folders), otherwise they will be overridden. 16 | 17 | *** 18 | 19 | Celestial objects are things that are rendered in the sky. The vanilla sun and moon are examples of celestial objects. 20 | 21 | ### Entries: 22 | - `type`, _String_: The type of object the object is. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#object-types) 23 | - `texture`, _File path_: The file path to the texture of the object. If this value is present, and the `type` entry is empty, the object's [type](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#object-types) will automatically get set to `texture`. 24 | - `skybox`, _JSON Object_: Data for skybox rendering. Will only get read if the object's [type](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#object-types) is `skybox`. [[More details]](https://github.com/fishcute/Celestial/wiki/Skybox-Objects) 25 | - `solid_color`, _String_: Renders the object as a solid color (the color inputted here). If this value is present, and the `type` and `texture` entries are empty, the object's [type](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#object-types) will automatically get set to `color`. 26 | - `display`, _JSON Object_: Details for display. If `vertex` has a value, this will be ignored. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#display) 27 | - `vertex`, _String list_: Details for custom vertex rendering. [[More details]](https://github.com/fishcute/Celestial/wiki/Vertex-List) 28 | - `rotation`, _JSON Object_: Controls the rotation of the object. [[More details]](https://github.com/fishcute/Celestial/wiki/Rotation-Entry) 29 | - `properties`, _JSON Object_: Object properties. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#properties) 30 | - `populate`, _JSON Object_: Controls the populate feature for the object. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#populate) 31 | 32 | *** 33 | 34 | ## Display 35 | 36 | ### Entries: 37 | - `scale`, _Equation_: Scale of the object. 38 | - `pos_x`, _Equation_: Added position X of the object. 39 | - `pos_y`, _Equation_: Added position Y of the object. 40 | - `pos_z`, _Equation_: Added position Z of the object. 41 | - `distance`, _Equation_: Distance of the object to the camera. 42 | 43 | *** 44 | 45 | ## Object types 46 | 47 | ### `skybox`: 48 | Renders the object as a [skybox](https://github.com/fishcute/Celestial/wiki/Skybox-Objects). 49 | ### Entries: 50 | - `texture`, _String_: Texture of the skybox (Optional). 51 | 52 | ### `color`: 53 | Renders the object with a solid color. 54 | ### Entries: 55 | - `solid_color`: _Color Entry_: Color of the skybox. 56 | 57 | ### `texture`: 58 | Renders the object with a texture. 59 | ### Entries: 60 | - `texture`, _String_: Texture of the object. 61 | 62 | *** 63 | 64 | ## Properties 65 | 66 | Extra miscellaneous properties for objects 67 | 68 | ### Entries: 69 | - `has_moon_phases`, _Boolean_: Determines if the object has moon phases. Texture should be formatted like vanilla moon_phases texture. 70 | - `moon_phase`, _Equation_: The moon phase of the object. Only works if `has_moon_phase` is enabled. 71 | - `is_solid`, _Boolean_: Determines if other objects can render through the object. Removes alpha from the object too. 72 | - `red`, _Equation_: Amount of red in object texture. 73 | - `green`, _Equation_: Amount of green in object texture. 74 | - `blue`, _Equation_: Amount of blue in object texture. 75 | - `alpha`, _Equation_: Alpha of object. 76 | - `ignore_fog`, _Boolean_: Determines if the object should render with fog applied. 77 | 78 | If an object is a [populate object](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#populate), and has `per_object_calculations` enabled, the following variables may be used in equations: 79 | - #populateDegreesX: The rotation X added onto the populate object's rotation X. 80 | - #populateDegreesY: The rotation Y added onto the populate object's rotation Y. 81 | - #populateDegreesZ: The rotation Z added onto the populate object's rotation Z. 82 | - #populatePosX: The pos X added onto the populate object's pos X. 83 | - #populatePosY: The pos Y added onto the populate object's pos Y. 84 | - #populatePosZ: The pos Z added onto the populate object's pos Z. 85 | - #populateDistance: The distance added onto the populate object's distance. 86 | - #populateScale: The scale added onto the populate object's scale. 87 | - #populateId: The populate object number (Will be from 0 to the `count` of populate objects). 88 | 89 | *** 90 | 91 | # Populate 92 | 93 | Allows for multiple duplicate objects to be rendered in different places, scales, and rotations. If enabled, the `display` and `rotation` categories will be ignored. 94 | Populate objects cannot be a skybox. 95 | 96 | ### Entries: 97 | - `count`, _Integer_: Number of objects to create. 98 | - `rotation`, _JSON Object_: Rotation of objects in sky. Unlike normal rotation entries, this has different possible values. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#rotation-populate) 99 | - `display`, _JSON Object_: Controls what the objects will look like. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#display-populate) 100 | - `objects`, _JSON Object List_: Allows for the creation of populate objects with specified values. [[More details]](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#objects-populate) 101 | - `per_object_calculations`: Determines if the rotation, position, etc. are calculated for each populate object. 102 | 103 | *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.* 104 | 105 | ## Rotation (Populate) 106 | 107 | Values from the original `rotation` category will be added onto these values. 108 | 109 | ### Entries: 110 | - `min_degrees_x`, _Float_: The minimum degrees X objects can have. 111 | - `max_degrees_x`, _Float_: The minimum degrees X objects can have. 112 | - `min_degrees_y`, _Float_: The minimum degrees Y objects can have. 113 | - `max_degrees_y`, _Float_: The minimum degrees Y objects can have. 114 | - `min_degrees_z`, _Float_: The minimum degrees Z objects can have. 115 | - `max_degrees_z`, _Float_: The minimum degrees Z objects can have. 116 | 117 | ## Display (Populate) 118 | 119 | ### Entries: 120 | - `min_scale`, _Float_: The minimum scale objects can have. 121 | - `max_scale`, _Float_: The maximum scale objects can have. 122 | - `min_pos_x`, _Float_: The minimum added position X the object can have. 123 | - `max_pos_x`, _Float_: The maximum added position X the object can have. 124 | - `min_pos_y`, _Float_: The minimum added position Y the object can have. 125 | - `max_pos_y`, _Float_: The maximum added position Y the object can have. 126 | - `min_pos_z`, _Float_: The minimum added position Z the object can have. 127 | - `max_pos_z`, _Float_: The maximum added position Z the object can have. 128 | - `min_distance`, _Float_: The minimum distance to the camera the object can have. 129 | - `max_distance`, _Float_: The maximum distance to the camera the object can have. 130 | 131 | ## Objects (Populate) 132 | 133 | The object list is a JSON Object list. Contains [populate object entries](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#populate-object-entry-populate). 134 | 135 | Will be added on to existing populate objects created using the default populate object creation system. 136 | 137 | Example: 138 | 139 | ``` 140 | { 141 | "populate": { 142 | "objects": [{ 143 | "degrees_x": 0, 144 | "degrees_y": 0, 145 | "degrees_z": 0, 146 | "scale": 0 147 | }, 148 | { 149 | "degrees_x": 30, 150 | "degrees_y": 0, 151 | "degrees_z": 30, 152 | "scale": 10 153 | } 154 | ] 155 | } 156 | } 157 | ``` 158 | 159 | ## Populate object entry (Populate) 160 | 161 | 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](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#rotation-populate) and the [populate display entries](https://github.com/fishcute/Celestial/wiki/Celestial-Object-Entry#display-populate). 162 | 163 | ### Entries: 164 | - `scale`, _Float_: The scale of the populate object 165 | - `pos_x`, _Float_: The X position of the populate object. 166 | - `pos_y`, _Float_: The Y position of the populate object. 167 | - `pos_z`, _Float_: The Z position of the populate object. 168 | - `degrees_x`, _Float_: The X rotation of the populate object. 169 | - `degrees_y`, _Float_: The Y rotation of the populate object. 170 | - `degrees_z`, _Float_: The Z rotation of the populate object. 171 | - `distance`, _Float_: The distance of the populate object. 172 | 173 | Example: 174 | ``` 175 | { 176 | "pos_x": 0, 177 | "pos_y": 0, 178 | "pos_z": 0, 179 | "degrees_x": 45, 180 | "degrees_y": 0, 181 | "degrees_z": 0, 182 | "scale": 0 183 | } 184 | ``` -------------------------------------------------------------------------------- /docs/src/Equations.md: -------------------------------------------------------------------------------- 1 | Some entries for various things accept Equation values. This will go over what can be done with equations. 2 | 3 | *** 4 | 5 | Equations are strings that will be parsed into numbers. Equations can also be parsed as doubles. 6 | 7 | Some examples of equations: 8 | 9 | `"scale": "#yPos / 4"` 10 | 11 | `"alpha": "#isUsing(minecraft:spyglass) | #isUsing(minecraft:glass)"` 12 | 13 | `"distance": "print(10 * #dayLight)"` 14 | 15 | `"pos_x": 5` 16 | 17 | Equations must be written as strings to use functions, variables, and mathematical expressions 18 | 19 | ## Functions 20 | 21 | Currently, equations support a variety of math functions: 22 | - sqrt(): Returns the square root of a number. 23 | - sin(): Sine (Value is converted to radians) 24 | - cos(): Cosine (Value is converted to radians) 25 | - tan(): Tangent (Value is converted to radians) 26 | - floor(): Rounds down a number to the closest integer. 27 | - ceil(): Rounds up a number to the closest integer. 28 | - round(): Rounds a number to the closest integer. 29 | - abs(): Returns the absolute value of a number. 30 | - radians(): Returns an angle converted to radians. 31 | - arcsin(): Arcsine (Value is converted to radians) 32 | - arccos(): Arccosine (Value is converted to radians) 33 | - arctan(): Arctangent (Value is converted to radians) 34 | - print(): Sends an actionbar message with whatever value is in the parenthesis, and returns the value too. 35 | - printnv(): Sends an actionbar message with whatever value is in the parenthesis, but returns a value of 0. 36 | - (a)^(b): Returns (a) to the power of (b). 37 | - (a)m(b): Returns the smallest number. (Will be deprecated soon) 38 | - (a)M(b): Returns the largest number. (Will be deprecated soon) 39 | - (a)&(b): Returns 1 if a and b are equal to 1. Returns 0 if not. 40 | - (a)|(b): Returns 1 if a or b are equal to 1. Returns 0 if not. 41 | - (a)=(b): Returns 1 if a and b are equal to each other. Returns 0 if not. 42 | - (a)>(b): Returns 1 if a is greater than b. Returns 0 if not. 43 | - (a)<(b): Returns 1 if a is less than b. Returns 0 if not. 44 | 45 | ## Variables 46 | 47 | Equations also have some variables that can be used. 48 | 49 | ### Player Variables 50 | - #xPos: X position of the player 51 | - #yPos: Y position of the player 52 | - #zPos: Z position of the player 53 | - #headYaw: Yaw of the player's head (-180° to 180°). 54 | - #headPitch: Pitch of the player's head (-180° to 180°). 55 | - #isLeftClicking: Returns 1 if the player is holding left-click. Returns 0 if not. 56 | - #isRightClicking: Returns 1 if the player is holding right-click. Returns 0 if not. 57 | - #isSubmerged: Checks if the player is submerged in water. Returns 1 if true, and 0 if false. 58 | - [#isUsing(...)](https://github.com/fishcute/Celestial/wiki/Equations#isusingitem): Checks if the player is right-clicking with an item (Does not work with offhand yet). Returns 1 if true, and 0 if false. 59 | - [#isHolding(...)](https://github.com/fishcute/Celestial/wiki/Equations#isholdingitem): Checks if the player is holding an item (Does not work with offhand yet). Returns 1 if true, and 0 if false. 60 | - [#isMiningWith(...)](https://github.com/fishcute/Celestial/wiki/Equations#isminingwithitem): Checks if the player is left-clicking with an item (Does not work with offhand yet). Returns 1 if true, and 0 if false. 61 | - [#distanceTo(...)](https://github.com/fishcute/Celestial/wiki/Equations#distancetox-y-z): Returns the distance from the player to a coordinate. 62 | - [#isInArea(...)](https://github.com/fishcute/Celestial/wiki/Equations#isinareax1-y1-z1-x2-y2-z2): Returns 1 if the player is within an area defined by two coordinate points. Returns 0 if not. 63 | - [#distanceToArea(...)](https://github.com/fishcute/Celestial/wiki/Equations#distancetoareax1-y1-z1-x2-y2-z2). Returns the distance from the player to the edge of an area. 64 | 65 | ### World Variables 66 | - #dayLight: Gets the daylight of the world. 67 | - #starAlpha: Gets the brightness of stars. 68 | - #rainGradient: How faded in precipitation is. 69 | - #getGameTime: Gets the total time of the game instance. 70 | - #getWorldTime: Gets the total time of the world. 71 | - #getDayTime: Gets the time of the day. 72 | - #moonPhase: Returns the phase of the moon. 73 | - #skyDarken: Returns the sky darken modifier. 74 | - #lightningFlashTime: Returns the duration of the lightning flash effect. 75 | - #thunderGradient: How faded in thunder is. 76 | - #twilightAlpha: Returns how faded in the twilight effect is. 77 | - #skyAngle: Angle of the sky (Max angle is 360°). 78 | - #biomeTemperature: Returns the [temperature](https://minecraft.wiki/w/Biome#Temperature) of the player's current biome. 79 | - #biomeDownfall: Returns the [downfall](https://minecraft.wiki/w/Biome#Downfall) of the player's current biome. 80 | - #biomeHasSnow: Returns 1 if it can snow in the player's current biome. Returns 0 if not. 81 | - [#isInBiome(...)](https://github.com/fishcute/Celestial/wiki/Equations#isinbiomebiome): Returns 1 if the biome at the player's location is equal to the biome provided. Returns 0 if not. 82 | - [#distanceToBiome(...)](https://github.com/fishcute/Celestial/wiki/Equations#distancetobiomebiome-optional-searchradius) Returns the distance to the nearest provided biome (Within render distance). Does a three-dimensional search. 83 | - [#distanceToBiomeIgnoreY(...)](https://github.com/fishcute/Celestial/wiki/Equations#distancetobiomeignoreybiome-optional-searchradius-optional-ylevel) Returns the distance to the nearest provided biome (Within render distance). Does a two-dimensional search (Better for performance). 84 | 85 | ### Math Variables 86 | - #maxInteger: Returns the maximum integer possible. 87 | - #pi: Returns the value of pi. 88 | - #random: Returns a random double from 0 to 1. 89 | 90 | ### Real World Variables 91 | - #localDayOfYear: Returns the local day of the year (Out of 365 days). 92 | - #localDayOfMonth: Returns the local day of the month (Out of 28 to 31 days). 93 | - #localDayOfWeek: Returns the local day of the week (Out of 7 days). 94 | - #localMonth: Returns the local month of the year (Out of 12 months). 95 | - #localYear: Returns the local year. 96 | - #localSecondOfHour: Returns the local second of the hour (Out of 3600). 97 | - #localMinuteOfHour: Returns the local minute of the hour (Out of 60). 98 | - #localSecondOfDay: Returns the local second of the day (Out of 86400). 99 | - #localMinuteOfDay: Returns the local minute of the day (Out of 1440). 100 | - #localHour: Returns the local hour of the day (Out of 24). 101 | 102 | ### Other Variables 103 | - #tickDelta: Gets the tick delta. 104 | 105 | 106 | Some equations can also have unique variables for their own cases. 107 | 108 | ## Special variables 109 | Unlike normal variables, special variables accept arguments that will determine the value of the variable. 110 | *** 111 | 112 | ### #isUsing(item) 113 | 114 | Checks if the player is holding right-click with an item. Returns 1 if true, and returns 0 if false. 115 | 116 | This variable must have an item ID in the parentheses. A namespace can be included (minecraft:), and items from other mods can be used. 117 | 118 | Examples: 119 | - #isUsing(minecraft:spyglass) 120 | - #isUsing(stick) 121 | - #isUsing(botania:tiny_potato) 122 | 123 | *** 124 | 125 | ### #isHolding(item): 126 | 127 | Checks if the player is holding an item. Returns 1 if true, and returns 0 if false. 128 | 129 | This variable must have an item ID in the parentheses. A namespace can be included (minecraft:), and items from other mods can be used. 130 | 131 | Examples: 132 | 133 | - #isHolding(minecraft:air) 134 | - #isHolding(diamond_sword) 135 | 136 | *** 137 | 138 | ### #isMiningWith(item): 139 | 140 | Checks if the player is holding left-click with an item. Returns 1 if true, and returns 0 if false. 141 | 142 | This variable must have an item ID in the parentheses. A namespace can be included (minecraft:), and items from other mods can be used. 143 | 144 | Examples: 145 | 146 | - #isMiningWith(diamond_pickaxe) 147 | - #isMiningWith(mekanism:atomic_disassembler) 148 | 149 | *** 150 | 151 | ### #distanceTo(x, y, z): 152 | 153 | Returns the distance (in blocks) to a point of coordinates. 154 | 155 | This variable must have three numbers in the parentheses. 156 | 157 | Examples: 158 | 159 | - #distanceTo(0, 0, 0) 160 | - #distanceTo(1000.0, 126, 15.5) 161 | 162 | *** 163 | 164 | ### #isInArea(x1, y1, z1, x2, y2, z2): 165 | 166 | Returns if the player is inside of a cube area. Returns 1 if true, and returns 0 if false. 167 | 168 | This variable must have six numbers in the parentheses. 169 | 170 | Examples: 171 | 172 | - #isInArea(-1, -1, -1, 1, 1, 1) 173 | - #isInArea(-500, -64, -500, 500, 319, 500) 174 | 175 | *** 176 | 177 | ### #distanceToArea(x1, y1, z1, x2, y2, z2): 178 | 179 | Returns the distance (in blocks) a player is to a cube area. 180 | 181 | This variable must have six numbers in the parentheses. 182 | 183 | Examples: 184 | 185 | - #distanceToArea(-500, -1, -500, 0, 1, 0) 186 | - #distanceToArea(-2.5, -2.5, -2.5, 2.5, 2.5, 2.5) 187 | 188 | *** 189 | 190 | ### #isInBiome(biome): 191 | 192 | Returns 1 if the player is in the biome provided, and 0 if not. 193 | 194 | This variable must have a biome name in the parentheses. A namespace can be included, and biomes from other mods can be used. 195 | 196 | Examples: 197 | 198 | - #isInBiome(plains) 199 | - #isInBiome(twilightforest:thornlands) 200 | 201 | *** 202 | ### #distanceToBiome(biome, (Optional) searchRadius) 203 | 204 | Returns how near the player is to a biome (Returns a value from 0 to 1). 205 | 206 | This variable must have a biome name in the parentheses, but the second argument, searchRadius, is optional (Default is 6). A namespace for the biome argument can be included, and biomes from other mods can be used. 207 | 208 | searchRadius determines the radius of the check. If this number is set to 3, it will search in a diameter of 6 blocks. 209 | 210 | The search will also be done in a three dimensional area, which can makes this function quite memory intensive when searching large areas. For example, if the search radius is 16, it will search in a `32^3` area, or `32*32*32`, which is equal to 32768 blocks. As the search radius increases, this number will also increase. 211 | 212 | For search radiuses above 15 blocks, it is **strongly** recommended to use the [#distanceToBiomeIgnoreY](https://github.com/fishcute/Celestial/wiki/Equations#distancetobiomeignoreybiome-optional-searchradius-optional-ylevel) variable. 213 | 214 | Examples: 215 | - #distanceToBiome(minecraft:desert) 216 | - #distanceToBiome(byg:frosted_taiga, 3) 217 | 218 | *** 219 | ### #distanceToBiomeIgnoreY(biome, (Optional) searchRadius, (Optional) yLevel) 220 | 221 | Returns how near the player is to a biome (Returns a value from 0 to 1), using a set Y level. 222 | 223 | This variable must have a biome name in the parentheses, but the second and third arguments, searchRadius and yLevel, are optional. By default, the searchRadius is 6, and yLevel is the player's Y level. A namespace for the biome argument can be included, and biomes from other mods can be used. 224 | 225 | searchRadius determines the radius of the check. If this number is set to 3, it will search in a diameter of 6 blocks. 226 | 227 | This variable only does a two dimensional search, but is significantly better for performance when having larger search areas. If the radius is set to 20, the amount of blocks searched will be equal to `40^2`, or `40*40`, which is equal to 1600. 228 | 229 | Can effectively search with radiuses up to 110. 230 | 231 | Examples: 232 | - #distanceToBiomeIgnoreY(river) 233 | - #distanceToBiomeIgnoreY(minecraft:ocean, 60) 234 | - #distanceToBiomeIgnoreY(minecraft:beach, 20, 80) 235 | 236 | --------------------------------------------------------------------------------