Skip to content

Commit 624b2e1

Browse files
authored
KubeJS EnderIO wiki (#12)
1 parent 7e69443 commit 624b2e1

25 files changed

+1060
-0
lines changed

wikis.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
{
44
"name": "kubejs-actuallyadditions"
55
},
6+
{
7+
"name": "kubejs-enderio"
8+
},
69
{
710
"name": "lootjs"
811
},
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { defineConfig } from "../../../main/defineAlmostWiki"
2+
3+
export default defineConfig({
4+
srcDir: "./docs",
5+
title: "KubeJS EnderIO",
6+
base: "/kubejs-enderio/",
7+
themeConfig: {
8+
sidebar: [
9+
{
10+
text: "Introduction",
11+
items: [{ text: "Getting Started", link: "/" }],
12+
},
13+
{
14+
text: "Machine Recipes",
15+
items: [
16+
{ text: "Alloy Smelter", link: "machine/alloysmelter" },
17+
{ text: "Enchanter", link: "machine/enchanter" },
18+
{ text: "Painting Machine", link: "machine/paintingmachine" },
19+
{ text: "Sag Mill", link: "machine/sagmill" },
20+
{ text: "Slice'N'Splice", link: "machine/slicensplice" },
21+
{ text: "Soul Binder", link: "machine/soulbinder" },
22+
{ text: "Tank", link: "machine/tank" },
23+
{ text: "Vat", link: "machine/vat" },
24+
],
25+
},
26+
{
27+
text: "Misc Recipes",
28+
items: [{ text: "Fire Crafting", link: "misc/firecrafting" }],
29+
},
30+
{
31+
text: "Events",
32+
items: [{ text: "Conduit Registration", link: "event/conduitregistry" }],
33+
},
34+
{
35+
text: "Bindings",
36+
items: [
37+
{ text: "Fire Crafting Result", link: "binding/firecraftingresult" },
38+
{ text: "Mob Category", link: "binding/mobcategory" },
39+
{ text: "Sag Mill Bonus", link: "binding/sagmillbonus" },
40+
{ text: "Sag Mill Output", link: "binding/sagmilloutput" },
41+
{ text: "Tank Mode", link: "binding/tankmode" },
42+
],
43+
},
44+
],
45+
},
46+
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import Theme from "../../../../main/theme"
3+
export default Theme
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Fire Crafting Result
2+
3+
The `FireCraftingResult` is a utility binding that allows you to easily create `Result`s for [Fire Crafting recipes](../misc/firecrafting.md).
4+
5+
A `Result` is a convenience type added by EnderIO that supports `ItemStack`s with min and max counts, as well as chances.
6+
7+
## Overview
8+
9+
- access in recipes event via: `FireCraftingResult`
10+
- properties:
11+
- `result`
12+
- description: specifies the output item
13+
- type: `ItemStack`
14+
- required: yes
15+
- `minCount`
16+
- description: specifies the minimum count of the output item
17+
- type: `int`
18+
- required: no
19+
- default: `1`
20+
- note: the count of the `ItemStack` is ignored if defined
21+
- `maxCount`
22+
- description: specifies the maximum count of the output item
23+
- type: `int`
24+
- required: no
25+
- default: `1`
26+
- note: the count of the `ItemStack` is ignored if defined
27+
- `chance`
28+
- description: specifies the chance of the output item, between `0` and `1`
29+
- type: `float`
30+
- required: no
31+
- default: `1.0` (100% chance)
32+
- methods:
33+
- `of(ItemStack result, int minCount, int maxCount, float chance)`
34+
- creates a `Result` with the specified item between the specified min and max count, with the specified chance
35+
- `of(ItemStack result, int minCount, int maxCount)`
36+
- creates a `Result` with the specified item between the specified min and max count, with a 100% chance
37+
- `of(ItemStack result, int count)`
38+
- creates a `Result` with the specified item with the specified count, with a 100% chance
39+
- `of(ItemStack result)`
40+
- creates a `Result` with the specified item with the count of the item, with a 100% chance
41+
42+
## Examples
43+
44+
This binding is intended to be used inside [Fire Crafting recipes](../misc/firecrafting.md). Pass it to the `results` parameter to define complex outputs. You
45+
can also store the outputs in a variable and reuse them in multiple recipes.
46+
47+
```js
48+
ServerEvents.recipes(event => {
49+
// creates a Result that outputs 3 stone with a 100% chance
50+
const output1 = FireCraftingResult.of("3x stone")
51+
// creates a Result that outputs 5 diamonds with a 100% chance
52+
const output2 = FireCraftingResult.of("minecraft:diamond", 5)
53+
// creates a Result that outputs 5 to 10 apples with a 100% chance
54+
const output3 = FireCraftingResult.of("apple", 5, 10)
55+
// creates a Result that outputs 2 to 15 carrots with a 25% chance
56+
const output4 = FireCraftingResult.of("carrot", 2, 15, 0.25)
57+
})
58+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Mob Category
2+
3+
The `MobCategory` is a utility binding of a vanilla enumeration that represents the different mob categories in Minecraft.
4+
5+
## Overview
6+
7+
- access via: `MobCategory`
8+
- values:
9+
- `MobCategory.AMBIENT`
10+
- `MobCategory.AXOLOTLS`
11+
- `MobCategory.CREATURE`
12+
- `MobCategory.MISC`
13+
- `MobCategory.MONSTER`
14+
- `MobCategory.UNDERGROUND_WATER_CREATURE`
15+
- `MobCategory.WATER_AMBIENT`
16+
- `MobCategory.WATER_CREATURE`
17+
18+
## Examples
19+
20+
This binding is intended to be used inside [Soul Binder recipes](../machine/soulbinder.md). Pass it to the `mob_category` parameter to define the mob category soul required for the recipe. Since it's a vanilla enumeration, it's not exclusive to the Soul Binder.
21+
22+
```js
23+
ServerEvents.recipes(event => {
24+
event.recipes.enderio
25+
.soul_binding(Item.of("stone", 4), "stick", 5000)
26+
.mobCategory(MobCategory.AXOLOTLS) // [!code focus]
27+
})
28+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Sag Mill Bonus
2+
3+
The `SagMillBonus` is a utility binding that allows you to define the `BonusType` for [Sag Mill recipes](../machine/sagmill.md).
4+
5+
A `BonusType` specifies the behavior of Grinding Balls in Sag Mill recipes.
6+
7+
## Overview
8+
9+
- access via: `SagMillBonus`
10+
- values:
11+
- `SagMillBonus.NONE`
12+
- no multiplier is applied, the recipe will always output the defined outputs with the specified chances
13+
- `SagMillBonus.CHANCE_ONLY`
14+
- only the bonus multiplier of the Grinding Ball is applied, the output count remains unchanged
15+
- `SagMillBonus.MULTIPLY_OUTPUT`
16+
- the output multiplier and the bonus multiplier of the Grinding Ball are applied
17+
18+
## Examples
19+
20+
This binding is intended to be used inside [Sag Mill recipes](../machine/sagmill.md). Pass it to the `bonus` parameter to define the bonus type of the recipe.
21+
It's also possible to use the strings `"NONE"`, `"CHANCE_ONLY"`, and `"MULTIPLY_OUTPUT"` instead of the binding.
22+
23+
```js
24+
ServerEvents.recipes(event => {
25+
event.recipes.enderio
26+
.sag_milling(["stick"], "white_wool")
27+
.energy(500)
28+
.bonus(SagMillBonus.MULTIPLY_OUTPUT) // [!code focus]
29+
})
30+
```
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Sag Mill Output
2+
3+
The `SagMillOutput` is a utility binding that allows you to easily create `OutputItem`s for [Sag Mill recipes](../machine/sagmill.md).
4+
5+
An `OutputItem` is a convenience type added by EnderIO that supports `ItemStack`s and `TagKey`s. Its main purpose is to allow the usage of tags
6+
as outputs in Sag Mill recipes. This way, EnderIO doesn't need to add a material for every compat recipe they have. Instead they can use the respective tag.
7+
8+
It also supports chance-based outputs which can be useful for something like byproducts.
9+
10+
## Overview
11+
12+
- access in recipes event via: `SagMillOutput`
13+
- properties:
14+
- `output`
15+
- description: specifies the output item or tag
16+
- type: `ItemStack | TagKey`
17+
- required: yes
18+
- `count`
19+
- description: specifies the count of the output item, only required when using a tag
20+
- type: `int`
21+
- required: no
22+
- default: `1`
23+
- `chance`
24+
- description: specifies the chance of the output item, between `0` and `1`
25+
- type: `float`
26+
- required: no
27+
- default: `1.0` (100% chance)
28+
- `optional`
29+
- description: this property is currently unused and has no effect
30+
- type: `boolean`
31+
- required: no
32+
- default: `false`
33+
- methods:
34+
- `of(ItemStack output, float chance, boolean optional)`
35+
- creates an `OutputItem` with a chance-based output and the optional property
36+
- `of(ItemStack output, float chance)`
37+
- creates an `OutputItem` with a chance-based output (sets optional to false)
38+
- `of(ItemStack output)`
39+
- creates an `OutputItem` with a guaranteed output (100% chance) (sets optional to false)
40+
- `ofTag(TagKey output, int count, float chance, boolean optional)`
41+
- creates an `OutputItem` with a chance-based output using a tag and the optional property
42+
- `ofTag(TagKey output, int count, float chance)`
43+
- creates an `OutputItem` with a chance-based output using a tag (sets optional to false)
44+
- `ofTag(TagKey output, int count)`
45+
- creates an `OutputItem` with a guaranteed output (100% chance) using a tag (sets optional to false)
46+
47+
## Examples
48+
49+
This binding is intended to be used inside [Sag Mill recipes](../machine/sagmill.md). Pass it to the `outputs` parameter to define complex outputs. You
50+
can also store the outputs in a variable and reuse them in multiple recipes.
51+
52+
```js
53+
ServerEvents.recipes(event => {
54+
// creates an OutputItem that outputs 3 stone with a 50% chance
55+
const output1 = SagMillOutput.of("3x stone", 0.5)
56+
// creates an OutputItem that outputs 1 diamond with a 100% chance
57+
const output2 = SagMillOutput.of("minecraft:diamond")
58+
// creates an OutputItem that outputs 5 items from the tag #c:glass_blocks
59+
const output3 = SagMillOutput.ofTag("#c:glass_blocks", 5)
60+
// creates an OutputItem that outputs 2 items from the tag #c:ingots with a 25% chance
61+
const output4 = SagMillOutput.ofTag("#c:ingots", 2, 0.25)
62+
})
63+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Tank Mode
2+
3+
The `TankMode` is a utility binding that allows you to define the `Mode` for [Tank recipes](../machine/tank.md).
4+
5+
A `Mode` specifies the behavior of the tank in the recipe.
6+
7+
## Overview
8+
9+
- access via: `TankMode`
10+
- values:
11+
- `TankMode.FILL`
12+
- the recipe will fill the item with the specified fluid from the Tank
13+
- `TankMode.EMPTY`
14+
- the recipe will drain the fluid from the item into the Tank
15+
16+
## Examples
17+
18+
This binding is intended to be used inside [Tank recipes](../machine/tank.md). Pass it to the `mode` parameter to define the mode of the recipe.
19+
It's also possible to use the strings `"FILL"` and `"EMPTY"` instead of the binding.
20+
21+
```js
22+
ServerEvents.recipes(event => {
23+
event.recipes.enderio.tank("stick", "white_wool", "water", TankMode.FILL)
24+
})
25+
```
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Conduit Registry Event
2+
3+
This event allows you to register custom conduits.
4+
5+
**It is a server event and reloadable!**
6+
Keep in mind that server events have to be located inside the `kubejs/server_scripts` folder.
7+
8+
## Overview
9+
10+
EnderIO for 1.21.1 and above supports data-driven conduits by default. This event adds convenience methods to register custom conduits via KubeJS.
11+
12+
It automatically generates the required JSON files for the conduit as well as the language file entry. The only thing you have to provide is a texture
13+
for your custom conduit.
14+
15+
- access in a server script via: `EnderIOEvents.conduits`
16+
- supported conduits
17+
- energy conduit
18+
- fluid conduit
19+
- chemical conduit (Mekanism)
20+
- ME conduit (Applied Energistics 2)
21+
22+
## Registration
23+
24+
To register a custom conduit, the first thing you need to do is to open an event listener for the `conduits` event in a server script.
25+
26+
```js
27+
EnderIOEvents.conduits(event => {
28+
// ...
29+
})
30+
```
31+
32+
After that, use one of the following methods to register the respective conduit type. All conduits need an `id` that is used as the registry name and a
33+
`name` that is used for the automatic language file entry generation.
34+
35+
The custom conduit will be part of the normal EnderIO Conduits creative tab. Recipes are **not** generated automatically. You have to add a recipe
36+
for your custom conduits yourself!
37+
38+
### Energy Conduit
39+
40+
- `transferRate` - specifies the transfer rate of energy per tick
41+
42+
```js
43+
EnderIOEvents.conduits(event => {
44+
event.registerEnergyConduit(String id, String name, int transferRate); // [!code focus]
45+
});
46+
```
47+
48+
### Fluid Conduit
49+
50+
- `transferRate` - specifies the transfer rate of fluid per tick
51+
- `multiFluid` - specifies whether the conduit can transport multiple fluids at once
52+
- `supportPriority` - specifies whether the conduit supports priority settings
53+
54+
```js
55+
EnderIOEvents.conduits(event => {
56+
event.registerFluidConduit(String id, String name, int transferRate, boolean multiFluid, boolean supportPriority); // [!code focus]
57+
});
58+
```
59+
60+
### Chemical Conduit
61+
62+
- `transferRate` - specifies the transfer rate of chemical per tick
63+
- `multiChemical` - specifies whether the conduit can transport multiple chemicals at once
64+
65+
```js
66+
EnderIOEvents.conduits(event => {
67+
event.registerChemicalConduit(String id, String name, int transferRate, boolean multiChemical); // [!code focus]
68+
});
69+
```
70+
71+
### ME Conduit
72+
73+
- `color` - specifies the AE2 color conduit transports channels for
74+
- this needs to be a value from the `AEColor` enum, for universal color use `TRANSPARENT`
75+
- possible values: `BLACK`, `BLUE`, `BROWN`, `CYAN`, `GRAY`, `GREEN`, `LIGHT_BLUE`, `LIGHT_GRAY`, `LIME`, `MAGENTA`, `ORANGE`, `PINK`, `PURPLE`, `RED`, `TRANSPARENT`, `WHITE`, `YELLOW`
76+
- `dense` - specifies whether the conduit is a dense ME conduit (32 channels) or a normal one (8 channels)
77+
78+
```js
79+
EnderIOEvents.conduits(event => {
80+
event.registerMeConduit(String id, String name, String color, boolean dense); // [!code focus]
81+
});
82+
```
83+
84+
## Texture
85+
86+
After registering the custom conduit inside the event, the language file as well as the model file are automatically generated. The
87+
only things you have to provide are the textures.
88+
89+
### Block Texture
90+
91+
For the block of the conduit, the texture file needs to be placed inside the following directory:
92+
`kubejs/assets/enderio/textures/block/conduit`
93+
94+
It needs to have the same name as the `id` parameter you used when registering the custom conduit. Make sure it's a valid `.png` file.
95+
You can download a template PSD file [here](files/conduit.psd).
96+
97+
### Conduit Icon
98+
99+
For the icon inside the conduit GUI, you need to provide an additional texture file. It has to be placed in the following directory:
100+
`kubejs/assets/enderio/textures/conduit_icon`
101+
102+
Once again, the texture should have the same name as your conduit `id`. Make sure to crop the texture accordingly so it only consists of the actual icon.
103+
104+
## Example
105+
106+
In this example, we add the _Stellar Energy Conduit_ with the id `enderio:stellar_conduit` and a transfer rate of `50000` RF/t.
107+
108+
```js
109+
EnderIOEvents.conduits(event => {
110+
event.registerEnergyConduit("stellar_conduit", "Stellar Energy Conduit", 50000)
111+
})
112+
```
113+
114+
Texture:
115+
![](/../img/texture.png)
116+
117+
Creative Tab:
118+
![](/../img/creative_tab.png)
119+
120+
Connection:
121+
![](/../img/connection.png)
122+
123+
GUI:
124+
![](/../img/gui.png)

0 commit comments

Comments
 (0)