Skip to content

Commit d634df8

Browse files
More Multiblock examples to the Kubejs docs. (#3793)
Co-authored-by: Jurre Groenendijk <jurre@jilles.com>
1 parent 7bb5bf5 commit d634df8

3 files changed

Lines changed: 174 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Example Steam Multiblock"
3+
---
4+
5+
### Large Steam Compressor Multiblock
6+
7+
In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. Steam multiblocks such as the Steam Grinder and Steam Oven use this class.
8+
9+
```const $SteamMulti = Java.loadClass('com.gregtechceu.gtceu.common.machine.multiblock.steam.SteamParallelMultiblockMachine');```
10+
11+
Below is an example of a multiblock using the SteamParallelMultiblockMachine class.
12+
13+
### Multiblock
14+
15+
```js title="example_steam_multiblock_multiblock.js"
16+
GTCEuStartupEvents.registry('gtceu:machine', event => {
17+
event.create('large_steam_compressor', 'multiblock')
18+
.machine((holder) => new $SteamMulti(holder, 4))
19+
// The number in holder is the max amount of parallel it can use.
20+
.rotationState(RotationState.NON_Y_AXIS)
21+
.recipeType('compressor')
22+
.recipeModifier((machine, recipe) => $SteamMulti.recipeModifier(machine, recipe), true)
23+
.pattern(definition => FactoryBlockPattern.start()
24+
.aisle("BCCCB", "BBCBB", "BBCBB", "BBBBB", "BBBBB")
25+
.aisle("CDDDC", "BDBDB", "BDEDB", "BBDBB", "BBBBB")
26+
.aisle("CDDDC", "CBBBC", "CEFEC", "BDDDB", "BBGBB")
27+
.aisle("CDDDC", "BDBDB", "BDEDB", "BBDBB", "BBBBB")
28+
.aisle("BCCCB", "BBHBB", "BBCBB", "BBBBB", "BBBBB")
29+
.where('B', Predicates.any())
30+
.where('C', Predicates.blocks('gtceu:steam_machine_casing').setMinGlobalLimited(10)
31+
.or(Predicates.abilities(PartAbility.STEAM_IMPORT_ITEMS).setMaxGlobalLimited(1))
32+
.or(Predicates.abilities(PartAbility.STEAM).setMaxGlobalLimited(1))
33+
.or(Predicates.abilities(PartAbility.STEAM_EXPORT_ITEMS).setMaxGlobalLimited(1)))
34+
.where("D", Predicates.blocks("gtceu:industrial_steam_casing"))
35+
.where("E", Predicates.blocks("gtceu:bronze_brick_casing"))
36+
.where("F", Predicates.blocks("gtceu:bronze_firebox_casing"))
37+
.where("G", Predicates.blocks("gtceu:bronze_machine_casing"))
38+
.where('H', Predicates.controller(Predicates.blocks(definition.get())))
39+
.build())
40+
.workableCasingModel("gtceu:block/casings/steam/bronze/bottom",
41+
"gtceu:block/machines/compressor")
42+
})
43+
```
44+
45+
### Lang
46+
47+
```json title="en_us.json"
48+
{
49+
"block.gtceu.large_steam_compressor": "Large Steam Compressor",
50+
}
51+
```
52+
53+
54+
55+
56+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: "Example Turbine"
3+
---
4+
5+
### Example Turbine
6+
7+
In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. LargeTurbineMachines such as the gas, steam, and plasma turbines use this class.
8+
9+
```const $LargeTurbineMachine = Java.loadClass("com.gregtechceu.gtceu.common.machine.multiblock.generator.LargeTurbineMachine")```
10+
11+
Below is an example of a multiblock using the CoilWorkableElectricMultiblockMachine class and the pyrolyseOvenOverclock machine logic.
12+
13+
### Multiblock
14+
15+
```js title="hyper_gas_turbine_multiblock.js"
16+
GTCEuStartupEvents.registry('gtceu:machine', event => {
17+
event.create('hyper_gas_turbine', 'multiblock')
18+
.machine((holder) => new $LargeTurbineMachine(holder, GTValues.LuV))
19+
.rotationState(RotationState.NON_Y_AXIS)
20+
.recipeTypes("gas_turbine")
21+
.recipeModifiers([GTRecipeModifiers.OC_NON_PERFECT_SUBTICK, GTRecipeModifiers.BATCH_MODE])
22+
.appearanceBlock(GTBlocks.CASING_TITANIUM_STABLE)
23+
.pattern(definition => FactoryBlockPattern.start()
24+
.aisle("BBBBBBB", "BBBCBBB", "BBBDBBB", "BBBCBBB", "BBBBBBB")
25+
.aisle("BBBCBBB", "BBCACBB", "BBCECBB", "BBCACBB", "BBBCBBB")
26+
.aisle("BBCCCBB", "BCAAACB", "BCAEACB", "BCAEACB", "BBCCCBB")
27+
.aisle("BCCCCCB", "CAAEAAC", "CEEEEEC", "CAEEEAC", "BCCFCCB")
28+
.aisle("BBCCCBB", "BCAAACB", "BCAEACB", "BCAEACB", "BBCCCBB")
29+
.aisle("BBBCBBB", "BBCACBB", "BBCECBB", "BBCACBB", "BBBCBBB")
30+
.aisle("BBBBBBB", "BBBCBBB", "BBBGBBB", "BBBCBBB", "BBBBBBB")
31+
.where("A", Predicates.blocks("minecraft:air"))
32+
.where("B", Predicates.any())
33+
.where("C", Predicates.blocks("gtceu:stainless_steel_turbine_casing")
34+
.or(Predicates.autoAbilities(definition.getRecipeTypes()))
35+
.or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1)))
36+
.where("D", Predicates.ability(PartAbility.MUFFLER).setExactLimit(1))
37+
.where("F", Predicates.ability(PartAbility.ROTOR_HOLDER).setExactLimit(1))
38+
.where("E", Predicates.blocks("gtceu:stainless_steel_frame"))
39+
.where("G", Predicates.controller(Predicates.blocks(definition.get())))
40+
.build())
41+
.workableCasingModel("gtceu:block/casings/mechanic/machine_casing_turbine_stainless_steel",
42+
"gtceu:block/multiblock/generator/large_gas_turbine")
43+
});
44+
```
45+
46+
### Lang
47+
48+
```json title="en_us.json"
49+
{
50+
"block.gtceu.hyper_gas_turbine": "Hyper Gas Turbine",
51+
}
52+
```
53+
54+
55+
56+
57+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: "Superheated Pyrolyzing Oven"
3+
---
4+
5+
### Superheated Pyrolyzing Oven Multiblock (by Phoenixvine)
6+
7+
In order to use multiblock logic extending beyond the normal WorkableElectricMultiblockMachine, (This is the multiblock type used by default for kubejs) you need to load a class. Coil multiblocks such as the Electric Blast Furnace, Pyrolyse Oven, and the Cracker use this class.
8+
9+
```const CoilWorkableElectricMultiblockMachine = Java.loadClass("com.gregtechceu.gtceu.api.machine.multiblock.CoilWorkableElectricMultiblockMachine")```
10+
11+
Below is an example of a multiblock using the CoilWorkableElectricMultiblockMachine class and the pyrolyseOvenOverclock machine logic.
12+
13+
### Multiblock
14+
```js title="superheated_pyrolyzing_oven_multiblock.js"
15+
GTCEuStartupEvents.registry('gtceu:machine', event => {
16+
event.create("superheated_pyrolyzing_oven", "multiblock")
17+
.machine((holder) => new CoilWorkableElectricMultiblockMachine(holder))
18+
.rotationState(RotationState.NON_Y_AXIS)
19+
.recipeTypes('pyrolyse_oven')
20+
.recipeModifiers([GTRecipeModifiers.PARALLEL_HATCH, GTRecipeModifiers.OC_PERFECT,GTRecipeModifiers.BATCH_MODE, (machine, recipe) =>
21+
GTRecipeModifiers.pyrolyseOvenOverclock(machine, recipe)])
22+
.appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
23+
.pattern(definition => FactoryBlockPattern.start()
24+
.aisle("BBCCCBB", "BBCDCBB", "BBCCCBB", "BBCCCBB", "BBEEEBB", "BBEEEBB")
25+
.aisle("BCCCCCB", "BCAFACB", "BCAFACB", "BCGGGCB", "BEAAAEB", "BEHHHEB")
26+
.aisle("CCCCCCC", "CAAFAAC", "CAAFAAC", "CGGGGGC", "EAAAAAE", "EHHHHHE")
27+
.aisle("CCCCCCC", "DFFFFFD", "CFFFFFC", "CGGGGGC", "EAAAAAE", "EHHMHHE")
28+
.aisle("CCCCCCC", "CAAFAAC", "CAAFAAC", "CGGGGGC", "EAAAAAE", "EHHHHHE")
29+
.aisle("BCCCCCB", "BCAFACB", "BCAFACB", "BCGGGCB", "BEAAAEB", "BEHHHEB")
30+
.aisle("BBCCCBB", "BBCICBB", "BBCCCBB", "BBCCCBB", "BBEEEBB", "BBEEEBB")
31+
.where("A", Predicates.blocks("minecraft:air"))
32+
.where("B", Predicates.any())
33+
.where('C', Predicates.blocks('gtceu:solid_machine_casing').setMinGlobalLimited(10)
34+
.or(Predicates.abilities(PartAbility.MAINTENANCE).setExactLimit(1))
35+
.or(Predicates.abilities(PartAbility.PARALLEL_HATCH).setMaxGlobalLimited(1))
36+
.or(Predicates.autoAbilities(definition.getRecipeTypes())))
37+
.where("D", Predicates.blocks("gtceu:steel_firebox_casing"))
38+
.where("E", Predicates.blocks("gtceu:laminated_glass"))
39+
.where("F", Predicates.blocks("gtceu:ptfe_pipe_casing"))
40+
.where("G", Predicates.heatingCoils())
41+
.where("H", Predicates.blocks("gtceu:high_temperature_smelting_casing"))
42+
.where("M", Predicates.abilities(PartAbility.MUFFLER).setExactLimit(1))
43+
.where('I', Predicates.controller(Predicates.blocks(definition.get())))
44+
.build())
45+
.workableCasingModel("gtceu:block/casings/solid/machine_casing_solid_steel",
46+
"gtceu:block/multiblock/pyrolyse_oven");
47+
48+
})
49+
```
50+
### Lang
51+
52+
```json title="en_us.json"
53+
{
54+
"block.gtceu.superheated_pyrolyzing_oven": "Superheated Pyrolyzing Oven",
55+
}
56+
```
57+
58+
59+
60+
61+

0 commit comments

Comments
 (0)