You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/Modpacks/Changes/v7.5.0.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,22 @@ title: "Version 7.5.0"
4
4
5
5
6
6
# Updating from `7.4.1` to `7.5.0`
7
+
7
8
## MachineBuilder Generics
8
9
We have added a second Generic argument to our (Multiblock)MachineBuilder. This effectively means that anywhere where you used to store a partially finished `MachineBuilder<?>`, you now need to store a `MachineBuilder<?, ?>`. The same holds for `MultiblockMachineBuilder<?,?>`.
10
+
11
+
## RecipeCondition Generics
12
+
We have added a Generic argument to `RecipeCondition` describing the condition.
13
+
This means that your custom recipe conditions now need to extend `RecipeCondition<MyCondition>` (whereas before they just extended `RecipeCondition`).
14
+
For example, if you have a custom recipe condition class like so: `public class ExampleCondition extends RecipeCondition`, it should now be `public class ExampleCondition extends RecipeCondition<ExampleCondition>`.
15
+
You also need to adjust the generics of `getType()` and `createTemplate()` to match this change, like so:
16
+
```patch
17
+
- public RecipeConditionType<?> getType() {
18
+
+ public RecipeConditionType<ExampleCondition> getType() {
19
+
20
+
- public RecipeCondition createTemplate() {
21
+
+ public ExampleCondition createTemplate() {
22
+
```
23
+
9
24
## Machine & Cover Copy/Paste System
10
25
A new system for copying machines using the Machine Memory Card has been added, see [this page](../Other-Topics/Cover-Machine-Copy-Paste-Support.md) if you want to add extra copy/paste behaviour to your own machines and covers.
@@ -105,16 +120,12 @@ This part is quite simple, and just returns the type and tooltip for the conditi
105
120
public ExampleCondition(int height) {
106
121
this(false, height);
107
122
}
108
-
109
-
public ExampleCondition() {
110
-
this(false, 0);
111
-
}
112
123
```
113
-
These are the constructors. We need the `isReverse`, as it is part of the overarching `RecipeCondition` type. `isReverse` means that if the condition is met, your recipe won't be run. Furthermore, a no-arg constructor is required for (de)serialization.
124
+
These are the constructors. We need the `isReverse`, as it is part of the overarching `RecipeCondition` type. `isReverse` means that if the condition is met, your recipe won't be run. Furthermore, a constructor with all arguments is required for (de)serialization.
114
125
115
126
```java
116
127
@Override
117
-
publicRecipeCondition createTemplate() {
128
+
publicExampleCondition createTemplate() {
118
129
returnnewExampleCondition(0);
119
130
}
120
131
```
@@ -131,21 +142,20 @@ This creates the basic "template" that might be used for serialization. This sho
TheCODEC is how java knows how to serialize/deserialize your condition. This is needed for syncing between client/server, and storing it to json to load when the world loads.
143
153
It consists of a few parts:
144
154
145
155
- `RecordCodecBuilder.create(instance -> ` means we will start a RecordCodecBuilder, or a builder that only consists of simple types.
146
156
- `RecipeCondition.isReverse(instance)` is a helper codec that serializes the isReverse boolean of your codec.
147
-
- `.and(` means this is the next field in the record.
148
-
- `Codec.INT.fieldOf("height").forGetter(val -> val.height)` means we want to serialize an INT, we want to call it "height" in the json, and to get the value you call `.height`.
157
+
- `.and(` allows adding additional fields to the codec.
158
+
- `Codec.INT.fieldOf("height").forGetter(val -> val.height)` means we want to serialize an integer, we want to call it "height" in the JSON, and to get the value to serialize you use `ExampleCondition#height`.
149
159
- `.apply(instance, ExampleCondition::new)` means when deserializing back to an object, you apply these steps to get the values (in thiscase `bool isReverse, int height`) and call the constructor with those arguments.
150
160
Inthiscase, this would call our `newExampleCondition(isReverse, height)` constructor we have defined earlier.
Copy file name to clipboardExpand all lines: docs/content/Modpacks/Recipes/Recipe-Conditions.md
+44-28Lines changed: 44 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,46 +4,62 @@ title: Recipe Conditions
4
4
5
5
Recipe Conditions are recipe properties that can prevent a recipe from starting based on certain criteria, like for example Biome, Weather, Quest Completions, or self-made custom Conditions.
6
6
7
-
These conditions can be used in both java and kubejs recipes. However, custom conditons can only be done in java. If you want to see how to make these, check out the [Custom Recipe Condition](../Examples/Custom-Recipe-Condition.md) example page.
7
+
These conditions can be used in both Java and KubeJS recipes. However, custom conditions can only be done in Java addons. If you want to see how to make these, check out the [Custom Recipe Condition](../Examples/Custom-Recipe-Condition.md) example page.
8
8
9
9
!!! Note
10
10
The condition is run after recipe matching and before recipe execution. If the recipe condition doesn't match, the machine will be suspended and won't be updated again until something in the inputs/outputs changes.
11
11
12
12
### Base Conditons
13
13
14
14
- Biome: `.biome("namespace:biome_id")`
15
-
- Locks a recipe behind being inside a certain biome, works with any biome a pack has loaded. For example, you could use `minecraft:plains`.
15
+
- Locks a recipe behind being inside a certain biome, works with any biome a pack has loaded.
16
+
For example, you could do `.biome("minecraft:plains")`.
- Locks a recipe being behind a certain dimension, the gas collector is a good example of this. For example, you could use `minecraft:the_end`
18
-
- Position_Y: `.posY(int min, int max)`
19
-
- Locks a recipe behind a certain y level in-world. For example, you could use `.posY(120, 130)` to have a recipe require a machine to be in between y 120 and y 130.
18
+
- Locks a recipe being behind a certain dimension, the gas collector is a good example of this.
19
+
- For example, you could do `.dimension("minecraft:the_end")`
20
+
- Y Position: `.posY(int min, int max)`
21
+
- Locks a recipe behind a certain y level in-world.
22
+
- For example, you could use `.posY(120, 130)` to have a recipe require a machine to be in between y 120 and y 130.
20
23
- Rain: `.rain(float level)`
21
-
- Locks a recipe behind a certain level of rain. For example, you could use `.rain(1.0)` to make a recipe need full rain.
- You can pass through any amount of fluids into the array. Moreover, any fluid passed into the array will make the recipe require a full source block touching the machine. We also have `adjacentFluidTag("forge:water", "forge:lava")`.
- Much like the fluid condition, you can pass blocks into the array that lock the recipe behind needing the machine to touch these blocks. We also have `adjacentBlockTag("forge:stone", "forge:storage_blocks/iron")`.
24
+
- Locks a recipe behind a certain level of rain.
25
+
- For example, you could use `.rain(1.0)` to make a recipe need full rain.
- You can pass any amount of fluids into the array. Moreover, any fluid passed into the array will make the recipe require a full source block touching the machine.
28
+
- For example, you could use `.adjacentFluids("minecraft:water", "minecraft:lava")` to make a recipe require BOTH a water source and a lava source next to the machine.
29
+
- We also have `.adjacentFluidTag("forge:water", "forge:lava")`, which does the same, but allows fluid _tags_ to be used.
- Much like the fluid condition, you can pass blocks into the array that lock the recipe behind needing the machine to touch these blocks.
32
+
- For example, you could use `.adjacentBlocks("minecraft:stone", "minecraft:iron_block")` to make a recipe require a Stone block and a Block of Iron.
33
+
- We also have `.adjacentBlockTag("forge:stone", "forge:storage_blocks/iron")`, which does the same, but allows block _tags_ to be used.
26
34
- Thunder: `.thunder(float level)`
27
-
- Locks a recipe behind a certain level of rain. For example, you could use `.thunder(1.0)` to make a recipe need a strong thunderstorm.
28
-
- Vent: This condition is auto added to any steam single block, it blocks recipes from running if the vent is obstructed.
35
+
- Locks a recipe behind a certain level of rain.
36
+
- For example, you could use `.thunder(1.0)` to make a recipe need a strong thunderstorm.
37
+
- Vent: This condition is automatically added to any recipes ran in a single block steam machine. It blocks recipes from running if the machine's vent is obstructed.
- Locks a recipe to being inside a cleanroom. You can also use STERILE_CLEANROOM as well as your own custom cleanroom type.
31
-
- Fusion_Start_EU: `.fusionStartEU(long eu)`
32
-
- Locks a recipe behind the amount of stored power in a fusion machine. To use this, the machine must use the FusionReactorMachine class. For example, you could use `.fusionStartEU(600000)`
33
-
- Station_Research: `.stationResearch(b => b.researchStack("namespace:item_id").EUt(long eu).CWUt(int minCWUPerTick, int TotalCWU))`
34
-
- Locks a recipe behind having a certain research stack. For this condition to be properly seen, you will either need a base machine recipe type with the research ui component, or make your own. For example, you could do `.stationResearch(b => b.researchStack("gtceu:lv_motor").EUt(131000).CWUt(24, 12000))` which would lock a recipe behind needing a data orb with the lv motor research. It will also generate you a research station recipe.
- Much like station research, this condition locks a recipe behind needing a research stack. However, in this case it will default to a data stick. For example, you could do `.scannerResearch(b => b.researchStack("gtceu:lv_motor").EUt(8192))`, which would make the recipe need a data stick with the lv motor research, and generates a scanner recipe.
- Locks a recipe into needing a certain environmental hazard to run. For now, carbon monoxide is the only one. An example of a machine using this condition is the air scrubber.
39
-
- Daytime: `.daytime(boolean notNight)`
40
-
- Locks recipe behind whether it is day or night. For example, you could do `.daytime(true)`, to make the recipe need it to be daytime.
39
+
- Locks a recipe to being inside a cleanroom. You can also use `STERILE_CLEANROOM` as well as your own custom cleanroom type(s).
40
+
- Fusion Start EU: `.fusionStartEU(long eu)`
41
+
- Locks a recipe behind the amount of stored power in a fusion machine. To use this, the machine must use the FusionReactorMachine class.
42
+
- For example, you could use `.fusionStartEU(600000)`
43
+
- Station Research: `.stationResearch(b => b.researchStack("namespace:item_id").EUt(long eu).CWUt(int minCWUPerTick, int TotalCWU))`
44
+
- Locks a recipe behind having a certain research stack. For this condition to be properly seen, you will either need a base machine recipe type with the research ui component, or make your own.
45
+
- For example, you could do `.stationResearch(b => b.researchStack("gtceu:lv_motor").EUt(131000).CWUt(24, 12000))` which would lock a recipe behind needing a data orb with the lv motor research. It will also generate you a research station recipe.
- Much like station research, this condition locks a recipe behind needing a research stack. However, in this case it will default to a data stick.
48
+
- For example, you could do `.scannerResearch(b => b.researchStack("gtceu:lv_motor").EUt(8192))`, which would make the recipe need a data stick with the lv motor research, and generates a scanner recipe.
- Locks a recipe into needing a certain environmental hazard to run. For now, `"carbon_monoxide_poisoning"` is the only one that's added to the world (by default). An example of a machine using this condition is the air scrubber.
51
+
- For example, you could do `.environmentalHazard("carcinogen")` (if you have something that creates radiation, as if you don't, the recipe would never run.)
52
+
- Daytime: `.daytime(boolean isNight)`
53
+
- Locks recipe behind whether it is day or night.
54
+
- For example, you could do `.daytime(true)` to make the recipe require nighttime to run.
41
55
42
56
### Mod Dependent Conditions
43
-
- Ftb_Quests: `.ftbQuest(quest_id)`
44
-
- Locks a recipe behind the owner of a machine completing a ftb quest. An example can't be easily given since every quest book is different.
45
-
- Gamestage: `.gameStage(gameStage_id)`
57
+
- FTB Quests: `.ftbQuest("quest_id")`
58
+
- Locks a recipe behind the owner of a machine completing a quest with FTB Quests.
59
+
- An example can't be easily given since every quest book is different.
60
+
- Game Stages: `.gameStage("gamestage_id")`
46
61
- Locks a recipe behind a certain game stage.
47
-
- Heracles_Quests: `.heraclesQuest(quest_id)`
48
-
- Locks a recipe behind the owner of a machine completing a heracles quest. An example can't be easily given since every quest book is different.
0 commit comments