zen-flow 1.15.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -6
- package/dist/zenflow.cjs +126 -126
- package/dist/zenflow.d.ts +109 -93
- package/dist/zenflow.mjs +126 -126
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,7 @@ Array.from({ length: 11 })
|
|
|
87
87
|
|
|
88
88
|
## API
|
|
89
89
|
|
|
90
|
+
- Types(#types)
|
|
90
91
|
- MineCraft
|
|
91
92
|
- [Vanilla](#vanilla)
|
|
92
93
|
- [Crafting patterns](#craftingpatterns)
|
|
@@ -100,6 +101,52 @@ Array.from({ length: 11 })
|
|
|
100
101
|
- [NEI](#nei)
|
|
101
102
|
- [ThermalExpansion](#thermalexpansion)
|
|
102
103
|
|
|
104
|
+
## Types
|
|
105
|
+
|
|
106
|
+
```TS
|
|
107
|
+
type Stack = {
|
|
108
|
+
id: string,
|
|
109
|
+
n: number
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
type Ingredient = string | Stack;
|
|
113
|
+
|
|
114
|
+
type RecipeShaped = Partial<{
|
|
115
|
+
1: string
|
|
116
|
+
2: string
|
|
117
|
+
3: string
|
|
118
|
+
4: string
|
|
119
|
+
5: string
|
|
120
|
+
6: string
|
|
121
|
+
7: string
|
|
122
|
+
8: string
|
|
123
|
+
9: string
|
|
124
|
+
corner: string
|
|
125
|
+
edge: string
|
|
126
|
+
ring: string
|
|
127
|
+
square: string
|
|
128
|
+
center: string
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
type RecipeShapeless = string[];
|
|
132
|
+
|
|
133
|
+
type Recipe = RecipeShaped | RecipeShapeless;
|
|
134
|
+
|
|
135
|
+
type Enchantment = {
|
|
136
|
+
type: keyof typeof ENCHANTMENTS
|
|
137
|
+
level?: number | string
|
|
138
|
+
short?: boolean
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
type TextRich = {
|
|
142
|
+
text: string
|
|
143
|
+
color?: typeof COLORS[number],
|
|
144
|
+
format?: typeof FORMATS[number]
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
type Text = string | TextRich;
|
|
148
|
+
```
|
|
149
|
+
|
|
103
150
|
## Vanilla
|
|
104
151
|
|
|
105
152
|
- `add` - Add a crafting table recipe.
|
|
@@ -184,15 +231,15 @@ Shaped crafting recipes support the following shorthand patterns, in order:
|
|
|
184
231
|
withName('<minecraft:bread>', 'Bread');
|
|
185
232
|
|
|
186
233
|
// Bread (with red text)
|
|
187
|
-
withName('<minecraft:bread>',
|
|
234
|
+
withName('<minecraft:bread>', { text: 'Bread', colour: 'red' });
|
|
188
235
|
|
|
189
236
|
// Bread (bold red text)
|
|
190
|
-
withName('<minecraft:bread>',
|
|
237
|
+
withName('<minecraft:bread>', { text: 'Bread', colour: 'red', format: 'bold' });
|
|
191
238
|
|
|
192
239
|
// Bread (normal text) with butter (yellow italic text)
|
|
193
240
|
withName('<minecraft:bread>', [
|
|
194
241
|
'Bread',
|
|
195
|
-
|
|
242
|
+
{ text: 'with butter', colour: 'yellow', format: 'italic' }
|
|
196
243
|
]);
|
|
197
244
|
```
|
|
198
245
|
|
|
@@ -227,10 +274,10 @@ withName('<minecraft:bread>', [
|
|
|
227
274
|
import { exnihilo } from 'zen-flow';
|
|
228
275
|
|
|
229
276
|
exnilo.addHammer('<minecraft:cobblestone>', {
|
|
230
|
-
'<minecraft:stick>':
|
|
277
|
+
'<minecraft:stick>': 0.5, // 50%
|
|
231
278
|
'<minecraft:bread>': [1, 1, 0.5] // 100%, 100%, 50%
|
|
232
|
-
'<minecraft:stone>': [
|
|
233
|
-
'<minecraft:coal>': [
|
|
279
|
+
'<minecraft:stone>': [{ chance: 1, modifier: 2 }, { chance: 0.5, modifier: 1 }] // 100% with 2x modifier, 50% with 1x modifier
|
|
280
|
+
'<minecraft:coal>': [{ chance: 1, modifier: 2 }, 1] // 100% with 2x modifier, 100%
|
|
234
281
|
});
|
|
235
282
|
|
|
236
283
|
exnihilo.addSieve('<minecraft:cobblestone>', {
|
|
@@ -276,3 +323,5 @@ exnihilo.addSieve('<minecraft:cobblestone>', {
|
|
|
276
323
|
- `removeTransposerFill` - Remove Fluid Transposer fill recipe
|
|
277
324
|
- `addTransposerExtract` - Add Fluid Transposer extract recipe
|
|
278
325
|
- `removeTransposerExtract` - Remove Fluid Transposer extract recipe
|
|
326
|
+
|
|
327
|
+
<i>* All bonus properties take a number between 1 and 100</i>
|
package/dist/zenflow.cjs
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const createCode = (code) => `\\u00A7${code}`;
|
|
6
6
|
const createFormat = (type) => (tooltip) => `format.${type}(${tooltip})`;
|
|
7
|
-
const
|
|
7
|
+
const NAME_COLOR = {
|
|
8
8
|
black: createCode("0"),
|
|
9
9
|
darkBlue: createCode("1"),
|
|
10
10
|
darkGreen: createCode("2"),
|
|
@@ -22,7 +22,15 @@ const NAME_COLOUR = {
|
|
|
22
22
|
yellow: createCode("e"),
|
|
23
23
|
white: createCode("f")
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const NAME_FORMAT = {
|
|
26
|
+
obfuscated: createCode("k"),
|
|
27
|
+
bold: createCode("l"),
|
|
28
|
+
strikethrough: createCode("m"),
|
|
29
|
+
underline: createCode("n"),
|
|
30
|
+
italic: createCode("o"),
|
|
31
|
+
reset: createCode("r")
|
|
32
|
+
};
|
|
33
|
+
const TOOLTIP_COLOR = {
|
|
26
34
|
black: createFormat("black"),
|
|
27
35
|
darkBlue: createFormat("darkBlue"),
|
|
28
36
|
darkGreen: createFormat("darkGreen"),
|
|
@@ -40,14 +48,6 @@ const TOOLTIP_COLOUR = {
|
|
|
40
48
|
yellow: createFormat("yellow"),
|
|
41
49
|
white: createFormat("white")
|
|
42
50
|
};
|
|
43
|
-
const NAME_FORMAT = {
|
|
44
|
-
obfuscated: createCode("k"),
|
|
45
|
-
bold: createCode("l"),
|
|
46
|
-
strikethrough: createCode("m"),
|
|
47
|
-
underline: createCode("n"),
|
|
48
|
-
italic: createCode("o"),
|
|
49
|
-
reset: createCode("r")
|
|
50
|
-
};
|
|
51
51
|
const TOOLTIP_FORMAT = {
|
|
52
52
|
obfuscated: createFormat("obfuscated"),
|
|
53
53
|
bold: createFormat("bold"),
|
|
@@ -98,41 +98,41 @@ const MFR_FOCI = {
|
|
|
98
98
|
black: 15
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const
|
|
101
|
+
const clamp = (min, max, n) => Math.max(min, Math.min(max, n));
|
|
102
|
+
const fill = (n, x) => Array.from({ length: n }).map((_, i) => x ?? i);
|
|
103
|
+
const toArray = (x) => Array.isArray(x) ? x : [x];
|
|
104
|
+
const isObject = (x) => typeof x === "object" && !Array.isArray(x);
|
|
104
105
|
|
|
105
|
-
const
|
|
106
|
+
const formatLiteral = (x) => `"${x}"`;
|
|
107
|
+
const formatId = (id) => id ?? "null";
|
|
108
|
+
const formatStack = (stack) => `${stack.id} * ${stack.n}`;
|
|
109
|
+
const formatIngredient = (ingredient) => isObject(ingredient) ? formatStack(ingredient) : ingredient;
|
|
106
110
|
const formatList = (list) => `[${list.join(", ")}]`;
|
|
107
|
-
const formatIngredient = (ingredient) => ingredient ?? "null";
|
|
108
111
|
const formatEnchantment = (enchantment) => {
|
|
109
112
|
const id = `${ENCHANTMENTS[enchantment.type]}${enchantment.short ? " as short" : ""}`;
|
|
110
113
|
const lvl = `${enchantment.level ?? 1}${enchantment.level ? " as short" : ""}`;
|
|
111
114
|
return `{ id: ${id}, lvl: ${lvl} }`;
|
|
112
115
|
};
|
|
113
116
|
const formatName = (texts) => {
|
|
114
|
-
const
|
|
115
|
-
text
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const formatted = texts.map((text) => typeof text === "string" ? text : format(text)).join("");
|
|
117
|
+
const formatted = toArray(texts).map((text) => {
|
|
118
|
+
if (typeof text === "string")
|
|
119
|
+
return text;
|
|
120
|
+
return [
|
|
121
|
+
text.color && NAME_COLOR[text.color],
|
|
122
|
+
text.format && NAME_FORMAT[text.format],
|
|
123
|
+
text.text,
|
|
124
|
+
(text.color || text.format) && NAME_FORMAT.reset
|
|
125
|
+
].filter((x) => x !== void 0).join("");
|
|
126
|
+
}).join("");
|
|
125
127
|
return `"${formatted}"`;
|
|
126
128
|
};
|
|
127
|
-
const formatTooltip = (texts) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
};
|
|
135
|
-
const formatRecipeShaped = (recipe) => {
|
|
129
|
+
const formatTooltip = (texts) => toArray(texts).map((text) => {
|
|
130
|
+
if (typeof text === "string")
|
|
131
|
+
return formatLiteral(text);
|
|
132
|
+
const format = text.format ? TOOLTIP_FORMAT[text.format](formatLiteral(text.text)) : formatLiteral(text.text);
|
|
133
|
+
return TOOLTIP_COLOR[text.color ?? "gray"](format);
|
|
134
|
+
}).join(" + ");
|
|
135
|
+
const formatRecipe = (recipe) => {
|
|
136
136
|
const matrix = [[
|
|
137
137
|
recipe.square || recipe.ring || recipe.corner || recipe[1],
|
|
138
138
|
recipe.square || recipe.ring || recipe.edge || recipe[2],
|
|
@@ -145,165 +145,165 @@ const formatRecipeShaped = (recipe) => {
|
|
|
145
145
|
recipe.ring || recipe.corner || recipe[7],
|
|
146
146
|
recipe.ring || recipe.edge || recipe[8],
|
|
147
147
|
recipe.ring || recipe.corner || recipe[9]
|
|
148
|
-
]].map((row) => formatList(row.map(
|
|
148
|
+
]].map((row) => formatList(row.map(formatId)));
|
|
149
149
|
return `[
|
|
150
150
|
${matrix.join(",\n ")}
|
|
151
151
|
]`;
|
|
152
152
|
};
|
|
153
153
|
const formatArgs = (...args) => {
|
|
154
|
-
const list = args.filter((
|
|
155
|
-
if (typeof arg === "number")
|
|
156
|
-
return `${arg}`;
|
|
157
|
-
if (isRecipeShaped(arg))
|
|
158
|
-
return formatRecipeShaped(arg);
|
|
159
|
-
if (isItem(arg))
|
|
160
|
-
return formatItem(arg);
|
|
161
|
-
if (Array.isArray(arg))
|
|
162
|
-
return formatList(arg);
|
|
163
|
-
return arg;
|
|
164
|
-
});
|
|
154
|
+
const list = args.filter((x) => x !== void 0).map((x) => Array.isArray(x) ? formatList(x) : x);
|
|
165
155
|
return list.length > 3 ? `
|
|
166
156
|
${list.join(",\n ")}
|
|
167
157
|
` : list.join(", ");
|
|
168
158
|
};
|
|
169
159
|
|
|
170
|
-
const addCompressor = (recipe) => `mods.avaritia.Compressor.add(${formatArgs(recipe.out, recipe.in
|
|
171
|
-
const removeCompressor = (
|
|
172
|
-
const addExtreme = (
|
|
173
|
-
const out = formatArgs(
|
|
160
|
+
const addCompressor = (recipe) => `mods.avaritia.Compressor.add(${formatArgs(recipe.out, recipe.in.n, recipe.in.id)});`;
|
|
161
|
+
const removeCompressor = (id) => `mods.avaritia.Compressor.remove(${id});`;
|
|
162
|
+
const addExtreme = (ingredient, recipe) => {
|
|
163
|
+
const out = formatArgs(formatIngredient(ingredient), recipe.map((row) => formatList(row.map(formatId))));
|
|
174
164
|
return `mods.avaritia.ExtremeCrafting.addShaped(${out});`;
|
|
175
165
|
};
|
|
176
|
-
const removeExtreme = (
|
|
177
|
-
|
|
178
|
-
const clamp = (min, max, n) => Math.max(min, Math.min(max, n));
|
|
179
|
-
const fill = (n, x) => Array.from({ length: n }).map((_, i) => x ?? i);
|
|
166
|
+
const removeExtreme = (id) => `mods.avaritia.ExtremeCrafting.remove(${id});`;
|
|
180
167
|
|
|
181
168
|
const addComposter = (recipe) => {
|
|
182
|
-
const out = formatArgs(recipe
|
|
169
|
+
const out = formatArgs(recipe.id, clamp(0, 1, recipe.fill), recipe.hex && `"${recipe.hex}"`);
|
|
183
170
|
return `mods.exnihilo.Composting.addRecipe(${out});`;
|
|
184
171
|
};
|
|
185
|
-
const removeComposter = (
|
|
186
|
-
const addCrucible$1 = (recipe) =>
|
|
187
|
-
const
|
|
172
|
+
const removeComposter = (id) => `mods.exnihilo.Composting.removeRecipe(${id});`;
|
|
173
|
+
const addCrucible$1 = (recipe) => {
|
|
174
|
+
const out = formatArgs(recipe.id, formatStack(recipe.liquid));
|
|
175
|
+
return `mods.exnihilo.Crucible.addRecipe(${out});`;
|
|
176
|
+
};
|
|
177
|
+
const removeCrucible$1 = (id) => `mods.exnihilo.Crucible.removeRecipe(${id});`;
|
|
188
178
|
const addCrucibleSource = (recipe) => {
|
|
189
|
-
const out = formatArgs(recipe
|
|
179
|
+
const out = formatArgs(recipe.id, clamp(0, 1, recipe.n));
|
|
190
180
|
return `mods.exnihilo.Crucible.addHeatSource(${out});`;
|
|
191
181
|
};
|
|
192
|
-
const removeCrucibleSource = (
|
|
193
|
-
const addHammer = (
|
|
194
|
-
const items = Object.entries(recipe).map((entry) => entry[1].map((chance) => ({
|
|
195
|
-
|
|
196
|
-
chance: clamp(0, 1,
|
|
197
|
-
modifier:
|
|
182
|
+
const removeCrucibleSource = (id) => `mods.exnihilo.Crucible.removeHeatSource(${id});`;
|
|
183
|
+
const addHammer = (id, recipe) => {
|
|
184
|
+
const items = Object.entries(recipe).map((entry) => toArray(entry[1]).map((chance) => ({
|
|
185
|
+
id: entry[0],
|
|
186
|
+
chance: clamp(0, 1, isObject(chance) ? chance.chance : chance),
|
|
187
|
+
modifier: isObject(chance) ? chance.modifier : 1
|
|
198
188
|
}))).flat();
|
|
199
|
-
const out = formatArgs(
|
|
189
|
+
const out = formatArgs(id, items.map((item) => item.id), items.map((item) => item.chance), items.map((item) => item.modifier));
|
|
200
190
|
return `mods.exnihilo.Hammer.addRecipe(${out});`;
|
|
201
191
|
};
|
|
202
|
-
const removeHammer = (
|
|
203
|
-
const addSieve = (
|
|
192
|
+
const removeHammer = (id) => `mods.exnihilo.Hammer.removeRecipe(${id});`;
|
|
193
|
+
const addSieve = (id, recipe) => {
|
|
204
194
|
const items = Object.entries(recipe).map((entry) => fill(Math.ceil(entry[1])).map((i) => ({
|
|
205
|
-
|
|
195
|
+
id: entry[0],
|
|
206
196
|
chance: entry[1] - i < 1 ? Math.round(1 / (entry[1] - i)) : 1
|
|
207
197
|
}))).flat();
|
|
208
|
-
const out = formatArgs(
|
|
198
|
+
const out = formatArgs(id, items.map((item) => item.id), items.map((item) => item.chance));
|
|
209
199
|
return `mods.exnihilo.Sieve.addRecipe(${out});`;
|
|
210
200
|
};
|
|
211
|
-
const removeSieve = (
|
|
201
|
+
const removeSieve = (id) => `mods.exnihilo.Sieve.removeRecipe(${id});`;
|
|
212
202
|
|
|
213
|
-
const addQED = (
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
203
|
+
const addQED = (ingredient, recipe) => {
|
|
204
|
+
const out = formatArgs(formatIngredient(ingredient), formatRecipe(recipe));
|
|
205
|
+
return `mods.extraUtils.QED.addShapedRecipe(${out});`;
|
|
206
|
+
};
|
|
207
|
+
const removeQED = (id) => `mods.extraUtils.QED.removeRecipe(${id});`;
|
|
208
|
+
const replaceQED = (ingredient, recipe) => [
|
|
209
|
+
removeQED(Array.isArray(ingredient) ? ingredient[0] : ingredient),
|
|
210
|
+
addQED(ingredient, recipe)
|
|
218
211
|
].join("\n");
|
|
219
212
|
|
|
220
|
-
const addDict = (dict,
|
|
221
|
-
const removeDict = (dict,
|
|
222
|
-
const withName = (
|
|
223
|
-
const withTooltip = (
|
|
224
|
-
const withTooltipShift = (
|
|
225
|
-
const withTag = (tag) => (
|
|
226
|
-
const
|
|
227
|
-
const enchantments = Array.isArray(enchantment) ? enchantment : [enchantment];
|
|
228
|
-
return withTag(`{ ench: ${formatList(enchantments.map(formatEnchantment))} }`);
|
|
229
|
-
};
|
|
213
|
+
const addDict = (dict, ids) => ids.map((id) => `${dict}.add(${id});`).join("\n");
|
|
214
|
+
const removeDict = (dict, ids) => ids.map((id) => `${dict}.remove(${id});`).join("\n");
|
|
215
|
+
const withName = (id, name) => `${id}.displayName = ${formatName(name)};`;
|
|
216
|
+
const withTooltip = (id, tooltips) => toArray(tooltips).map((tooltip) => `${id}.addTooltip(${formatTooltip(tooltip)});`).join("\n");
|
|
217
|
+
const withTooltipShift = (id, tooltips) => toArray(tooltips).map((tooltip) => `${id}.addShiftTooltip(${formatTooltip(tooltip)});`).join("\n");
|
|
218
|
+
const withTag = (tag) => (id) => `${id}.withTag(${tag})`;
|
|
219
|
+
const withEnchantment = (enchantments) => withTag(`{ ench: ${formatList(toArray(enchantments).map(formatEnchantment))} }`);
|
|
230
220
|
|
|
231
|
-
const addLaser = (
|
|
232
|
-
const removeLaser = (
|
|
233
|
-
const addFoci = (
|
|
234
|
-
const removeFoci = (
|
|
221
|
+
const addLaser = (ingredient) => `MiningLaser.addOre(${formatArgs(formatIngredient(ingredient))});`;
|
|
222
|
+
const removeLaser = (id) => `MiningLaser.removeOre(${id});`;
|
|
223
|
+
const addFoci = (foci, ids) => ids.map((id) => `MiningLaser.addPreferredOre(${formatArgs(MFR_FOCI[foci], id)});`).join("\n");
|
|
224
|
+
const removeFoci = (foci, ids) => ids.map((id) => `MiningLaser.removePreferredOre(${formatArgs(MFR_FOCI[foci], id)});`).join("\n");
|
|
235
225
|
|
|
236
|
-
const hide = (
|
|
237
|
-
const addNEI = (
|
|
226
|
+
const hide = (id) => `NEI.hide(${id});`;
|
|
227
|
+
const addNEI = (id) => `NEI.addEntry(${id});`;
|
|
238
228
|
|
|
239
229
|
const addCrucible = (recipe) => {
|
|
240
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.liquid);
|
|
230
|
+
const out = formatArgs(recipe.rf, recipe.in, formatStack(recipe.liquid));
|
|
241
231
|
return `mods.thermalexpansion.Crucible.addRecipe(${out});`;
|
|
242
232
|
};
|
|
243
|
-
const removeCrucible = (
|
|
233
|
+
const removeCrucible = (id) => `mods.thermalexpansion.Crucible.removeRecipe(${id});`;
|
|
244
234
|
const addFurnace$1 = (recipe) => {
|
|
245
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out);
|
|
235
|
+
const out = formatArgs(recipe.rf, recipe.in, formatIngredient(recipe.out));
|
|
246
236
|
return `mods.thermalexpansion.Furnace.addRecipe(${out});`;
|
|
247
237
|
};
|
|
248
|
-
const removeFurnace$1 = (
|
|
238
|
+
const removeFurnace$1 = (id) => `mods.thermalexpansion.Furnace.removeRecipe(${id});`;
|
|
249
239
|
const addInsolator = (recipe) => {
|
|
250
|
-
const out = formatArgs(recipe.rf, recipe.left, recipe.right, recipe.out, recipe.bonus && recipe.bonus
|
|
240
|
+
const out = formatArgs(recipe.rf, formatIngredient(recipe.left), formatIngredient(recipe.right), formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
251
241
|
return `mods.thermalexpansion.Insolator.addRecipe(${out});`;
|
|
252
242
|
};
|
|
253
|
-
const removeInsolator = (left, right) =>
|
|
243
|
+
const removeInsolator = (left, right) => {
|
|
244
|
+
const out = formatArgs(formatIngredient(left), formatIngredient(right));
|
|
245
|
+
return `mods.thermalexpansion.Insolator.removeRecipe(${out});`;
|
|
246
|
+
};
|
|
254
247
|
const addPulverizer = (recipe) => {
|
|
255
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out, recipe.bonus && recipe.bonus
|
|
248
|
+
const out = formatArgs(recipe.rf, recipe.in, formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
256
249
|
return `mods.thermalexpansion.Pulverizer.addRecipe(${out});`;
|
|
257
250
|
};
|
|
258
|
-
const removePulverizer = (
|
|
251
|
+
const removePulverizer = (id) => `mods.thermalexpansion.Pulverizer.removeRecipe(${id});`;
|
|
259
252
|
const addSawmill = (recipe) => {
|
|
260
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out, recipe.bonus && recipe.bonus
|
|
253
|
+
const out = formatArgs(recipe.rf, recipe.in, formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
261
254
|
return `mods.thermalexpansion.Sawmill.addRecipe(${out});`;
|
|
262
255
|
};
|
|
263
|
-
const removeSawmill = (
|
|
256
|
+
const removeSawmill = (id) => `mods.thermalexpansion.Sawmill.removeRecipe(${id});`;
|
|
264
257
|
const addSmelter = (recipe) => {
|
|
265
|
-
const out = formatArgs(recipe.rf, recipe.right, recipe.left, recipe.out, recipe.bonus && recipe.bonus
|
|
258
|
+
const out = formatArgs(recipe.rf, formatIngredient(recipe.right), formatIngredient(recipe.left), formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
266
259
|
return `mods.thermalexpansion.Smelter.addRecipe(${out});`;
|
|
267
260
|
};
|
|
268
|
-
const removeSmelter = (left, right) =>
|
|
261
|
+
const removeSmelter = (left, right) => {
|
|
262
|
+
const out = formatArgs(formatIngredient(left), formatIngredient(right));
|
|
263
|
+
return `mods.thermalexpansion.Smelter.removeRecipe(${out});`;
|
|
264
|
+
};
|
|
269
265
|
const addTransposerFill = (recipe) => {
|
|
270
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out, recipe.liquid);
|
|
266
|
+
const out = formatArgs(recipe.rf, recipe.in, recipe.out, formatStack(recipe.liquid));
|
|
271
267
|
return `mods.thermalexpansion.Transposer.addFillRecipe(${out});`;
|
|
272
268
|
};
|
|
273
|
-
const removeTransposerFill = (
|
|
269
|
+
const removeTransposerFill = (id, liquid) => `mods.thermalexpansion.Transposer.removeFillRecipe(${formatArgs(id, liquid)});`;
|
|
274
270
|
const addTransposerExtract = (recipe) => {
|
|
275
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.liquid, recipe.bonus && recipe.bonus
|
|
271
|
+
const out = formatArgs(recipe.rf, recipe.in, formatStack(recipe.liquid), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
276
272
|
return `mods.thermalexpansion.Transposer.addExtractRecipe(${out});`;
|
|
277
273
|
};
|
|
278
|
-
const removeTransposerExtract = (
|
|
274
|
+
const removeTransposerExtract = (id) => `mods.thermalexpansion.Transposer.removeExtractRecipe(${id});`;
|
|
279
275
|
|
|
280
276
|
const add = (item, recipe) => {
|
|
281
277
|
const type = Array.isArray(recipe) ? "Shapeless" : "Shaped";
|
|
282
|
-
|
|
278
|
+
const out = formatArgs(formatIngredient(item), Array.isArray(recipe) ? formatList(recipe) : formatRecipe(recipe));
|
|
279
|
+
return `recipes.add${type}(${out});`;
|
|
280
|
+
};
|
|
281
|
+
const remove = (id) => `recipes.remove(${id});`;
|
|
282
|
+
const removeShaped = (id) => `recipes.removeShaped(${id});`;
|
|
283
|
+
const removeShapeless = (id) => `recipes.removeShapeless(${id});`;
|
|
284
|
+
const addFurnace = (recipe) => {
|
|
285
|
+
const out = formatArgs(formatIngredient(recipe.out), recipe.in);
|
|
286
|
+
return `furnace.addRecipe(${out});`;
|
|
283
287
|
};
|
|
284
|
-
const remove = (ingredient) => `recipes.remove(${ingredient});`;
|
|
285
|
-
const removeShaped = (ingredient) => `recipes.removeShaped(${ingredient});`;
|
|
286
|
-
const removeShapeless = (ingredient) => `recipes.removeShapeless(${ingredient});`;
|
|
287
|
-
const addFurnace = (recipe) => `furnace.addRecipe(${formatArgs(recipe.out, recipe.in)});`;
|
|
288
288
|
const removeFurnace = (recipe) => {
|
|
289
289
|
if (typeof recipe === "string")
|
|
290
290
|
return `furnace.remove(<*>, ${recipe});`;
|
|
291
|
-
return `furnace.remove(${formatArgs(recipe.out, recipe.in)})
|
|
291
|
+
return `furnace.remove(${formatArgs(recipe.out, recipe.in)});`;
|
|
292
292
|
};
|
|
293
|
-
const replace = (
|
|
294
|
-
const
|
|
293
|
+
const replace = (ingredient, recipe) => {
|
|
294
|
+
const id = isObject(ingredient) ? ingredient.id : ingredient;
|
|
295
295
|
return [
|
|
296
|
-
Array.isArray(recipe) ? removeShapeless(
|
|
297
|
-
add(
|
|
296
|
+
Array.isArray(recipe) ? removeShapeless(id) : removeShaped(id),
|
|
297
|
+
add(ingredient, recipe)
|
|
298
298
|
].join("\n");
|
|
299
299
|
};
|
|
300
|
-
const replaceAll = (
|
|
301
|
-
remove(
|
|
302
|
-
add(
|
|
300
|
+
const replaceAll = (ingredient, recipe) => [
|
|
301
|
+
remove(isObject(ingredient) ? ingredient.id : ingredient),
|
|
302
|
+
add(ingredient, recipe)
|
|
303
303
|
].join("\n");
|
|
304
|
-
const replaceMany = (
|
|
305
|
-
remove(
|
|
306
|
-
...recipes.map((recipe) => add(
|
|
304
|
+
const replaceMany = (ingredient, recipes) => [
|
|
305
|
+
remove(isObject(ingredient) ? ingredient.id : ingredient),
|
|
306
|
+
...recipes.map((recipe) => add(ingredient, recipe))
|
|
307
307
|
].join("\n");
|
|
308
308
|
|
|
309
309
|
exports.add = add;
|
|
@@ -356,7 +356,7 @@ exports.replace = replace;
|
|
|
356
356
|
exports.replaceAll = replaceAll;
|
|
357
357
|
exports.replaceMany = replaceMany;
|
|
358
358
|
exports.replaceQED = replaceQED;
|
|
359
|
-
exports.
|
|
359
|
+
exports.withEnchantment = withEnchantment;
|
|
360
360
|
exports.withName = withName;
|
|
361
361
|
exports.withTag = withTag;
|
|
362
362
|
exports.withTooltip = withTooltip;
|
package/dist/zenflow.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const COLORS: readonly ["black", "darkBlue", "darkGreen", "darkAqua", "darkRed", "darkRed", "darkPurple", "gold", "gray", "darkGray", "blue", "green", "aqua", "red", "lightPurple", "yellow", "white"];
|
|
2
2
|
declare const FORMATS: readonly ["obfuscated", "bold", "strikethrough", "underline", "italic"];
|
|
3
3
|
declare const ENCHANTMENTS: {
|
|
4
4
|
readonly protection: 0;
|
|
@@ -43,9 +43,11 @@ declare const MFR_FOCI: {
|
|
|
43
43
|
readonly black: 15;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
declare type
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
declare type Stack = {
|
|
47
|
+
id: string;
|
|
48
|
+
n: number;
|
|
49
|
+
};
|
|
50
|
+
declare type Ingredient = string | Stack;
|
|
49
51
|
declare type RecipeShaped = Partial<{
|
|
50
52
|
1: string;
|
|
51
53
|
2: string;
|
|
@@ -66,18 +68,18 @@ declare type RecipeShapeless = string[];
|
|
|
66
68
|
declare type Recipe = RecipeShaped | RecipeShapeless;
|
|
67
69
|
declare type Enchantment = {
|
|
68
70
|
type: keyof typeof ENCHANTMENTS;
|
|
69
|
-
level?: number;
|
|
71
|
+
level?: number | string;
|
|
70
72
|
short?: boolean;
|
|
71
73
|
};
|
|
72
|
-
declare type
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
declare type TextRich = {
|
|
75
|
+
text: string;
|
|
76
|
+
color?: typeof COLORS[number];
|
|
77
|
+
format?: typeof FORMATS[number];
|
|
75
78
|
};
|
|
76
|
-
declare type
|
|
77
|
-
declare type Text = string | TextFormat;
|
|
79
|
+
declare type Text = string | TextRich;
|
|
78
80
|
|
|
79
81
|
declare type RecipeCompressor = {
|
|
80
|
-
in:
|
|
82
|
+
in: Stack;
|
|
81
83
|
out: string;
|
|
82
84
|
};
|
|
83
85
|
declare type RecipeExtreme = [
|
|
@@ -93,135 +95,149 @@ declare type RecipeExtreme = [
|
|
|
93
95
|
];
|
|
94
96
|
declare const addCompressor: (recipe: RecipeCompressor) => string;
|
|
95
97
|
/**
|
|
96
|
-
* @param
|
|
98
|
+
* @param id Compressor output
|
|
97
99
|
*/
|
|
98
|
-
declare const removeCompressor: (
|
|
99
|
-
declare const addExtreme: (
|
|
100
|
+
declare const removeCompressor: (id: string) => string;
|
|
101
|
+
declare const addExtreme: (ingredient: Ingredient, recipe: RecipeExtreme) => string;
|
|
100
102
|
/**
|
|
101
|
-
* @param
|
|
103
|
+
* @param id Extreme Crafting output
|
|
102
104
|
*/
|
|
103
|
-
declare const removeExtreme: (
|
|
105
|
+
declare const removeExtreme: (id: string) => string;
|
|
104
106
|
|
|
105
|
-
declare type RecipeComposter =
|
|
106
|
-
|
|
107
|
-
fill: number
|
|
108
|
-
hex?: string
|
|
109
|
-
|
|
110
|
-
declare type RecipeCrucible$1 =
|
|
111
|
-
|
|
112
|
-
liquid:
|
|
113
|
-
|
|
114
|
-
declare type
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
declare type RecipeHammer = Record<string, Array<number | [n: number, mod: number]>>;
|
|
107
|
+
declare type RecipeComposter = {
|
|
108
|
+
id: string;
|
|
109
|
+
fill: number;
|
|
110
|
+
hex?: string;
|
|
111
|
+
};
|
|
112
|
+
declare type RecipeCrucible$1 = {
|
|
113
|
+
id: string;
|
|
114
|
+
liquid: Stack;
|
|
115
|
+
};
|
|
116
|
+
declare type RecipeHammer = Record<string, Array<number | {
|
|
117
|
+
chance: number;
|
|
118
|
+
modifier: number;
|
|
119
|
+
}>>;
|
|
119
120
|
declare type RecipeSieve = Record<string, number>;
|
|
120
121
|
/**
|
|
121
122
|
* - Fill must be between `0` and `1`
|
|
122
123
|
*/
|
|
123
124
|
declare const addComposter: (recipe: RecipeComposter) => string;
|
|
124
|
-
declare const removeComposter: (
|
|
125
|
+
declare const removeComposter: (id: string) => string;
|
|
125
126
|
declare const addCrucible$1: (recipe: RecipeCrucible$1) => string;
|
|
126
|
-
declare const removeCrucible$1: (
|
|
127
|
+
declare const removeCrucible$1: (id: string) => string;
|
|
127
128
|
/**
|
|
128
|
-
* -
|
|
129
|
+
* - `n` must be between `0` and `1`
|
|
129
130
|
*/
|
|
130
|
-
declare const addCrucibleSource: (recipe:
|
|
131
|
-
declare const removeCrucibleSource: (
|
|
131
|
+
declare const addCrucibleSource: (recipe: Stack) => string;
|
|
132
|
+
declare const removeCrucibleSource: (id: string) => string;
|
|
132
133
|
/**
|
|
133
134
|
* - Chance must be between `0` and `1`
|
|
134
135
|
*/
|
|
135
|
-
declare const addHammer: (
|
|
136
|
-
declare const removeHammer: (
|
|
136
|
+
declare const addHammer: (id: string, recipe: RecipeHammer) => string;
|
|
137
|
+
declare const removeHammer: (id: string) => string;
|
|
137
138
|
/**
|
|
138
139
|
* - Chance must be bigger than `0`
|
|
139
140
|
*/
|
|
140
|
-
declare const addSieve: (
|
|
141
|
-
declare const removeSieve: (
|
|
141
|
+
declare const addSieve: (id: string, recipe: RecipeSieve) => string;
|
|
142
|
+
declare const removeSieve: (id: string) => string;
|
|
142
143
|
|
|
143
|
-
declare const addQED: (
|
|
144
|
+
declare const addQED: (ingredient: Ingredient, recipe: RecipeShaped) => string;
|
|
144
145
|
/**
|
|
145
|
-
* @param
|
|
146
|
+
* @param id QED output
|
|
146
147
|
*/
|
|
147
|
-
declare const removeQED: (
|
|
148
|
-
declare const replaceQED: (
|
|
148
|
+
declare const removeQED: (id: string) => string;
|
|
149
|
+
declare const replaceQED: (ingredient: Ingredient, recipe: RecipeShaped) => string;
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
152
|
* @param dict Valid ore dictionary value: http://minetweaker3.powerofbytes.com/wiki/Tutorial:Ore_Dictionary
|
|
152
153
|
*/
|
|
153
|
-
declare const addDict: (dict: string,
|
|
154
|
+
declare const addDict: (dict: string, ids: string[]) => string;
|
|
154
155
|
/**
|
|
155
156
|
* @param dict Valid ore dictionary value: http://minetweaker3.powerofbytes.com/wiki/Tutorial:Ore_Dictionary
|
|
156
157
|
*/
|
|
157
|
-
declare const removeDict: (dict: string,
|
|
158
|
-
declare const withName: (
|
|
159
|
-
declare const withTooltip: (
|
|
160
|
-
declare const withTooltipShift: (
|
|
161
|
-
declare const withTag: (tag: string) => (
|
|
162
|
-
declare const
|
|
158
|
+
declare const removeDict: (dict: string, ids: string[]) => string;
|
|
159
|
+
declare const withName: (id: string, name: Text) => string;
|
|
160
|
+
declare const withTooltip: (id: string, tooltips: Text | Text[]) => string;
|
|
161
|
+
declare const withTooltipShift: (id: string, tooltips: Text | Text[]) => string;
|
|
162
|
+
declare const withTag: (tag: string) => (id: string) => string;
|
|
163
|
+
declare const withEnchantment: (enchantments: Enchantment | Enchantment[]) => (id: string) => string;
|
|
163
164
|
|
|
164
|
-
declare const addLaser: (item: Item) => string;
|
|
165
165
|
/**
|
|
166
|
-
*
|
|
166
|
+
* Requires: `import mods.mfr.MiningLaser;`
|
|
167
167
|
*/
|
|
168
|
-
declare const
|
|
169
|
-
declare const addFoci: (lens: keyof typeof MFR_FOCI, ingredients: string[]) => string;
|
|
168
|
+
declare const addLaser: (ingredient: Ingredient) => string;
|
|
170
169
|
/**
|
|
171
|
-
*
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
* - Requires: `import mods.mfr.MiningLaser;`
|
|
171
|
+
* - Accepts ore dictionary
|
|
172
|
+
* @param id - Laser output
|
|
173
|
+
*/
|
|
174
|
+
declare const removeLaser: (id: string) => string;
|
|
175
|
+
/**
|
|
176
|
+
* Requires: `import mods.mfr.MiningLaser;`
|
|
177
|
+
*/
|
|
178
|
+
declare const addFoci: (foci: keyof typeof MFR_FOCI, ids: string[]) => string;
|
|
179
|
+
/**
|
|
180
|
+
* Requires: `import mods.mfr.MiningLaser;`
|
|
181
|
+
* @param ids - Laser output
|
|
182
|
+
*/
|
|
183
|
+
declare const removeFoci: (foci: keyof typeof MFR_FOCI, ids: string[]) => string;
|
|
174
184
|
|
|
175
|
-
|
|
176
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Requires: `import mods.nei.NEI;`
|
|
187
|
+
*/
|
|
188
|
+
declare const hide: (id: string) => string;
|
|
189
|
+
/**
|
|
190
|
+
* Requires: `import mods.nei.NEI;`
|
|
191
|
+
*/
|
|
192
|
+
declare const addNEI: (id: string) => string;
|
|
177
193
|
|
|
178
194
|
declare type RecipeCrucible = {
|
|
179
195
|
rf: number;
|
|
180
196
|
in: string;
|
|
181
|
-
liquid:
|
|
197
|
+
liquid: Stack;
|
|
182
198
|
};
|
|
183
199
|
declare type RecipeFurnace$1 = {
|
|
184
200
|
rf: number;
|
|
185
201
|
in: string;
|
|
186
|
-
out:
|
|
202
|
+
out: Ingredient;
|
|
187
203
|
};
|
|
188
204
|
declare type RecipeInsolator = {
|
|
189
205
|
rf: number;
|
|
190
|
-
left:
|
|
191
|
-
right:
|
|
192
|
-
out:
|
|
193
|
-
bonus?:
|
|
206
|
+
left: Ingredient;
|
|
207
|
+
right: Ingredient;
|
|
208
|
+
out: Ingredient;
|
|
209
|
+
bonus?: Stack;
|
|
194
210
|
};
|
|
195
211
|
declare type RecipePulverizer = {
|
|
196
212
|
rf: number;
|
|
197
213
|
in: string;
|
|
198
|
-
out:
|
|
199
|
-
bonus?:
|
|
214
|
+
out: Ingredient;
|
|
215
|
+
bonus?: Stack;
|
|
200
216
|
};
|
|
201
217
|
declare type RecipeSawmill = {
|
|
202
218
|
rf: number;
|
|
203
219
|
in: string;
|
|
204
|
-
out:
|
|
205
|
-
bonus?:
|
|
220
|
+
out: Ingredient;
|
|
221
|
+
bonus?: Stack;
|
|
206
222
|
};
|
|
207
223
|
declare type RecipeSmelter = {
|
|
208
224
|
rf: number;
|
|
209
|
-
left:
|
|
210
|
-
right:
|
|
211
|
-
out:
|
|
212
|
-
bonus?:
|
|
225
|
+
left: Ingredient;
|
|
226
|
+
right: Ingredient;
|
|
227
|
+
out: Ingredient;
|
|
228
|
+
bonus?: Stack;
|
|
213
229
|
};
|
|
214
230
|
declare type RecipeTransposerFill = {
|
|
215
231
|
rf: number;
|
|
216
232
|
in: string;
|
|
217
233
|
out: string;
|
|
218
|
-
liquid:
|
|
234
|
+
liquid: Stack;
|
|
219
235
|
};
|
|
220
236
|
declare type RecipeTransposerExtract = {
|
|
221
237
|
rf: number;
|
|
222
238
|
in: string;
|
|
223
|
-
liquid:
|
|
224
|
-
bonus?:
|
|
239
|
+
liquid: Stack;
|
|
240
|
+
bonus?: Stack;
|
|
225
241
|
};
|
|
226
242
|
/**
|
|
227
243
|
* Common values:
|
|
@@ -230,7 +246,7 @@ declare type RecipeTransposerExtract = {
|
|
|
230
246
|
* - Rocks: `80.000RF ~ 320.000RF, 1000mB`
|
|
231
247
|
*/
|
|
232
248
|
declare const addCrucible: (recipe: RecipeCrucible) => string;
|
|
233
|
-
declare const removeCrucible: (
|
|
249
|
+
declare const removeCrucible: (id: string) => string;
|
|
234
250
|
/**
|
|
235
251
|
* Common values:
|
|
236
252
|
* - Food: `800RF`
|
|
@@ -238,14 +254,14 @@ declare const removeCrucible: (ingredient: string) => string;
|
|
|
238
254
|
* - Blocks: `1600RF`
|
|
239
255
|
*/
|
|
240
256
|
declare const addFurnace$1: (recipe: RecipeFurnace$1) => string;
|
|
241
|
-
declare const removeFurnace$1: (
|
|
257
|
+
declare const removeFurnace$1: (id: string) => string;
|
|
242
258
|
/**
|
|
243
259
|
* Common values:
|
|
244
260
|
* - Phyto-gro: `7200RF`
|
|
245
261
|
* - Rich phyto-gro: `9600RF`
|
|
246
262
|
*/
|
|
247
263
|
declare const addInsolator: (recipe: RecipeInsolator) => string;
|
|
248
|
-
declare const removeInsolator: (left:
|
|
264
|
+
declare const removeInsolator: (left: Ingredient, right: Ingredient) => string;
|
|
249
265
|
/**
|
|
250
266
|
* Common values:
|
|
251
267
|
* - Plants: `1600RF`
|
|
@@ -255,9 +271,9 @@ declare const removeInsolator: (left: Item, right: Item) => string;
|
|
|
255
271
|
* - Ores: `3200RF`
|
|
256
272
|
*/
|
|
257
273
|
declare const addPulverizer: (recipe: RecipePulverizer) => string;
|
|
258
|
-
declare const removePulverizer: (
|
|
274
|
+
declare const removePulverizer: (id: string) => string;
|
|
259
275
|
declare const addSawmill: (recipe: RecipeSawmill) => string;
|
|
260
|
-
declare const removeSawmill: (
|
|
276
|
+
declare const removeSawmill: (id: string) => string;
|
|
261
277
|
/**
|
|
262
278
|
* Common values (RF):
|
|
263
279
|
* - Dust: `200RF ~ 1600RF`
|
|
@@ -268,7 +284,7 @@ declare const removeSawmill: (ingredient: string) => string;
|
|
|
268
284
|
* - Slag: `7200RF`
|
|
269
285
|
*/
|
|
270
286
|
declare const addSmelter: (recipe: RecipeSmelter) => string;
|
|
271
|
-
declare const removeSmelter: (left:
|
|
287
|
+
declare const removeSmelter: (left: Ingredient, right: Ingredient) => string;
|
|
272
288
|
/**
|
|
273
289
|
* Common values
|
|
274
290
|
* - Duct: `800RF, 200mB`
|
|
@@ -279,18 +295,18 @@ declare const removeSmelter: (left: Item, right: Item) => string;
|
|
|
279
295
|
* - Frame: `16.000RF, 4000mB`
|
|
280
296
|
*/
|
|
281
297
|
declare const addTransposerFill: (recipe: RecipeTransposerFill) => string;
|
|
282
|
-
declare const removeTransposerFill: (
|
|
298
|
+
declare const removeTransposerFill: (id: string, liquid: string) => string;
|
|
283
299
|
/**
|
|
284
300
|
* Common values
|
|
285
301
|
* - Bucket: `800RF, 1000mB`
|
|
286
302
|
* - Bottle: `1600RF, 1000mB`
|
|
287
303
|
*/
|
|
288
304
|
declare const addTransposerExtract: (recipe: RecipeTransposerExtract) => string;
|
|
289
|
-
declare const removeTransposerExtract: (
|
|
305
|
+
declare const removeTransposerExtract: (id: string) => string;
|
|
290
306
|
|
|
291
307
|
declare type RecipeFurnace = {
|
|
292
308
|
in: string;
|
|
293
|
-
out:
|
|
309
|
+
out: Ingredient;
|
|
294
310
|
};
|
|
295
311
|
/**
|
|
296
312
|
* Add crafting recipe
|
|
@@ -298,19 +314,19 @@ declare type RecipeFurnace = {
|
|
|
298
314
|
* - Recipe: `{}` => Shaped recipe
|
|
299
315
|
* - Recipe: `[]` => Shapeless recipe
|
|
300
316
|
*/
|
|
301
|
-
declare const add: (item:
|
|
317
|
+
declare const add: (item: Ingredient, recipe: Recipe) => string;
|
|
302
318
|
/**
|
|
303
319
|
* Remove all crafting recipes (shaped & shapeless)
|
|
304
320
|
*/
|
|
305
|
-
declare const remove: (
|
|
321
|
+
declare const remove: (id: string) => string;
|
|
306
322
|
/**
|
|
307
323
|
* Remove all shaped crafting recipes
|
|
308
324
|
*/
|
|
309
|
-
declare const removeShaped: (
|
|
325
|
+
declare const removeShaped: (id: string) => string;
|
|
310
326
|
/**
|
|
311
327
|
* Remove all shapeless crafting recipes
|
|
312
328
|
*/
|
|
313
|
-
declare const removeShapeless: (
|
|
329
|
+
declare const removeShapeless: (id: string) => string;
|
|
314
330
|
declare const addFurnace: (recipe: RecipeFurnace) => string;
|
|
315
331
|
/**
|
|
316
332
|
* Remove furnace recipe
|
|
@@ -328,11 +344,11 @@ declare const removeFurnace: (recipe: string | {
|
|
|
328
344
|
* - Recipe: `{}` => Replaces all shaped recipes
|
|
329
345
|
* - Recipe: `[]` => Replaces all shapeless recipes
|
|
330
346
|
*/
|
|
331
|
-
declare const replace: (
|
|
347
|
+
declare const replace: (ingredient: Ingredient, recipe: Recipe) => string;
|
|
332
348
|
/**
|
|
333
349
|
* Replace all crafting recipe
|
|
334
350
|
*/
|
|
335
|
-
declare const replaceAll: (
|
|
336
|
-
declare const replaceMany: (
|
|
351
|
+
declare const replaceAll: (ingredient: Ingredient, recipe: Recipe) => string;
|
|
352
|
+
declare const replaceMany: (ingredient: Ingredient, recipes: Recipe[]) => string;
|
|
337
353
|
|
|
338
|
-
export {
|
|
354
|
+
export { Enchantment, Ingredient, Recipe, RecipeShaped, RecipeShapeless, Stack, Text, TextRich, add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addDict, addExtreme, addFoci, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeDict, removeExtreme, removeFoci, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceAll, replaceMany, replaceQED, withEnchantment, withName, withTag, withTooltip, withTooltipShift };
|
package/dist/zenflow.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const createCode = (code) => `\\u00A7${code}`;
|
|
2
2
|
const createFormat = (type) => (tooltip) => `format.${type}(${tooltip})`;
|
|
3
|
-
const
|
|
3
|
+
const NAME_COLOR = {
|
|
4
4
|
black: createCode("0"),
|
|
5
5
|
darkBlue: createCode("1"),
|
|
6
6
|
darkGreen: createCode("2"),
|
|
@@ -18,7 +18,15 @@ const NAME_COLOUR = {
|
|
|
18
18
|
yellow: createCode("e"),
|
|
19
19
|
white: createCode("f")
|
|
20
20
|
};
|
|
21
|
-
const
|
|
21
|
+
const NAME_FORMAT = {
|
|
22
|
+
obfuscated: createCode("k"),
|
|
23
|
+
bold: createCode("l"),
|
|
24
|
+
strikethrough: createCode("m"),
|
|
25
|
+
underline: createCode("n"),
|
|
26
|
+
italic: createCode("o"),
|
|
27
|
+
reset: createCode("r")
|
|
28
|
+
};
|
|
29
|
+
const TOOLTIP_COLOR = {
|
|
22
30
|
black: createFormat("black"),
|
|
23
31
|
darkBlue: createFormat("darkBlue"),
|
|
24
32
|
darkGreen: createFormat("darkGreen"),
|
|
@@ -36,14 +44,6 @@ const TOOLTIP_COLOUR = {
|
|
|
36
44
|
yellow: createFormat("yellow"),
|
|
37
45
|
white: createFormat("white")
|
|
38
46
|
};
|
|
39
|
-
const NAME_FORMAT = {
|
|
40
|
-
obfuscated: createCode("k"),
|
|
41
|
-
bold: createCode("l"),
|
|
42
|
-
strikethrough: createCode("m"),
|
|
43
|
-
underline: createCode("n"),
|
|
44
|
-
italic: createCode("o"),
|
|
45
|
-
reset: createCode("r")
|
|
46
|
-
};
|
|
47
47
|
const TOOLTIP_FORMAT = {
|
|
48
48
|
obfuscated: createFormat("obfuscated"),
|
|
49
49
|
bold: createFormat("bold"),
|
|
@@ -94,41 +94,41 @@ const MFR_FOCI = {
|
|
|
94
94
|
black: 15
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
const
|
|
97
|
+
const clamp = (min, max, n) => Math.max(min, Math.min(max, n));
|
|
98
|
+
const fill = (n, x) => Array.from({ length: n }).map((_, i) => x ?? i);
|
|
99
|
+
const toArray = (x) => Array.isArray(x) ? x : [x];
|
|
100
|
+
const isObject = (x) => typeof x === "object" && !Array.isArray(x);
|
|
100
101
|
|
|
101
|
-
const
|
|
102
|
+
const formatLiteral = (x) => `"${x}"`;
|
|
103
|
+
const formatId = (id) => id ?? "null";
|
|
104
|
+
const formatStack = (stack) => `${stack.id} * ${stack.n}`;
|
|
105
|
+
const formatIngredient = (ingredient) => isObject(ingredient) ? formatStack(ingredient) : ingredient;
|
|
102
106
|
const formatList = (list) => `[${list.join(", ")}]`;
|
|
103
|
-
const formatIngredient = (ingredient) => ingredient ?? "null";
|
|
104
107
|
const formatEnchantment = (enchantment) => {
|
|
105
108
|
const id = `${ENCHANTMENTS[enchantment.type]}${enchantment.short ? " as short" : ""}`;
|
|
106
109
|
const lvl = `${enchantment.level ?? 1}${enchantment.level ? " as short" : ""}`;
|
|
107
110
|
return `{ id: ${id}, lvl: ${lvl} }`;
|
|
108
111
|
};
|
|
109
112
|
const formatName = (texts) => {
|
|
110
|
-
const
|
|
111
|
-
text
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const formatted = texts.map((text) => typeof text === "string" ? text : format(text)).join("");
|
|
113
|
+
const formatted = toArray(texts).map((text) => {
|
|
114
|
+
if (typeof text === "string")
|
|
115
|
+
return text;
|
|
116
|
+
return [
|
|
117
|
+
text.color && NAME_COLOR[text.color],
|
|
118
|
+
text.format && NAME_FORMAT[text.format],
|
|
119
|
+
text.text,
|
|
120
|
+
(text.color || text.format) && NAME_FORMAT.reset
|
|
121
|
+
].filter((x) => x !== void 0).join("");
|
|
122
|
+
}).join("");
|
|
121
123
|
return `"${formatted}"`;
|
|
122
124
|
};
|
|
123
|
-
const formatTooltip = (texts) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
};
|
|
131
|
-
const formatRecipeShaped = (recipe) => {
|
|
125
|
+
const formatTooltip = (texts) => toArray(texts).map((text) => {
|
|
126
|
+
if (typeof text === "string")
|
|
127
|
+
return formatLiteral(text);
|
|
128
|
+
const format = text.format ? TOOLTIP_FORMAT[text.format](formatLiteral(text.text)) : formatLiteral(text.text);
|
|
129
|
+
return TOOLTIP_COLOR[text.color ?? "gray"](format);
|
|
130
|
+
}).join(" + ");
|
|
131
|
+
const formatRecipe = (recipe) => {
|
|
132
132
|
const matrix = [[
|
|
133
133
|
recipe.square || recipe.ring || recipe.corner || recipe[1],
|
|
134
134
|
recipe.square || recipe.ring || recipe.edge || recipe[2],
|
|
@@ -141,165 +141,165 @@ const formatRecipeShaped = (recipe) => {
|
|
|
141
141
|
recipe.ring || recipe.corner || recipe[7],
|
|
142
142
|
recipe.ring || recipe.edge || recipe[8],
|
|
143
143
|
recipe.ring || recipe.corner || recipe[9]
|
|
144
|
-
]].map((row) => formatList(row.map(
|
|
144
|
+
]].map((row) => formatList(row.map(formatId)));
|
|
145
145
|
return `[
|
|
146
146
|
${matrix.join(",\n ")}
|
|
147
147
|
]`;
|
|
148
148
|
};
|
|
149
149
|
const formatArgs = (...args) => {
|
|
150
|
-
const list = args.filter((
|
|
151
|
-
if (typeof arg === "number")
|
|
152
|
-
return `${arg}`;
|
|
153
|
-
if (isRecipeShaped(arg))
|
|
154
|
-
return formatRecipeShaped(arg);
|
|
155
|
-
if (isItem(arg))
|
|
156
|
-
return formatItem(arg);
|
|
157
|
-
if (Array.isArray(arg))
|
|
158
|
-
return formatList(arg);
|
|
159
|
-
return arg;
|
|
160
|
-
});
|
|
150
|
+
const list = args.filter((x) => x !== void 0).map((x) => Array.isArray(x) ? formatList(x) : x);
|
|
161
151
|
return list.length > 3 ? `
|
|
162
152
|
${list.join(",\n ")}
|
|
163
153
|
` : list.join(", ");
|
|
164
154
|
};
|
|
165
155
|
|
|
166
|
-
const addCompressor = (recipe) => `mods.avaritia.Compressor.add(${formatArgs(recipe.out, recipe.in
|
|
167
|
-
const removeCompressor = (
|
|
168
|
-
const addExtreme = (
|
|
169
|
-
const out = formatArgs(
|
|
156
|
+
const addCompressor = (recipe) => `mods.avaritia.Compressor.add(${formatArgs(recipe.out, recipe.in.n, recipe.in.id)});`;
|
|
157
|
+
const removeCompressor = (id) => `mods.avaritia.Compressor.remove(${id});`;
|
|
158
|
+
const addExtreme = (ingredient, recipe) => {
|
|
159
|
+
const out = formatArgs(formatIngredient(ingredient), recipe.map((row) => formatList(row.map(formatId))));
|
|
170
160
|
return `mods.avaritia.ExtremeCrafting.addShaped(${out});`;
|
|
171
161
|
};
|
|
172
|
-
const removeExtreme = (
|
|
173
|
-
|
|
174
|
-
const clamp = (min, max, n) => Math.max(min, Math.min(max, n));
|
|
175
|
-
const fill = (n, x) => Array.from({ length: n }).map((_, i) => x ?? i);
|
|
162
|
+
const removeExtreme = (id) => `mods.avaritia.ExtremeCrafting.remove(${id});`;
|
|
176
163
|
|
|
177
164
|
const addComposter = (recipe) => {
|
|
178
|
-
const out = formatArgs(recipe
|
|
165
|
+
const out = formatArgs(recipe.id, clamp(0, 1, recipe.fill), recipe.hex && `"${recipe.hex}"`);
|
|
179
166
|
return `mods.exnihilo.Composting.addRecipe(${out});`;
|
|
180
167
|
};
|
|
181
|
-
const removeComposter = (
|
|
182
|
-
const addCrucible$1 = (recipe) =>
|
|
183
|
-
const
|
|
168
|
+
const removeComposter = (id) => `mods.exnihilo.Composting.removeRecipe(${id});`;
|
|
169
|
+
const addCrucible$1 = (recipe) => {
|
|
170
|
+
const out = formatArgs(recipe.id, formatStack(recipe.liquid));
|
|
171
|
+
return `mods.exnihilo.Crucible.addRecipe(${out});`;
|
|
172
|
+
};
|
|
173
|
+
const removeCrucible$1 = (id) => `mods.exnihilo.Crucible.removeRecipe(${id});`;
|
|
184
174
|
const addCrucibleSource = (recipe) => {
|
|
185
|
-
const out = formatArgs(recipe
|
|
175
|
+
const out = formatArgs(recipe.id, clamp(0, 1, recipe.n));
|
|
186
176
|
return `mods.exnihilo.Crucible.addHeatSource(${out});`;
|
|
187
177
|
};
|
|
188
|
-
const removeCrucibleSource = (
|
|
189
|
-
const addHammer = (
|
|
190
|
-
const items = Object.entries(recipe).map((entry) => entry[1].map((chance) => ({
|
|
191
|
-
|
|
192
|
-
chance: clamp(0, 1,
|
|
193
|
-
modifier:
|
|
178
|
+
const removeCrucibleSource = (id) => `mods.exnihilo.Crucible.removeHeatSource(${id});`;
|
|
179
|
+
const addHammer = (id, recipe) => {
|
|
180
|
+
const items = Object.entries(recipe).map((entry) => toArray(entry[1]).map((chance) => ({
|
|
181
|
+
id: entry[0],
|
|
182
|
+
chance: clamp(0, 1, isObject(chance) ? chance.chance : chance),
|
|
183
|
+
modifier: isObject(chance) ? chance.modifier : 1
|
|
194
184
|
}))).flat();
|
|
195
|
-
const out = formatArgs(
|
|
185
|
+
const out = formatArgs(id, items.map((item) => item.id), items.map((item) => item.chance), items.map((item) => item.modifier));
|
|
196
186
|
return `mods.exnihilo.Hammer.addRecipe(${out});`;
|
|
197
187
|
};
|
|
198
|
-
const removeHammer = (
|
|
199
|
-
const addSieve = (
|
|
188
|
+
const removeHammer = (id) => `mods.exnihilo.Hammer.removeRecipe(${id});`;
|
|
189
|
+
const addSieve = (id, recipe) => {
|
|
200
190
|
const items = Object.entries(recipe).map((entry) => fill(Math.ceil(entry[1])).map((i) => ({
|
|
201
|
-
|
|
191
|
+
id: entry[0],
|
|
202
192
|
chance: entry[1] - i < 1 ? Math.round(1 / (entry[1] - i)) : 1
|
|
203
193
|
}))).flat();
|
|
204
|
-
const out = formatArgs(
|
|
194
|
+
const out = formatArgs(id, items.map((item) => item.id), items.map((item) => item.chance));
|
|
205
195
|
return `mods.exnihilo.Sieve.addRecipe(${out});`;
|
|
206
196
|
};
|
|
207
|
-
const removeSieve = (
|
|
197
|
+
const removeSieve = (id) => `mods.exnihilo.Sieve.removeRecipe(${id});`;
|
|
208
198
|
|
|
209
|
-
const addQED = (
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
199
|
+
const addQED = (ingredient, recipe) => {
|
|
200
|
+
const out = formatArgs(formatIngredient(ingredient), formatRecipe(recipe));
|
|
201
|
+
return `mods.extraUtils.QED.addShapedRecipe(${out});`;
|
|
202
|
+
};
|
|
203
|
+
const removeQED = (id) => `mods.extraUtils.QED.removeRecipe(${id});`;
|
|
204
|
+
const replaceQED = (ingredient, recipe) => [
|
|
205
|
+
removeQED(Array.isArray(ingredient) ? ingredient[0] : ingredient),
|
|
206
|
+
addQED(ingredient, recipe)
|
|
214
207
|
].join("\n");
|
|
215
208
|
|
|
216
|
-
const addDict = (dict,
|
|
217
|
-
const removeDict = (dict,
|
|
218
|
-
const withName = (
|
|
219
|
-
const withTooltip = (
|
|
220
|
-
const withTooltipShift = (
|
|
221
|
-
const withTag = (tag) => (
|
|
222
|
-
const
|
|
223
|
-
const enchantments = Array.isArray(enchantment) ? enchantment : [enchantment];
|
|
224
|
-
return withTag(`{ ench: ${formatList(enchantments.map(formatEnchantment))} }`);
|
|
225
|
-
};
|
|
209
|
+
const addDict = (dict, ids) => ids.map((id) => `${dict}.add(${id});`).join("\n");
|
|
210
|
+
const removeDict = (dict, ids) => ids.map((id) => `${dict}.remove(${id});`).join("\n");
|
|
211
|
+
const withName = (id, name) => `${id}.displayName = ${formatName(name)};`;
|
|
212
|
+
const withTooltip = (id, tooltips) => toArray(tooltips).map((tooltip) => `${id}.addTooltip(${formatTooltip(tooltip)});`).join("\n");
|
|
213
|
+
const withTooltipShift = (id, tooltips) => toArray(tooltips).map((tooltip) => `${id}.addShiftTooltip(${formatTooltip(tooltip)});`).join("\n");
|
|
214
|
+
const withTag = (tag) => (id) => `${id}.withTag(${tag})`;
|
|
215
|
+
const withEnchantment = (enchantments) => withTag(`{ ench: ${formatList(toArray(enchantments).map(formatEnchantment))} }`);
|
|
226
216
|
|
|
227
|
-
const addLaser = (
|
|
228
|
-
const removeLaser = (
|
|
229
|
-
const addFoci = (
|
|
230
|
-
const removeFoci = (
|
|
217
|
+
const addLaser = (ingredient) => `MiningLaser.addOre(${formatArgs(formatIngredient(ingredient))});`;
|
|
218
|
+
const removeLaser = (id) => `MiningLaser.removeOre(${id});`;
|
|
219
|
+
const addFoci = (foci, ids) => ids.map((id) => `MiningLaser.addPreferredOre(${formatArgs(MFR_FOCI[foci], id)});`).join("\n");
|
|
220
|
+
const removeFoci = (foci, ids) => ids.map((id) => `MiningLaser.removePreferredOre(${formatArgs(MFR_FOCI[foci], id)});`).join("\n");
|
|
231
221
|
|
|
232
|
-
const hide = (
|
|
233
|
-
const addNEI = (
|
|
222
|
+
const hide = (id) => `NEI.hide(${id});`;
|
|
223
|
+
const addNEI = (id) => `NEI.addEntry(${id});`;
|
|
234
224
|
|
|
235
225
|
const addCrucible = (recipe) => {
|
|
236
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.liquid);
|
|
226
|
+
const out = formatArgs(recipe.rf, recipe.in, formatStack(recipe.liquid));
|
|
237
227
|
return `mods.thermalexpansion.Crucible.addRecipe(${out});`;
|
|
238
228
|
};
|
|
239
|
-
const removeCrucible = (
|
|
229
|
+
const removeCrucible = (id) => `mods.thermalexpansion.Crucible.removeRecipe(${id});`;
|
|
240
230
|
const addFurnace$1 = (recipe) => {
|
|
241
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out);
|
|
231
|
+
const out = formatArgs(recipe.rf, recipe.in, formatIngredient(recipe.out));
|
|
242
232
|
return `mods.thermalexpansion.Furnace.addRecipe(${out});`;
|
|
243
233
|
};
|
|
244
|
-
const removeFurnace$1 = (
|
|
234
|
+
const removeFurnace$1 = (id) => `mods.thermalexpansion.Furnace.removeRecipe(${id});`;
|
|
245
235
|
const addInsolator = (recipe) => {
|
|
246
|
-
const out = formatArgs(recipe.rf, recipe.left, recipe.right, recipe.out, recipe.bonus && recipe.bonus
|
|
236
|
+
const out = formatArgs(recipe.rf, formatIngredient(recipe.left), formatIngredient(recipe.right), formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
247
237
|
return `mods.thermalexpansion.Insolator.addRecipe(${out});`;
|
|
248
238
|
};
|
|
249
|
-
const removeInsolator = (left, right) =>
|
|
239
|
+
const removeInsolator = (left, right) => {
|
|
240
|
+
const out = formatArgs(formatIngredient(left), formatIngredient(right));
|
|
241
|
+
return `mods.thermalexpansion.Insolator.removeRecipe(${out});`;
|
|
242
|
+
};
|
|
250
243
|
const addPulverizer = (recipe) => {
|
|
251
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out, recipe.bonus && recipe.bonus
|
|
244
|
+
const out = formatArgs(recipe.rf, recipe.in, formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
252
245
|
return `mods.thermalexpansion.Pulverizer.addRecipe(${out});`;
|
|
253
246
|
};
|
|
254
|
-
const removePulverizer = (
|
|
247
|
+
const removePulverizer = (id) => `mods.thermalexpansion.Pulverizer.removeRecipe(${id});`;
|
|
255
248
|
const addSawmill = (recipe) => {
|
|
256
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out, recipe.bonus && recipe.bonus
|
|
249
|
+
const out = formatArgs(recipe.rf, recipe.in, formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
257
250
|
return `mods.thermalexpansion.Sawmill.addRecipe(${out});`;
|
|
258
251
|
};
|
|
259
|
-
const removeSawmill = (
|
|
252
|
+
const removeSawmill = (id) => `mods.thermalexpansion.Sawmill.removeRecipe(${id});`;
|
|
260
253
|
const addSmelter = (recipe) => {
|
|
261
|
-
const out = formatArgs(recipe.rf, recipe.right, recipe.left, recipe.out, recipe.bonus && recipe.bonus
|
|
254
|
+
const out = formatArgs(recipe.rf, formatIngredient(recipe.right), formatIngredient(recipe.left), formatIngredient(recipe.out), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
262
255
|
return `mods.thermalexpansion.Smelter.addRecipe(${out});`;
|
|
263
256
|
};
|
|
264
|
-
const removeSmelter = (left, right) =>
|
|
257
|
+
const removeSmelter = (left, right) => {
|
|
258
|
+
const out = formatArgs(formatIngredient(left), formatIngredient(right));
|
|
259
|
+
return `mods.thermalexpansion.Smelter.removeRecipe(${out});`;
|
|
260
|
+
};
|
|
265
261
|
const addTransposerFill = (recipe) => {
|
|
266
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.out, recipe.liquid);
|
|
262
|
+
const out = formatArgs(recipe.rf, recipe.in, recipe.out, formatStack(recipe.liquid));
|
|
267
263
|
return `mods.thermalexpansion.Transposer.addFillRecipe(${out});`;
|
|
268
264
|
};
|
|
269
|
-
const removeTransposerFill = (
|
|
265
|
+
const removeTransposerFill = (id, liquid) => `mods.thermalexpansion.Transposer.removeFillRecipe(${formatArgs(id, liquid)});`;
|
|
270
266
|
const addTransposerExtract = (recipe) => {
|
|
271
|
-
const out = formatArgs(recipe.rf, recipe.in, recipe.liquid, recipe.bonus && recipe.bonus
|
|
267
|
+
const out = formatArgs(recipe.rf, recipe.in, formatStack(recipe.liquid), recipe.bonus && recipe.bonus.id, recipe.bonus && recipe.bonus.n);
|
|
272
268
|
return `mods.thermalexpansion.Transposer.addExtractRecipe(${out});`;
|
|
273
269
|
};
|
|
274
|
-
const removeTransposerExtract = (
|
|
270
|
+
const removeTransposerExtract = (id) => `mods.thermalexpansion.Transposer.removeExtractRecipe(${id});`;
|
|
275
271
|
|
|
276
272
|
const add = (item, recipe) => {
|
|
277
273
|
const type = Array.isArray(recipe) ? "Shapeless" : "Shaped";
|
|
278
|
-
|
|
274
|
+
const out = formatArgs(formatIngredient(item), Array.isArray(recipe) ? formatList(recipe) : formatRecipe(recipe));
|
|
275
|
+
return `recipes.add${type}(${out});`;
|
|
276
|
+
};
|
|
277
|
+
const remove = (id) => `recipes.remove(${id});`;
|
|
278
|
+
const removeShaped = (id) => `recipes.removeShaped(${id});`;
|
|
279
|
+
const removeShapeless = (id) => `recipes.removeShapeless(${id});`;
|
|
280
|
+
const addFurnace = (recipe) => {
|
|
281
|
+
const out = formatArgs(formatIngredient(recipe.out), recipe.in);
|
|
282
|
+
return `furnace.addRecipe(${out});`;
|
|
279
283
|
};
|
|
280
|
-
const remove = (ingredient) => `recipes.remove(${ingredient});`;
|
|
281
|
-
const removeShaped = (ingredient) => `recipes.removeShaped(${ingredient});`;
|
|
282
|
-
const removeShapeless = (ingredient) => `recipes.removeShapeless(${ingredient});`;
|
|
283
|
-
const addFurnace = (recipe) => `furnace.addRecipe(${formatArgs(recipe.out, recipe.in)});`;
|
|
284
284
|
const removeFurnace = (recipe) => {
|
|
285
285
|
if (typeof recipe === "string")
|
|
286
286
|
return `furnace.remove(<*>, ${recipe});`;
|
|
287
|
-
return `furnace.remove(${formatArgs(recipe.out, recipe.in)})
|
|
287
|
+
return `furnace.remove(${formatArgs(recipe.out, recipe.in)});`;
|
|
288
288
|
};
|
|
289
|
-
const replace = (
|
|
290
|
-
const
|
|
289
|
+
const replace = (ingredient, recipe) => {
|
|
290
|
+
const id = isObject(ingredient) ? ingredient.id : ingredient;
|
|
291
291
|
return [
|
|
292
|
-
Array.isArray(recipe) ? removeShapeless(
|
|
293
|
-
add(
|
|
292
|
+
Array.isArray(recipe) ? removeShapeless(id) : removeShaped(id),
|
|
293
|
+
add(ingredient, recipe)
|
|
294
294
|
].join("\n");
|
|
295
295
|
};
|
|
296
|
-
const replaceAll = (
|
|
297
|
-
remove(
|
|
298
|
-
add(
|
|
296
|
+
const replaceAll = (ingredient, recipe) => [
|
|
297
|
+
remove(isObject(ingredient) ? ingredient.id : ingredient),
|
|
298
|
+
add(ingredient, recipe)
|
|
299
299
|
].join("\n");
|
|
300
|
-
const replaceMany = (
|
|
301
|
-
remove(
|
|
302
|
-
...recipes.map((recipe) => add(
|
|
300
|
+
const replaceMany = (ingredient, recipes) => [
|
|
301
|
+
remove(isObject(ingredient) ? ingredient.id : ingredient),
|
|
302
|
+
...recipes.map((recipe) => add(ingredient, recipe))
|
|
303
303
|
].join("\n");
|
|
304
304
|
|
|
305
|
-
export { add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addDict, addExtreme, addFoci, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeDict, removeExtreme, removeFoci, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceAll, replaceMany, replaceQED,
|
|
305
|
+
export { add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addDict, addExtreme, addFoci, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeDict, removeExtreme, removeFoci, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceAll, replaceMany, replaceQED, withEnchantment, withName, withTag, withTooltip, withTooltipShift };
|