Skip to content

Commit

Permalink
Update block ingredient spec, fix some broken references to rock knap…
Browse files Browse the repository at this point in the history
…ping. Add category sorting to linky and re-run, fixing various formatting issues / inconsistencies.
  • Loading branch information
alcatrazEscapee committed Nov 2, 2023
1 parent 1ef6e33 commit 9395037
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 212 deletions.
15 changes: 9 additions & 6 deletions 1.20.x/data/common-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Below are a number of common types used by recipes and custom data.
- [Temperature](#temperature)

<!--linky_end_sort_alphabetical-->

<hr>
<!--linky_begin_sort_categories-->

## Block Ingredients

Expand All @@ -32,11 +32,8 @@ This represents a predicate on blocks in the world. It can be any of the followi
- A String, with the registry name of a single block.
- A JSON object, with a single `block` key, with the registry name of a single block.
- A JSON object, with a single `tag` key, with the name of a block tag to match.
- A JSON object, with a `type` key which specifies a custom block ingredient type to use.
- A JSON array, whose entries are [Block Ingredients](#block-ingredients), which are logically OR'd together.

**Note:** TFC only adds the `tfc:block` and `tfc:tag` types, which are already usable via the above syntaxes for `block` and `tag`, and as a result, are not detailed here. Addons may define other block ingredient types.

<hr>

## Block State
Expand Down Expand Up @@ -104,6 +101,8 @@ A food trait is a String, which must be one of the following options. Note addon

- `tfc:salted`, `tfc:pickled`, `tfc:brined`, `tfc:preserved`, `tfc:vinegar`, `tfc:charcoal_grilled`, `tfc:wood_grilled`, `tfc:burnt_to_a_crisp`

<hr>

## Item Stack Ingredients

An item stack ingredient is a combination of an ingredient, and a count. It is a JSON object with the following fields:
Expand Down Expand Up @@ -154,6 +153,8 @@ An item stack provider represents an output of a recipe, an item stack with any
}
```

<hr>

## Item Stacks

This represents a vanilla Minecraft item stack. It is a JSON object with the following fields:
Expand All @@ -174,8 +175,6 @@ This represents a vanilla Minecraft item stack. It is a JSON object with the fol

<hr>

<hr>

## Temperature

A temperature is a number, which corresponds to a value in degrees Celsius (&deg;C). In-game, the tooltip displays the color based on the internal temperature value:
Expand All @@ -193,3 +192,7 @@ Temperature Range (&deg;C) | Color
1300 - 1400 | <span style="color:#FFFF55">**Yellow-White**</span>
1400 - 1500 | <span style="color:#FFFFFF;text-shadow: 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000;">**White**</span>
> 1500 | <span style="color:#FFFFFF;text-shadow: 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000;">**Brilliant White**</span>
<hr>

<!--linky_end_sort_categories-->
6 changes: 5 additions & 1 deletion 1.20.x/data/crafting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ In addition to custom recipe types, TFC also adds several recipe types that can
- [Food Combining](#food-combining)

<!--linky_end_sort_alphabetical-->

<hr>
<!--linky_begin_sort_categories-->

## Advanced Shaped Crafting

Expand Down Expand Up @@ -138,10 +138,14 @@ This is a recipe type which wraps a normal crafting recipe, but it's used for pr
}
```
<hr>
## Food Combining
This is a crafting recipe which merges foods of the same traits, but with different creation dates. It has no configurable options by itself.
- `type`: `tfc:food_combining`
<hr>
<!--linky_end_sort_categories-->
56 changes: 30 additions & 26 deletions 1.20.x/data/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ TFC defines the following custom data types:
- [Supports](#supports)

<!--linky_end_sort_alphabetical-->

<hr>
<!--linky_begin_sort_categories-->

## Climate Ranges

Expand Down Expand Up @@ -157,6 +157,8 @@ Fauna have the following properties:
}
```

<hr>

## Fertilizers

A fertilizer defines an item which can be used on farmland or crops to increase the nutrients in the soil (farmland). Nutrients are used and consumed by crops to increase their yield. It is located under the subfolder `fertilizers`. A fertilizer has the following properties:
Expand Down Expand Up @@ -200,7 +202,7 @@ A food item definition defines a food, and applies TFC style stats to it includi

**Dynamic Foods**

Dynamic food items are used most typically for *meals*, foods who get their nutrition values from their constituent ingredients. For sandwiches (and datapack-added meals [created by crafting](../item-stack-modifiers#meal)) the `type` should be `dynamic`. For salads and soups, `dynamic_bowl` is required. Note that dynamic foods have *no* nutrition by default, so they require either special recipes or devices to work! This is doubly true for dynamic bowl foods. They will not work unless they are made via the in-game salad or soup methods!
Dynamic food items are used most typically for *meals*, foods who get their nutrition values from their constituent ingredients. For sandwiches (and datapack-added meals [created by crafting](../item-stack-modifiers/#meal)) the `type` should be `dynamic`. For salads and soups, `dynamic_bowl` is required. Note that dynamic foods have *no* nutrition by default, so they require either special recipes or devices to work! This is doubly true for dynamic bowl foods. They will not work unless they are made via the in-game salad or soup methods!

An example dynamic food json:
```jsonc
Expand All @@ -213,7 +215,6 @@ An example dynamic food json:
}
```


<hr>

## Fuels
Expand Down Expand Up @@ -352,7 +353,6 @@ It has the following properties:
}
```


<hr>

## Lamp Fuels
Expand Down Expand Up @@ -437,28 +437,6 @@ In summary:

<hr>

## Sluicing

Sluices link items to loot tables that it processes those items into. This means that any given item can be configured to drop any loot table, even existing loot tables. The loot table generated by sluices has no required context parameters. See the `minecraft:empty` entry in the [Minecraft Wiki article](https://minecraft.wiki/w/Loot_table) for loot context types. It has the following properties:

- `ingredient`: An [Ingredient](../ingredients/) matching the item(s) that will go in the sluice
- `loot_table` The location of a loot table to be dropped for this item.

### Example

```jsonc
// Reference: data/tfc/tfc/sluicing/deposits/cassiterite_andesite.json
{
"ingredient": {
"item": "tfc:deposit/cassiterite/andesite"
},
"loot_table": "tfc:panning/deposits/cassiterite_andesite"
}

```

<hr>

## Panning

Panning links blocks to loot tables that it processes those blocks into. This means that any given block can be configured to work in the pan and drop any loot table, even existing loot tables. The loot table generated by sluices has three required context parameters: `origin`, the position of the player, `tool`, the pan itself, and `this` (this entity), the player doing the panning. See the `minecraft:fishing` entry in the [Minecraft Wiki article](https://minecraft.wiki/w/Loot_table) for loot context types. It has the following properties:
Expand Down Expand Up @@ -492,6 +470,28 @@ For packmakers using the config option, the model file should be at `domain:asse

<hr>

## Sluicing

Sluices link items to loot tables that it processes those items into. This means that any given item can be configured to drop any loot table, even existing loot tables. The loot table generated by sluices has no required context parameters. See the `minecraft:empty` entry in the [Minecraft Wiki article](https://minecraft.wiki/w/Loot_table) for loot context types. It has the following properties:

- `ingredient`: An [Ingredient](../ingredients/) matching the item(s) that will go in the sluice
- `loot_table` The location of a loot table to be dropped for this item.

### Example

```jsonc
// Reference: data/tfc/tfc/sluicing/deposits/cassiterite_andesite.json
{
"ingredient": {
"item": "tfc:deposit/cassiterite/andesite"
},
"loot_table": "tfc:panning/deposits/cassiterite_andesite"
}

```

<hr>

## Supports

Supports define blocks which prevent collapses from **starting** within a specific radius. They do not prevent collapses that started outside the support radius from causing blocks to collapse within the supported area. A support is a file located in under the subfolder `supports`. It has the following properties:
Expand All @@ -512,3 +512,7 @@ Supports define blocks which prevent collapses from **starting** within a specif
"support_horizontal": 4
}
```

<hr>

<!--linky_end_sort_categories-->
3 changes: 1 addition & 2 deletions 1.20.x/data/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ These are custom recipe types that are loaded by TFC, for TFC devices.
- [Casting](recipes/#casting)
- [Collapse](recipes/#collapse)
- [Heating](recipes/#heating)
- [Knapping (Clay, Fire Clay, Leather)](./recipes/#knapping)
- [Knapping](recipes/#knapping)
- [Landslide](recipes/#landslide)
- [Loom](recipes/#loom)
- [Pot](recipes-pot/)
- [Quern](recipes/#quern)
- [Rock Knapping](recipes/#rock-knapping)
- [Scraping](recipes/#scraping)

<!--linky_end_sort_alphabetical-->
Expand Down
97 changes: 53 additions & 44 deletions 1.20.x/data/ingredients.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,36 @@ An ingredient represents an input to a recipe or other piece of data. All vanill

In addition to the two ingredients added by Minecraft, TFC adds a number of custom ingredients which can be used anywhere an `Ingredient` is required, even by other mod's recipes. TFC adds the following ingredient types:

- [Not Rotten](#not-rotten)
<!--linky_begin_sort_alphabetical-->

- [Fluid Item](#fluid-item)
- [Has Trait](#has-trait)
- [Lacks Trait](#lacks-trait)
- [Heatable](#heatable)
- [Lacks Trait](#lacks-trait)
- [Not Rotten](#not-rotten)
- [Not](#not)
- [Fluid Item](#fluid-item)

<!--linky_end_sort_alphabetical-->
<hr>
<!--linky_begin_sort_categories-->

## Not Rotten

This is an ingredient which only accepts food items if they are not rotten. It has the following fields:
## Fluid Item

- `type`: `tfc:not_rotten`
- `ingredient`: An optional [Ingredient](../ingredients/), to which this is applied. If omitted, this will accept **all** non-rotten items.
An ingredient which expects an item to contain a fluid (such as a bucket). It has the following fields:

#### Example:
- `type`: `tfc:fluid_item`
- `ingredient`: An optional [Ingredient](../ingredients/), to which this is applied. If omitted, this will accept **any** item.
- `fluid_ingredient`: A [Fluid Stack Ingredient](../common-types/#fluid-stack-ingredients), which must match the fluid contained in the item.

```jsonc
// An ingredient which only accepts non-rotten minecraft:steak
// An ingredient which accepts a ceramic jug containing fresh water
{
"type": "tfc:not_rotten",
"ingredient": { "item": "minecraft:steak" }
"type": "tfc:fluid_item",
"ingredient": { "item": "tfc:ceramic/jug" },
"fluid_ingredient": {
"amount": 100,
"ingredient": { "fluid": "minecraft:water" }
}
}
```

Expand All @@ -63,26 +70,6 @@ This is an ingredient which only accepts food items if they have a specific trai

<hr>


## Lacks Trait

This ingredient is the same as [Has Trait](#has-trait) but is inverted. It tests if a food lacks a specified trait.

- `type`: `tfc:lacks_trait`
- `trait`: String. The registry name of a [Food Trait](../common-types/#food-traits) which must be present.
- `ingredient`: An optional [Ingredient](../ingredients/), to which this is applied. If omitted, this will accept **all** items without the provided trait.

#### Example

```jsonc
// An ingredient which only accepts a tfc:food/apple which has not been brined
{
"type": "tfc:lacks_trait",
"trait": "tfc:brined",
"ingredient": { "item": "tfc:food/apple" }
}
```

## Heatable

This is an ingredient which only accepts items if they are heatable, and optionally currently within a certain temperature range. It has the following fields:
Expand All @@ -106,6 +93,27 @@ This is an ingredient which only accepts items if they are heatable, and optiona

<hr>

## Lacks Trait

This ingredient is the same as [Has Trait](#has-trait) but is inverted. It tests if a food lacks a specified trait.

- `type`: `tfc:lacks_trait`
- `trait`: String. The registry name of a [Food Trait](../common-types/#food-traits) which must be present.
- `ingredient`: An optional [Ingredient](../ingredients/), to which this is applied. If omitted, this will accept **all** items without the provided trait.

#### Example

```jsonc
// An ingredient which only accepts a tfc:food/apple which has not been brined
{
"type": "tfc:lacks_trait",
"trait": "tfc:brined",
"ingredient": { "item": "tfc:food/apple" }
}
```

<hr>

## Not

An ingredient which inverts an existing ingredient. It has the following fields:
Expand All @@ -127,22 +135,23 @@ An ingredient which inverts an existing ingredient. It has the following fields:

<hr>

## Fluid Item
## Not Rotten

An ingredient which expects an item to contain a fluid (such as a bucket). It has the following fields:
This is an ingredient which only accepts food items if they are not rotten. It has the following fields:

- `type`: `tfc:fluid_item`
- `ingredient`: An optional [Ingredient](../ingredients/), to which this is applied. If omitted, this will accept **any** item.
- `fluid_ingredient`: A [Fluid Stack Ingredient](../common-types/#fluid-stack-ingredients), which must match the fluid contained in the item.
- `type`: `tfc:not_rotten`
- `ingredient`: An optional [Ingredient](../ingredients/), to which this is applied. If omitted, this will accept **all** non-rotten items.

#### Example:

```jsonc
// An ingredient which accepts a ceramic jug containing fresh water
// An ingredient which only accepts non-rotten minecraft:steak
{
"type": "tfc:fluid_item",
"ingredient": { "item": "tfc:ceramic/jug" },
"fluid_ingredient": {
"amount": 100,
"ingredient": { "fluid": "minecraft:water" }
}
"type": "tfc:not_rotten",
"ingredient": { "item": "minecraft:steak" }
}
```

<hr>

<!--linky_end_sort_categories-->
Loading

0 comments on commit 9395037

Please sign in to comment.