Skip to content

Commit 9b90daa

Browse files
authored
Render Docs and Update Docs (#3782)
1 parent f0055a9 commit 9b90daa

8 files changed

Lines changed: 144 additions & 35 deletions

File tree

docs/README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,40 @@ Once you're happy, commit these changes and make a pull request for us to review
2626
If you come back to work on the docs, you can use a codespace again. You might need to `pull` to bring your codespace up to date, which you can do by pressing this button in the `Source Control` tab.
2727

2828
![image](https://github.com/user-attachments/assets/7d1246d2-f091-4452-bdb3-edf221902503)
29-
## Installing Required Dependencies
29+
## Installing Required Dependencies & Run Locally
3030

31-
To install the required dependencies, please run `pip install -r requirements.txt`
31+
Please run all commands from this section inside the `docs` folder!
32+
33+
**First, setup a venv for python:**
34+
35+
```bash
36+
python -m venv .venv
37+
```
38+
or:
39+
```bash
40+
python3 -m venv .venv
41+
```
42+
43+
**Now activate the venv:**
44+
45+
Windows:
46+
```cmd
47+
.venv\Scripts\activate
48+
```
49+
Linux / MacOS:
50+
```bash
51+
source .venv/bin/activate
52+
```
53+
54+
**Install the required dependencies:**
55+
```bash
56+
pip install -r requirements.txt
57+
```
58+
59+
**Run locally**:
60+
```bash
61+
mkdocs serve
62+
```
3263

3364
## MkDocs Plugins
3465

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: "Version 7.0.0"
3+
---
4+
5+
6+
# Updating from `1.6.4` to `7.0.0`
7+
8+
9+
## Models
10+
11+
We have completely reworked our rendering system to be model-based instead of renderer-based.
12+
13+
Previously, you would do
14+
```javascript
15+
.workableCasingRenderer(
16+
"gtceu:block/casings/solid/machine_casing_robust_tungstensteel",
17+
"gtceu:block/multiblock/primitive_blast_furnace", false
18+
);
19+
```
20+
21+
Now, you should instead use:
22+
23+
```javascript
24+
.workableCasingModel(
25+
"gtceu:block/casings/solid/machine_casing_robust_tungstensteel",
26+
"gtceu:block/multiblock/primitive_blast_furnace"
27+
);
28+
```
29+
Note: The third argument has been removed and should no longer be used.
30+
31+
32+
Previously, you would do
33+
```javascript
34+
.workableTieredHullRenderer("gtceu:block/machines/reconstructor")
35+
```
36+
37+
Now, you would do
38+
```javascript
39+
.workableTieredHullModel("gtceu:block/machines/reconstructor")
40+
```
41+
42+
To find an updated list of all the methods for models, look at [MachineBuilder.java](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java) for singleblocks, and [MultiblockMachineBuilder.java](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MultiblockMachineBuilder.java) for multiblocks. Most methods have kept a similar name, replacing `renderer` with `model`.
43+
44+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: "Version 7.2.0"
3+
---
4+
5+
6+
# Updating from `7.1.4` to `7.2.0`
7+
8+
9+
## Models
10+
If you have any block model that
11+
- has overridden base textures when part of a formed structure (fluid hatch coloring for say an EBF),
12+
- doesn't use any of the builtin model methods that set it,
13+
14+
in the MachineDefinition, you need to add `.modelProperty(GTMachineModelProperties.IS_FORMED, false)`
15+
16+
## Ranged inputs/outputs
17+
In recipes, you can now use:
18+
- `.itemInputsRanged(..., min, max)`
19+
- `.itemOutputssRanged(..., min, max)`
20+
- `.fluidInputsRanged(..., min, max)`
21+
- `.fluidOutputsRanged(..., min, max)`
22+
23+
Where the inputs or outputs will be rolled inclusively from min to max.
24+
25+
## Rock breaker conditions
26+
Previously, rock breaker recipes used the `addData("fluidA", ...)` methods.
27+
28+
Now, they work by AdjacentFluidConditions, added with the `adjacentFluid(Fluid...)` methods. See [our other condition builder methods](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/GTRecipeSchema.java#L894).
29+
30+
## Recipe Conditions
31+
We have moved away from the .serialize, .deserialize, .toNetwork and .fromNetwork calls on the RecipeCondition, and we now exclusively use the codecs registered in GTRecipeConditions.

docs/content/Modpacks/Examples/Alternator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
4040
.where('E', Predicates.abilities(PartAbility.OUTPUT_ENERGY).setExactLimit(1))
4141
.build()
4242
)
43-
.workableCasingRenderer(
43+
.workableCasingModel(
4444
"gtceu:block/casings/solid/machine_casing_solid_steel",
45-
"gtceu:block/multiblock/implosion_compressor", false
45+
"gtceu:block/multiblock/implosion_compressor"
4646
)
4747
})
4848
```

docs/content/Modpacks/Examples/Greenhouse.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
6161
.where('#', Predicates.air())
6262
.build()
6363
)
64-
.workableCasingRenderer('gtceu:block/casings/solid/machine_casing_solid_steel', 'gtceu:block/multiblock/implosion_compressor', false)
64+
.workableCasingModel(
65+
"gtceu:block/casings/solid/machine_casing_solid_steel",
66+
"gtceu:block/multiblock/implosion_compressor"
67+
)
6568
})
6669
```
6770

docs/content/Modpacks/Examples/Ore-Processing-Plant.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
4646
.where('B', Predicates.blocks('gtceu:bronze_machine_casing'))
4747
.where(' ', Predicates.any())
4848
.build())
49-
.workableCasingRenderer("gtceu:block/casings/solid/machine_casing_robust_tungstensteel",
50-
"gtceu:block/multiblock/primitive_blast_furnace", false);
49+
.workableCasingModel(
50+
"gtceu:block/casings/solid/machine_casing_robust_tungstensteel",
51+
"gtceu:block/multiblock/primitive_blast_furnace"
52+
);
5153
})
5254
```
5355

docs/content/Modpacks/Other-Topics/Custom-Machines.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
7777
.where('C', Predicates.blocks(GTBlocks.CASING_STEEL_SOLID.get())
7878
.or(Predicates.autoAbilities(definition.getRecipeTypes())))
7979
.build())
80-
.workableCasingRenderer(
80+
.workableCasingModel(
8181
"gtceu:block/casings/solid/machine_casing_inert_ptfe",
82-
"gtceu:block/multiblock/large_chemical_reactor",
83-
false
82+
"gtceu:block/multiblock/large_chemical_reactor"
8483
)
8584
})
8685
```
@@ -125,10 +124,9 @@ GTCEuStartupEvents.registry('gtceu:machine', event => {
125124
.where('i', GTMachines.ITEM_IMPORT_BUS[1], Direction.SOUTH)
126125
.where('0', GTMachines.ITEM_EXPORT_BUS[1], Direction.SOUTH)
127126
.build())
128-
.workableCasingRenderer(
127+
.workableCasingModel(
129128
"gtceu:block/casings/solid/machine_casing_inert_ptfe",
130-
"gtceu:block/multiblock/large_chemical_reactor",
131-
false
129+
"gtceu:block/multiblock/large_chemical_reactor"
132130
)
133131
})
134132
```

docs/content/Modpacks/Other-Topics/Adding-and-Removing-Recipes.md renamed to docs/content/Modpacks/Recipes/Adding-and-Removing-Recipes.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,25 @@ ServerEvents.recipes(event => {
114114
Takes a numerical value representing an EU amount. Positive values will make the recipe consume energy per tick,
115115
negative ones will make it generate energy per tick.
116116
- Chanced Ingredients:
117-
- Ingredients that are not consumed/produced on every run of a recipe. Can be expressed as either a fraction, or as an
118-
integer chance out of 10,000.
119-
- Assigning an Input ingredient with a Chance of `0` causes that ingredient to be flagged as `Non-Consumed` in EMI.
120-
This can also be done more easily using `.notConsumable()`.
121-
- Recipes with chanced ingredients can also have a Chance Logic designated for each of their input/output sets, using
122-
one or more of the functions `.chancedItemInputLogic()`, `.chancedFluidInputLogic()`, `.chancedTickInputLogic()`,
123-
`.chancedItemOutputLogic()`, `.chancedFluidOutputLogic()`, `.chancedTickOutputLogic()`
124-
- Valid options for chanced logic are:
125-
- `or` - (default) Any item/fluid which succeeds on its chance roll is produced/consumed.
126-
- `and` - If _all_ items/fluids succeed on their chance roll, all are produced/consumed together. Otherwise, none are.
127-
- `xor` - Guarantees that exactly one of the chanced items/fluids will be produced/consumed on every run.
128-
Behavior was changed in 7.0.0.
129-
- `first` - Makes a chance roll for each item/fluid, in order of registration. Only the first item which succeeds
130-
on its roll is returned. Prior to 7.0.0, this was the behavior of `xor` logic.
117+
- Ingredients that are not consumed/produced on every run of a recipe. Can be expressed as either a fraction, or as an
118+
integer chance out of 10,000.
119+
- Assigning an Input ingredient with a Chance of `0` causes that ingredient to be flagged as `Non-Consumed` in EMI.
120+
This can also be done more easily using `.notConsumable()`.
121+
- Recipes with chanced ingredients can also have a Chance Logic designated for each of their input/output sets, using
122+
one or more of the functions `.chancedItemInputLogic()`, `.chancedFluidInputLogic()`, `.chancedTickInputLogic()`,
123+
`.chancedItemOutputLogic()`, `.chancedFluidOutputLogic()`, `.chancedTickOutputLogic()`
124+
- Valid options for chanced logic are:
125+
- `or` - (default) Any item/fluid which succeeds on its chance roll is produced/consumed.
126+
- `and` - If _all_ items/fluids succeed on their chance roll, all are produced/consumed together. Otherwise, none are.
127+
- `xor` - Guarantees that exactly one of the chanced items/fluids will be produced/consumed on every run.
128+
Behavior was changed in 7.0.0.
129+
- `first` - Makes a chance roll for each item/fluid, in order of registration. Only the first item which succeeds
130+
on its roll is returned. Prior to 7.0.0, this was the behavior of `xor` logic.
131131
- Ranged Ingredients:
132-
- Item or Fluid ingredients that will be consumed or produced in a random amount within a `min, max` range (inclusive).
132+
- Item or Fluid ingredients that will be consumed or produced in a random amount within a `min, max` range (inclusive).
133133
- Circuits
134-
- Many GT recipes use a `Programmed Circuit` item with a Configuration value of `1-32` as a `Non-Consumed` input,
135-
to distinguish them from other recipes in the same machine with similar ingredients. `.circuit()` adds one to a recipe.
134+
- Many GT recipes use a `Programmed Circuit` item with a Configuration value of `1-32` as a `Non-Consumed` input,
135+
to distinguish them from other recipes in the same machine with similar ingredients. `.circuit()` adds one to a recipe.
136136
- More granular functionality:
137137
- `.perTick()`:
138138
Using this will enable you to control whether a recipe input/output is consumed/produced per tick the recipe is
@@ -178,17 +178,17 @@ ServerEvents.recipes(event => {
178178

179179
### Rock breaker fluids
180180

181-
!!! warning
182-
When adding rock breaker recipes you will need to manually define the fluids the rock breaker will use.
183-
(might change in the future)
181+
Rock breaker recipes use AdjacentFluidConditions.
182+
183+
To add a condition, you can use the `adjacentFluid(Fluid...)` methods, see [our other condition builder methods](https://github.com/GregTechCEu/GregTech-Modern/blob/1.20.1/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/GTRecipeSchema.java#L894).
184184

185185
```js title="rock_breaker.js"
186186
ServerEvents.recipes(event => {
187187
event.recipes.gtceu.rock_breaker('rhino_jank')
188188
.notConsumable('minecraft:dirt')
189189
.itemOutputs('minecraft:dirt')
190-
.addDataString("fluidA", "minecraft:lava")
191-
.addDataString("fluidB", "minecraft:water")
190+
.adjacentFluid('minecraft:water')
191+
.adjacentFluid('minecraft:lava')
192192
.duration(16)
193193
.EUt(30)
194194
})

0 commit comments

Comments
 (0)