zen-flow 1.0.0 → 1.2.0

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 CHANGED
@@ -6,8 +6,8 @@
6
6
  <a href="/LICENSE">
7
7
  <img alt="License MIT" src="https://img.shields.io/badge/license-MIT-blue.svg" />
8
8
  </a>
9
- <a href="https://www.npmjs.com/package/zen-flow">
10
- <img alt="NPM" src="https://img.shields.io/npm/v/zen-flow?label=npm">
9
+ <a href="/https://www.npmjs.com/package/zen-flow">
10
+ <img alt="NPM - ZenFlow" src="https://img.shields.io/npm/v/zen-flow" />
11
11
  </a>
12
12
  </div>
13
13
 
@@ -17,7 +17,7 @@
17
17
  $ npm i zen-flow -D
18
18
  ```
19
19
 
20
- <i>Note: This package requires Node > 10.12.0 and Minecraft 1.7.10.</i>
20
+ <i>Note: This package requires Node >10.12.0 and Minecraft 1.7.10.</i>
21
21
 
22
22
  ## Features
23
23
 
@@ -45,7 +45,17 @@ vanilla.add('<minecraft:saddle>', {
45
45
  * [<ore:ingotIron>, <minecraft:string>, <ore:ingotIron>],
46
46
  * [null, null, null]
47
47
  * ]);
48
- * /
48
+ **/
49
+
50
+ vanilla.add('<minecraft:saddle>', { edge: '<minecraft:leather>' });
51
+
52
+ /**
53
+ * recipes.addShaped(<minecraft:saddle>, [
54
+ * [null, <minecraft:leather>, null],
55
+ * [<minecraft:leather>, null, <minecraft:leather>],
56
+ * [null, <minecraft:leather>, null]
57
+ * ]);
58
+ **/
49
59
  ```
50
60
 
51
61
  <b>Extra Utilities generators</b>
@@ -54,7 +64,7 @@ Remove & hide generators
54
64
  ```TypeScript
55
65
  import { nei, vanilla } from 'zen-flow';
56
66
 
57
- const generators = Array.from({ length: 11 })
67
+ Array.from({ length: 11 })
58
68
  .map((_, i) => [
59
69
  `<ExtraUtilities:generator${i === 0 ? '' : `:${i}`}>`,
60
70
  `<ExtraUtilities:generator.8${i === 0 ? '' : `:${i}`}>`,
@@ -97,6 +107,9 @@ const generators = Array.from({ length: 11 })
97
107
  - `remove` - Removes both shaped and shapeless recipes
98
108
  - `removeShaped` - Removes only shaped recipes
99
109
  - `removeShapeless` - Removes only shaped recipes
110
+ - `replace` - Replaced crafting recipe
111
+ - Shaped recipe: `object`
112
+ - Shapeless recipe: `Array`
100
113
  - `addFurnace` - Adds furnace recipe
101
114
  - `removeFurnace` - Removes furnace recipe
102
115
 
package/dist/zenflow.cjs CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  const createCode = (code) => `\\u00A7${code}`;
4
6
  const createFormat = (type) => (tooltip) => `format.${type}(${tooltip})`;
5
7
  const NAME_COLOUR = {
@@ -124,9 +126,9 @@ const formatTooltip = (texts) => {
124
126
  };
125
127
  const formatRecipeShaped = (recipe) => {
126
128
  const matrix = [
127
- [recipe[1], recipe[2], recipe[3]],
128
- [recipe[4], recipe[5], recipe[6]],
129
- [recipe[7], recipe[8], recipe[9]]
129
+ [recipe.corner || recipe[1], recipe.edge || recipe[2], recipe.corner || recipe[3]],
130
+ [recipe.edge || recipe[4], recipe.center || recipe[5], recipe.edge || recipe[6]],
131
+ [recipe.corner || recipe[7], recipe.edge || recipe[8], recipe.corner || recipe[9]]
130
132
  ].map((row) => formatList(row.map(formatIngredient)));
131
133
  return `[
132
134
  ${matrix.join(",\n ")}
@@ -217,7 +219,7 @@ var exNihilo = /*#__PURE__*/Object.freeze({
217
219
  const addQED = (item, recipe) => `mods.extraUtils.QED.addShapedRecipe(${formatArgs(item, recipe)});`;
218
220
  const removeQED = (ingredient) => `mods.extraUtils.QED.removeRecipe(${ingredient});`;
219
221
 
220
- var extraUtilites = /*#__PURE__*/Object.freeze({
222
+ var extraUtilities = /*#__PURE__*/Object.freeze({
221
223
  __proto__: null,
222
224
  addQED: addQED,
223
225
  removeQED: removeQED
@@ -301,7 +303,7 @@ const addTransposerExtract = (recipe) => {
301
303
  };
302
304
  const removeTransposerExtract = (ingredient) => `mods.thermalexpansion.Transposer.removeExtractRecipe(${ingredient});`;
303
305
 
304
- var thermalexpansion = /*#__PURE__*/Object.freeze({
306
+ var thermalExpansion = /*#__PURE__*/Object.freeze({
305
307
  __proto__: null,
306
308
  addCrucible: addCrucible,
307
309
  removeCrucible: removeCrucible,
@@ -330,6 +332,13 @@ const removeShaped = (ingredient) => `recipes.removeShaped(${ingredient});`;
330
332
  const removeShapeless = (ingredient) => `recipes.removeShapeless(${ingredient});`;
331
333
  const addFurnace = (recipe) => `furnace.addRecipe(${formatArgs(recipe.out, recipe.in)});`;
332
334
  const removeFurnace = (ingredient) => `furnace.remove(${ingredient});`;
335
+ const replace = (item, recipe) => {
336
+ const ingredient = Array.isArray(item) ? item[0] : item;
337
+ return [
338
+ Array.isArray(recipe) ? removeShapeless(ingredient) : removeShaped(ingredient),
339
+ add(item, recipe)
340
+ ].join("\n");
341
+ };
333
342
 
334
343
  var vanilla = /*#__PURE__*/Object.freeze({
335
344
  __proto__: null,
@@ -338,18 +347,15 @@ var vanilla = /*#__PURE__*/Object.freeze({
338
347
  removeShaped: removeShaped,
339
348
  removeShapeless: removeShapeless,
340
349
  addFurnace: addFurnace,
341
- removeFurnace: removeFurnace
350
+ removeFurnace: removeFurnace,
351
+ replace: replace
342
352
  });
343
353
 
344
- var index = {
345
- avaritia,
346
- exNihilo,
347
- extraUtilites,
348
- items,
349
- mineFactoryReloaded,
350
- nei,
351
- thermalexpansion,
352
- vanilla
353
- };
354
-
355
- module.exports = index;
354
+ exports.avaritia = avaritia;
355
+ exports.exNihilo = exNihilo;
356
+ exports.extraUtilites = extraUtilities;
357
+ exports.items = items;
358
+ exports.mineFactoryReloaded = mineFactoryReloaded;
359
+ exports.nei = nei;
360
+ exports.thermalexpansion = thermalExpansion;
361
+ exports.vanilla = vanilla;
package/dist/zenflow.d.ts CHANGED
@@ -51,6 +51,9 @@ declare type RecipeShaped = Partial<{
51
51
  7: string;
52
52
  8: string;
53
53
  9: string;
54
+ corner: string;
55
+ edge: string;
56
+ center: string;
54
57
  }>;
55
58
  declare type RecipeShapeless = string[];
56
59
  declare type Recipe = RecipeShaped | RecipeShapeless;
@@ -172,12 +175,12 @@ declare namespace exNihilo {
172
175
  declare const addQED: (item: Item, recipe: RecipeShaped) => string;
173
176
  declare const removeQED: (ingredient: string) => string;
174
177
 
175
- declare const extraUtilites_addQED: typeof addQED;
176
- declare const extraUtilites_removeQED: typeof removeQED;
177
- declare namespace extraUtilites {
178
+ declare const extraUtilities_addQED: typeof addQED;
179
+ declare const extraUtilities_removeQED: typeof removeQED;
180
+ declare namespace extraUtilities {
178
181
  export {
179
- extraUtilites_addQED as addQED,
180
- extraUtilites_removeQED as removeQED,
182
+ extraUtilities_addQED as addQED,
183
+ extraUtilities_removeQED as removeQED,
181
184
  };
182
185
  }
183
186
 
@@ -343,53 +346,53 @@ declare const removeTransposerFill: (ingredient: string, liquid: string) => stri
343
346
  declare const addTransposerExtract: (recipe: RecipeTransposerExtract) => string;
344
347
  declare const removeTransposerExtract: (ingredient: string) => string;
345
348
 
346
- type thermalexpansion_RecipeCrucible = RecipeCrucible;
347
- type thermalexpansion_RecipeInsolator = RecipeInsolator;
348
- type thermalexpansion_RecipePulverizer = RecipePulverizer;
349
- type thermalexpansion_RecipeSawmill = RecipeSawmill;
350
- type thermalexpansion_RecipeSmelter = RecipeSmelter;
351
- type thermalexpansion_RecipeTransposerFill = RecipeTransposerFill;
352
- type thermalexpansion_RecipeTransposerExtract = RecipeTransposerExtract;
353
- declare const thermalexpansion_addCrucible: typeof addCrucible;
354
- declare const thermalexpansion_removeCrucible: typeof removeCrucible;
355
- declare const thermalexpansion_addInsolator: typeof addInsolator;
356
- declare const thermalexpansion_removeInsolator: typeof removeInsolator;
357
- declare const thermalexpansion_addPulverizer: typeof addPulverizer;
358
- declare const thermalexpansion_removePulverizer: typeof removePulverizer;
359
- declare const thermalexpansion_addSawmill: typeof addSawmill;
360
- declare const thermalexpansion_removeSawmill: typeof removeSawmill;
361
- declare const thermalexpansion_addSmelter: typeof addSmelter;
362
- declare const thermalexpansion_removeSmelter: typeof removeSmelter;
363
- declare const thermalexpansion_addTransposerFill: typeof addTransposerFill;
364
- declare const thermalexpansion_removeTransposerFill: typeof removeTransposerFill;
365
- declare const thermalexpansion_addTransposerExtract: typeof addTransposerExtract;
366
- declare const thermalexpansion_removeTransposerExtract: typeof removeTransposerExtract;
367
- declare namespace thermalexpansion {
349
+ type thermalExpansion_RecipeCrucible = RecipeCrucible;
350
+ type thermalExpansion_RecipeInsolator = RecipeInsolator;
351
+ type thermalExpansion_RecipePulverizer = RecipePulverizer;
352
+ type thermalExpansion_RecipeSawmill = RecipeSawmill;
353
+ type thermalExpansion_RecipeSmelter = RecipeSmelter;
354
+ type thermalExpansion_RecipeTransposerFill = RecipeTransposerFill;
355
+ type thermalExpansion_RecipeTransposerExtract = RecipeTransposerExtract;
356
+ declare const thermalExpansion_addCrucible: typeof addCrucible;
357
+ declare const thermalExpansion_removeCrucible: typeof removeCrucible;
358
+ declare const thermalExpansion_addInsolator: typeof addInsolator;
359
+ declare const thermalExpansion_removeInsolator: typeof removeInsolator;
360
+ declare const thermalExpansion_addPulverizer: typeof addPulverizer;
361
+ declare const thermalExpansion_removePulverizer: typeof removePulverizer;
362
+ declare const thermalExpansion_addSawmill: typeof addSawmill;
363
+ declare const thermalExpansion_removeSawmill: typeof removeSawmill;
364
+ declare const thermalExpansion_addSmelter: typeof addSmelter;
365
+ declare const thermalExpansion_removeSmelter: typeof removeSmelter;
366
+ declare const thermalExpansion_addTransposerFill: typeof addTransposerFill;
367
+ declare const thermalExpansion_removeTransposerFill: typeof removeTransposerFill;
368
+ declare const thermalExpansion_addTransposerExtract: typeof addTransposerExtract;
369
+ declare const thermalExpansion_removeTransposerExtract: typeof removeTransposerExtract;
370
+ declare namespace thermalExpansion {
368
371
  export {
369
- thermalexpansion_RecipeCrucible as RecipeCrucible,
372
+ thermalExpansion_RecipeCrucible as RecipeCrucible,
370
373
  RecipeFurnace$1 as RecipeFurnace,
371
- thermalexpansion_RecipeInsolator as RecipeInsolator,
372
- thermalexpansion_RecipePulverizer as RecipePulverizer,
373
- thermalexpansion_RecipeSawmill as RecipeSawmill,
374
- thermalexpansion_RecipeSmelter as RecipeSmelter,
375
- thermalexpansion_RecipeTransposerFill as RecipeTransposerFill,
376
- thermalexpansion_RecipeTransposerExtract as RecipeTransposerExtract,
377
- thermalexpansion_addCrucible as addCrucible,
378
- thermalexpansion_removeCrucible as removeCrucible,
374
+ thermalExpansion_RecipeInsolator as RecipeInsolator,
375
+ thermalExpansion_RecipePulverizer as RecipePulverizer,
376
+ thermalExpansion_RecipeSawmill as RecipeSawmill,
377
+ thermalExpansion_RecipeSmelter as RecipeSmelter,
378
+ thermalExpansion_RecipeTransposerFill as RecipeTransposerFill,
379
+ thermalExpansion_RecipeTransposerExtract as RecipeTransposerExtract,
380
+ thermalExpansion_addCrucible as addCrucible,
381
+ thermalExpansion_removeCrucible as removeCrucible,
379
382
  addFurnace$1 as addFurnace,
380
383
  removeFurnace$1 as removeFurnace,
381
- thermalexpansion_addInsolator as addInsolator,
382
- thermalexpansion_removeInsolator as removeInsolator,
383
- thermalexpansion_addPulverizer as addPulverizer,
384
- thermalexpansion_removePulverizer as removePulverizer,
385
- thermalexpansion_addSawmill as addSawmill,
386
- thermalexpansion_removeSawmill as removeSawmill,
387
- thermalexpansion_addSmelter as addSmelter,
388
- thermalexpansion_removeSmelter as removeSmelter,
389
- thermalexpansion_addTransposerFill as addTransposerFill,
390
- thermalexpansion_removeTransposerFill as removeTransposerFill,
391
- thermalexpansion_addTransposerExtract as addTransposerExtract,
392
- thermalexpansion_removeTransposerExtract as removeTransposerExtract,
384
+ thermalExpansion_addInsolator as addInsolator,
385
+ thermalExpansion_removeInsolator as removeInsolator,
386
+ thermalExpansion_addPulverizer as addPulverizer,
387
+ thermalExpansion_removePulverizer as removePulverizer,
388
+ thermalExpansion_addSawmill as addSawmill,
389
+ thermalExpansion_removeSawmill as removeSawmill,
390
+ thermalExpansion_addSmelter as addSmelter,
391
+ thermalExpansion_removeSmelter as removeSmelter,
392
+ thermalExpansion_addTransposerFill as addTransposerFill,
393
+ thermalExpansion_removeTransposerFill as removeTransposerFill,
394
+ thermalExpansion_addTransposerExtract as addTransposerExtract,
395
+ thermalExpansion_removeTransposerExtract as removeTransposerExtract,
393
396
  };
394
397
  }
395
398
 
@@ -402,7 +405,8 @@ declare const remove: (ingredient: string) => string;
402
405
  declare const removeShaped: (ingredient: string) => string;
403
406
  declare const removeShapeless: (ingredient: string) => string;
404
407
  declare const addFurnace: (recipe: RecipeFurnace) => string;
405
- declare const removeFurnace: (ingredient: string) => string;
408
+ declare const removeFurnace: (ingredient: string) => string;
409
+ declare const replace: (item: Item, recipe: Recipe) => string;
406
410
 
407
411
  declare const vanilla_add: typeof add;
408
412
  declare const vanilla_remove: typeof remove;
@@ -410,6 +414,7 @@ declare const vanilla_removeShaped: typeof removeShaped;
410
414
  declare const vanilla_removeShapeless: typeof removeShapeless;
411
415
  declare const vanilla_addFurnace: typeof addFurnace;
412
416
  declare const vanilla_removeFurnace: typeof removeFurnace;
417
+ declare const vanilla_replace: typeof replace;
413
418
  declare namespace vanilla {
414
419
  export {
415
420
  vanilla_add as add,
@@ -418,18 +423,8 @@ declare namespace vanilla {
418
423
  vanilla_removeShapeless as removeShapeless,
419
424
  vanilla_addFurnace as addFurnace,
420
425
  vanilla_removeFurnace as removeFurnace,
426
+ vanilla_replace as replace,
421
427
  };
422
428
  }
423
429
 
424
- declare const _default: {
425
- avaritia: typeof avaritia;
426
- exNihilo: typeof exNihilo;
427
- extraUtilites: typeof extraUtilites;
428
- items: typeof items;
429
- mineFactoryReloaded: typeof mineFactoryReloaded;
430
- nei: typeof nei;
431
- thermalexpansion: typeof thermalexpansion;
432
- vanilla: typeof vanilla;
433
- };
434
-
435
- export { _default as default };
430
+ export { avaritia, exNihilo, extraUtilities as extraUtilites, items, mineFactoryReloaded, nei, thermalExpansion as thermalexpansion, vanilla };
package/dist/zenflow.mjs CHANGED
@@ -122,9 +122,9 @@ const formatTooltip = (texts) => {
122
122
  };
123
123
  const formatRecipeShaped = (recipe) => {
124
124
  const matrix = [
125
- [recipe[1], recipe[2], recipe[3]],
126
- [recipe[4], recipe[5], recipe[6]],
127
- [recipe[7], recipe[8], recipe[9]]
125
+ [recipe.corner || recipe[1], recipe.edge || recipe[2], recipe.corner || recipe[3]],
126
+ [recipe.edge || recipe[4], recipe.center || recipe[5], recipe.edge || recipe[6]],
127
+ [recipe.corner || recipe[7], recipe.edge || recipe[8], recipe.corner || recipe[9]]
128
128
  ].map((row) => formatList(row.map(formatIngredient)));
129
129
  return `[
130
130
  ${matrix.join(",\n ")}
@@ -215,7 +215,7 @@ var exNihilo = /*#__PURE__*/Object.freeze({
215
215
  const addQED = (item, recipe) => `mods.extraUtils.QED.addShapedRecipe(${formatArgs(item, recipe)});`;
216
216
  const removeQED = (ingredient) => `mods.extraUtils.QED.removeRecipe(${ingredient});`;
217
217
 
218
- var extraUtilites = /*#__PURE__*/Object.freeze({
218
+ var extraUtilities = /*#__PURE__*/Object.freeze({
219
219
  __proto__: null,
220
220
  addQED: addQED,
221
221
  removeQED: removeQED
@@ -299,7 +299,7 @@ const addTransposerExtract = (recipe) => {
299
299
  };
300
300
  const removeTransposerExtract = (ingredient) => `mods.thermalexpansion.Transposer.removeExtractRecipe(${ingredient});`;
301
301
 
302
- var thermalexpansion = /*#__PURE__*/Object.freeze({
302
+ var thermalExpansion = /*#__PURE__*/Object.freeze({
303
303
  __proto__: null,
304
304
  addCrucible: addCrucible,
305
305
  removeCrucible: removeCrucible,
@@ -328,6 +328,13 @@ const removeShaped = (ingredient) => `recipes.removeShaped(${ingredient});`;
328
328
  const removeShapeless = (ingredient) => `recipes.removeShapeless(${ingredient});`;
329
329
  const addFurnace = (recipe) => `furnace.addRecipe(${formatArgs(recipe.out, recipe.in)});`;
330
330
  const removeFurnace = (ingredient) => `furnace.remove(${ingredient});`;
331
+ const replace = (item, recipe) => {
332
+ const ingredient = Array.isArray(item) ? item[0] : item;
333
+ return [
334
+ Array.isArray(recipe) ? removeShapeless(ingredient) : removeShaped(ingredient),
335
+ add(item, recipe)
336
+ ].join("\n");
337
+ };
331
338
 
332
339
  var vanilla = /*#__PURE__*/Object.freeze({
333
340
  __proto__: null,
@@ -336,18 +343,8 @@ var vanilla = /*#__PURE__*/Object.freeze({
336
343
  removeShaped: removeShaped,
337
344
  removeShapeless: removeShapeless,
338
345
  addFurnace: addFurnace,
339
- removeFurnace: removeFurnace
346
+ removeFurnace: removeFurnace,
347
+ replace: replace
340
348
  });
341
349
 
342
- var index = {
343
- avaritia,
344
- exNihilo,
345
- extraUtilites,
346
- items,
347
- mineFactoryReloaded,
348
- nei,
349
- thermalexpansion,
350
- vanilla
351
- };
352
-
353
- export { index as default };
350
+ export { avaritia, exNihilo, extraUtilities as extraUtilites, items, mineFactoryReloaded, nei, thermalExpansion as thermalexpansion, vanilla };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-flow",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "MineTweaker ZenScript made easy.",
5
5
  "main": "dist/zenflow.cjs",
6
6
  "module": "dist/zenflow.mjs",