Fix docs format

[no changelog]
This commit is contained in:
Linnea Gräf
2024-10-18 20:31:13 +02:00
parent 850d42dbca
commit c42bfa6151

View File

@@ -12,8 +12,7 @@ Find the internal id of the item. This is usually stored in the ExtraAttributes
keybinds). Once you found it, create an item model in a resource pack like you would for keybinds). Once you found it, create an item model in a resource pack like you would for
a vanilla item model, but at the coordinate `firmskyblock:<internalid>`. So for an aspect of the end, this would be a vanilla item model, but at the coordinate `firmskyblock:<internalid>`. So for an aspect of the end, this would be
`firmskyblock:models/item/aspect_of_the_end.json` (or `assets/firmskyblock/models/item/aspect_of_the_end.json`). Then, `firmskyblock:models/item/aspect_of_the_end.json` (or `assets/firmskyblock/models/item/aspect_of_the_end.json`). Then,
just use a normal minecraft item model. just use a normal minecraft item model. See https://github.com/romangraef/BadSkyblockTP/blob/master/assets/firmskyblock/models/item/magma_rod.json
See https://github.com/romangraef/BadSkyblockTP/blob/master/assets/firmskyblock/models/item/magma_rod.json
as an example. as an example.
## (Placed) Skulls by texture id ## (Placed) Skulls by texture id
@@ -33,21 +32,18 @@ head model.
```json5 ```json5
{ {
"parent": "minecraft:item/generated", "parent": "minecraft:item/generated",
"textures": { "textures": {
"layer0": "firmskyblock:item/regular_texture" "layer0": "firmskyblock:item/regular_texture"
}, },
"firmament:head_model": "minecraft:block/diamond_block" "firmament:head_model": "minecraft:block/diamond_block" // when wearing on the head render a diamond block instead (can be any item model, including custom ones)
// when wearing on the head render a diamond block instead (can be any item model, including custom ones)
} }
``` ```
## Predicates ## Predicates
Firmament adds the ability for more Firmament adds the ability for more complex [item model predicates](https://minecraft.wiki/w/Tutorials/Models#Item_predicates).
complex [item model predicates](https://minecraft.wiki/w/Tutorials/Models#Item_predicates). Those predicates work on any model, including models for vanilla items, but they don't mix very well with vanilla model overrides.
Those predicates work on any model, including models for vanilla items, but they don't mix very well with vanilla model
overrides.
Vanilla predicates only ever get parsed at the top level, so including a vanilla predicate inside of a more complex Vanilla predicates only ever get parsed at the top level, so including a vanilla predicate inside of a more complex
firmament parser will result in an ignored predicate. firmament parser will result in an ignored predicate.
@@ -55,21 +51,21 @@ firmament parser will result in an ignored predicate.
```json ```json
{ {
"parent": "minecraft:item/handheld", "parent": "minecraft:item/handheld",
"textures": { "textures": {
"layer0": "firmskyblock:item/bat_wand" "layer0": "firmskyblock:item/bat_wand"
}, },
"overrides": [ "overrides": [
{ {
"predicate": { "predicate": {
"firmament:display_name": { "firmament:display_name": {
"regex": ".*§d.*", "regex": ".*§d.*",
"color": "preserve" "color": "preserve"
} }
}, },
"model": "firmskyblock:item/recombobulated_bat_wand" "model": "firmskyblock:item/recombobulated_bat_wand"
} }
] ]
} }
``` ```
@@ -93,8 +89,8 @@ Tries to find at least one lore line that matches the given [string matcher](#st
```json ```json
"firmament:lore": { "firmament:lore": {
"regex": "Mode: Red Mushrooms", "regex": "Mode: Red Mushrooms",
"color": "strip" "color": "strip"
} }
``` ```
@@ -118,8 +114,8 @@ Inlined match:
```json5 ```json5
"firmament:extra_attributes": { "firmament:extra_attributes": {
"path": "gems.JADE_0", "path": "gems.JADE_0",
"string": "PERFECT" "string": "PERFECT"
} }
``` ```
@@ -127,10 +123,10 @@ Sub object match:
```json5 ```json5
"firmament:extra_attributes": { "firmament:extra_attributes": {
"path": "gems.JADE_0", "path": "gems.JADE_0",
"match": { "match": {
"string": "PERFECT" "string": "PERFECT"
} }
} }
``` ```
@@ -141,11 +137,11 @@ further filter by level and some other pet info.
```json5 ```json5
"firmament:pet" { "firmament:pet" {
"id": "WOLF", "id": "WOLF",
"exp": ">=25353230", "exp": ">=25353230",
"tier": "[RARE,LEGENDARY]", "tier": "[RARE,LEGENDARY]",
"level": "[50,)", "level": "[50,)",
"candyUsed": 0 "candyUsed": 0
} }
``` ```
@@ -159,24 +155,24 @@ further filter by level and some other pet info.
Every part of this matcher is optional. Every part of this matcher is optional.
#### Logic Operators #### Logic Operators
Logic operators allow to combine other firmament predicates into one. This is done by building boolean operators: Logic operators allow to combine other firmament predicates into one. This is done by building boolean operators:
```json5 ```json5
"firmament:any": [ "firmament:any": [
{ {
"firmament:display_name": "SkyBlock Menu (Click)" "firmament:display_name": "SkyBlock Menu (Click)"
}, },
{ {
"firmament:display_name": "SkyBlock", "firmament:display_name": "SkyBlock",
"firmament:lore": "Some Lore Requirement" "firmament:lore": "Some Lore Requirement"
} }
] ]
``` ```
This `firmament:any` test if the display name is either "SkyBlock Menu (Click)" or "SkyBlock" (aka any of the child This `firmament:any` test if the display name is either "SkyBlock Menu (Click)" or "SkyBlock" (aka any of the child predicates match).
predicates match).
Similarly, there is `firmament:all`, which requires all of its children to match. Similarly, there is `firmament:all`, which requires all of its children to match.
@@ -201,28 +197,27 @@ Directly specifying a raw string value expects the string to be *exactly* equal,
#### Complex #### Complex
A complex string matcher allows you to specify whether the string will get its color codes removed or not before A complex string matcher allows you to specify whether the string will get its color codes removed or not before matching
matching
```json5 ```json5
"firmament:display_name": { "firmament:display_name": {
"color": "strip", "color": "strip",
"color": "preserve", "color": "preserve",
// When omitting the color property alltogether, you will fall back to "strip" // When omitting the color property alltogether, you will fall back to "strip"
} }
``` ```
In that same object you can then also specify how the string will be matched using another property. You can only ever In that same object you can then also specify how the string will be matched using another property. You can only ever
specify one of these other matchers and one color preserving property. specify one of these other matchers and one color preserving property.
```json5 ```json5
"firmament:display_name": { "firmament:display_name": {
"color": "strip", "color": "strip",
// You can use a "regex" property to use a java.util.Pattern regex. It will try to match the entire string. // You can use a "regex" property to use a java.util.Pattern regex. It will try to match the entire string.
"regex": "So[me] Regex", "regex": "So[me] Regex",
// You can use an "equals" property to test if the entire string is equal to some value. // You can use an "equals" property to test if the entire string is equal to some value.
// Equals is faster than regex, but also more limited. // Equals is faster than regex, but also more limited.
"equals": "Some Text" "equals": "Some Text"
} }
``` ```
@@ -233,10 +228,9 @@ This matches a number against either a range or a specific number.
#### Direct number #### Direct number
You can directly specify a number using that value directly: You can directly specify a number using that value directly:
```json5 ```json5
"firmament:pet": { "firmament:pet": {
"level": 100 "level": 100
} }
``` ```
@@ -246,9 +240,10 @@ This is best for whole numbers, since decimal numbers can be really close togeth
For ranges you can instead use an interval. This uses the standard mathematical notation for those as a string: For ranges you can instead use an interval. This uses the standard mathematical notation for those as a string:
```json5 ```json5
"firmament:pet": { "firmament:pet": {
"level": "(50,100]" "level": "(50,100]"
} }
``` ```
@@ -271,7 +266,7 @@ compare your number:
```json5 ```json5
"firmament:pet": { "firmament:pet": {
"level": "<50" "level": "<50"
} }
``` ```
@@ -288,8 +283,8 @@ The `string` type matches like a regular [string matcher](#string-matcher):
```json ```json
"string": { "string": {
"color": "strip", "color": "strip",
"regex": "^aaa bbb$" "regex": "^aaa bbb$"
} }
``` ```
@@ -303,24 +298,24 @@ Or as a range:
```json ```json
"long": { "long": {
"min": 0, "min": 0,
"max": 1000 "max": 1000
} }
``` ```
Min and max are both optional, but you need to specify at least one. By default `min` is inclusive and `max` is Min and max are both optional, but you need to specify at least one. By default `min` is inclusive and `max` is exclusive.
exclusive.
You can override that like so: You can override that like so:
```json ```json
"short": { "short": {
"min": 0, "min": 0,
"max": 1000, "max": 1000,
"minExclusive": true, "minExclusive": true,
"maxExclusive": false "maxExclusive": false
} }
``` ```
> [!WARNING] > [!WARNING]
> This syntax for numbers is *just* for **NBT values**. This is also why specifying the type of the number is necessary. > This syntax for numbers is *just* for **NBT values**. This is also why specifying the type of the number is necessary.
> For other number matchers, use [the number matchers](#number-matchers) > For other number matchers, use [the number matchers](#number-matchers)
@@ -333,16 +328,16 @@ To retexture a piece of armor place a json file at `assets/firmskyblock/override
```json ```json
{ {
"item_ids": [ "item_ids": [
"TARANTULA_BOOTS", "TARANTULA_BOOTS",
"TARANTULA_LEGGINGS" "TARANTULA_LEGGINGS",
// ETC // ETC
], ],
"layers": [ "layers": [
{ {
"identifier": "firmskyblock:tarantula" "identifier": "firmskyblock:tarantula"
} }
] ]
} }
``` ```
@@ -360,8 +355,8 @@ If you want to apply armor tint to the texture you will usually want two layers.
```json ```json
{ {
"identifier": "firmskyblock:angler", "identifier": "firmskyblock:angler",
"tint": true "tint": true
} }
``` ```
@@ -371,8 +366,8 @@ The second layer will have no tint applied, but will have a suffix:
```json ```json
{ {
"identifier": "firmskyblock:angler", "identifier": "firmskyblock:angler",
"suffix": "_overlay" "suffix": "_overlay"
} }
``` ```
@@ -393,30 +388,30 @@ Firmament predicates will work. You will also just directly specify new layers i
```json ```json
{ {
"item_ids": [ "item_ids": [
"TARANTULA_BOOTS", "TARANTULA_BOOTS",
"TARANTULA_LEGGINGS" "TARANTULA_LEGGINGS",
// ETC // ETC
], ],
"layers": [ "layers": [
{ {
"identifier": "firmskyblock:tarantula" "identifier": "firmskyblock:tarantula"
} }
], ],
"overrides": [ "overrides": [
{ {
"layers": [ "layers": [
{ {
"identifier": "firmskyblock:tarantula_maxed" "identifier": "firmskyblock:tarantula_maxed"
} }
], ],
"predicate": { "predicate": {
"firmament:lore": { "firmament:lore": {
"regex": "Piece Bonus: +285.*" "regex": "Piece Bonus: +285.*"
} }
} }
} }
] ]
} }
``` ```
@@ -457,20 +452,20 @@ per override.
```json5 ```json5
{ {
"screen": "testrp:chocolate_factory", "screen": "testrp:chocolate_factory",
"model": "testrp:time_tower", "model": "testrp:time_tower",
"predicate": { "predicate": {
"firmament:display_name": { "firmament:display_name": {
"regex": "Time Tower.*" "regex": "Time Tower.*"
} }
} }
} }
``` ```
There are three parts to the override. There are three parts to the override.
The `model` is an *item id* that the item will be replaced with. This means the The `model` is an *item id* that the item will be replaced with. This means the
model will be loaded from `assets/<namespace>/models/item/<id>.json`. Make sure to use your own namespace to model will be loaded from `assets/<namespace>/models/item/<id>.json`. Make sure to use your own namespace to
avoid collisions with other texture packs that might use the same id for a gui. avoid collisions with other texture packs that might use the same id for a gui.
The `predicate` is just a normal [predicate](#predicates). This one does not support the vanilla predicates. You can The `predicate` is just a normal [predicate](#predicates). This one does not support the vanilla predicates. You can
@@ -487,7 +482,7 @@ to avoid collisions with other texture packs that might use the same id for a sc
```json ```json
{ {
"title": "Chocolate Factory" "title": "Chocolate Factory"
} }
``` ```
@@ -506,30 +501,30 @@ which block models are replaced under which conditions:
```json ```json
{ {
"modes": [ "modes": [
"mining_3" "mining_3"
], ],
"area": [ "area": [
{ {
"min": [ "min": [
-31, -31,
200, 200,
-117 -117
], ],
"max": [ "max": [
12, 12,
223, 223,
-95 -95
] ]
} }
], ],
"replacements": { "replacements": {
"minecraft:blue_wool": "firmskyblock:mithril_deep", "minecraft:blue_wool": "firmskyblock:mithril_deep",
"minecraft:light_blue_wool": { "minecraft:light_blue_wool": {
"block": "firmskyblock:mithril_deep", "block": "firmskyblock:mithril_deep",
"sound": "minecraft:block.wet_sponge.hit" "sound": "minecraft:block.wet_sponge.hit"
} }
} }
} }
``` ```