zen-flow 1.4.2 → 1.7.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
@@ -111,7 +111,7 @@ Array.from({ length: 11 })
111
111
  - `replace` - Replaced crafting recipe
112
112
  - Shaped recipe: `object`
113
113
  - Shapeless recipe: `Array`
114
- - `replaceAll` - Remove all recipes and all multiple recipes
114
+ - `replaceMany` - Remove all recipes and add multiple recipes
115
115
  - `addFurnace` - Adds furnace recipe
116
116
  - `removeFurnace` - Removes furnace recipe
117
117
 
@@ -166,6 +166,7 @@ Shaped crafting recipes support the following shorthand patterns, in order:
166
166
  - `withTooltipShift` - Add shift item tooltip*
167
167
  - `withTag` - Add item NBT tag data
168
168
  - [Display properties](https://minecraft.fandom.com/wiki/Player.dat_format#Display_Properties)
169
+ - `withEnchantment` - Add item enchantment
169
170
  - `withEnchantments` - Add item enchantments
170
171
 
171
172
  <i>* It is currently not possible to remove item tooltips.</i>
package/dist/zenflow.cjs CHANGED
@@ -209,6 +209,7 @@ const withName = (ingredient, name) => `${ingredient}.displayName = ${formatName
209
209
  const withTooltip = (ingredient, tooltip) => `${ingredient}.addTooltip(${formatTooltip(tooltip)});`;
210
210
  const withTooltipShift = (ingredient, tooltip) => `${ingredient}.addShiftTooltip(${formatTooltip(tooltip)});`;
211
211
  const withTag = (tag) => (ingredient) => `${ingredient}.withTag(${tag});`;
212
+ const withEnchantment = (enchantment) => withTag(`{ ench: ${formatList([formatEnchantment(enchantment)])} }`);
212
213
  const withEnchantments = (enchantments) => withTag(`{ ench: ${formatList(enchantments.map(formatEnchantment))} }`);
213
214
 
214
215
  const addLaser = (item) => `MiningLaser.addOre(${formatArgs(item)});`;
@@ -276,9 +277,9 @@ const replace = (item, recipe) => {
276
277
  add(item, recipe)
277
278
  ].join("\n");
278
279
  };
279
- const replaceAll = (item, recipes) => [
280
+ const replaceMany = (item, recipes) => [
280
281
  remove(Array.isArray(item) ? item[0] : item),
281
- recipes.map((recipe) => add(item, recipe))
282
+ ...recipes.map((recipe) => add(item, recipe))
282
283
  ].join("\n");
283
284
 
284
285
  exports.add = add;
@@ -326,7 +327,8 @@ exports.removeSmelter = removeSmelter;
326
327
  exports.removeTransposerExtract = removeTransposerExtract;
327
328
  exports.removeTransposerFill = removeTransposerFill;
328
329
  exports.replace = replace;
329
- exports.replaceAll = replaceAll;
330
+ exports.replaceMany = replaceMany;
331
+ exports.withEnchantment = withEnchantment;
330
332
  exports.withEnchantments = withEnchantments;
331
333
  exports.withName = withName;
332
334
  exports.withTag = withTag;
package/dist/zenflow.d.ts CHANGED
@@ -133,6 +133,7 @@ declare const withName: (ingredient: string, name: Text | Text[]) => string;
133
133
  declare const withTooltip: (ingredient: string, tooltip: Text | Text[]) => string;
134
134
  declare const withTooltipShift: (ingredient: string, tooltip: Text | Text[]) => string;
135
135
  declare const withTag: (tag: string) => (ingredient: string) => string;
136
+ declare const withEnchantment: (enchantment: Enchantment) => (ingredient: string) => string;
136
137
  declare const withEnchantments: (enchantments: Enchantment[]) => (ingredient: string) => string;
137
138
 
138
139
  declare const addLaser: (item: Item) => string;
@@ -266,6 +267,6 @@ declare const removeShapeless: (ingredient: string) => string;
266
267
  declare const addFurnace: (recipe: RecipeFurnace) => string;
267
268
  declare const removeFurnace: (ingredient: string) => string;
268
269
  declare const replace: (item: Item, recipe: Recipe) => string;
269
- declare const replaceAll: (item: Item, recipes: Recipe[]) => string;
270
+ declare const replaceMany: (item: Item, recipes: Recipe[]) => string;
270
271
 
271
- export { add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addExtreme, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addLaserPreferred, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeExtreme, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removeLaserPreferred, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceAll, withEnchantments, withName, withTag, withTooltip, withTooltipShift };
272
+ export { add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addExtreme, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addLaserPreferred, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeExtreme, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removeLaserPreferred, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceMany, withEnchantment, withEnchantments, withName, withTag, withTooltip, withTooltipShift };
package/dist/zenflow.mjs CHANGED
@@ -205,6 +205,7 @@ const withName = (ingredient, name) => `${ingredient}.displayName = ${formatName
205
205
  const withTooltip = (ingredient, tooltip) => `${ingredient}.addTooltip(${formatTooltip(tooltip)});`;
206
206
  const withTooltipShift = (ingredient, tooltip) => `${ingredient}.addShiftTooltip(${formatTooltip(tooltip)});`;
207
207
  const withTag = (tag) => (ingredient) => `${ingredient}.withTag(${tag});`;
208
+ const withEnchantment = (enchantment) => withTag(`{ ench: ${formatList([formatEnchantment(enchantment)])} }`);
208
209
  const withEnchantments = (enchantments) => withTag(`{ ench: ${formatList(enchantments.map(formatEnchantment))} }`);
209
210
 
210
211
  const addLaser = (item) => `MiningLaser.addOre(${formatArgs(item)});`;
@@ -272,9 +273,9 @@ const replace = (item, recipe) => {
272
273
  add(item, recipe)
273
274
  ].join("\n");
274
275
  };
275
- const replaceAll = (item, recipes) => [
276
+ const replaceMany = (item, recipes) => [
276
277
  remove(Array.isArray(item) ? item[0] : item),
277
- recipes.map((recipe) => add(item, recipe))
278
+ ...recipes.map((recipe) => add(item, recipe))
278
279
  ].join("\n");
279
280
 
280
- export { add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addExtreme, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addLaserPreferred, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeExtreme, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removeLaserPreferred, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceAll, withEnchantments, withName, withTag, withTooltip, withTooltipShift };
281
+ export { add, addComposter, addCompressor, addCrucible$1 as addCrucibleNihilo, addCrucibleSource, addCrucible as addCrucibleThermal, addExtreme, addFurnace, addFurnace$1 as addFurnaceThermal, addHammer, addInsolator, addLaser, addLaserPreferred, addNEI, addPulverizer, addQED, addSawmill, addSieve, addSmelter, addTransposerExtract, addTransposerFill, hide, remove, removeComposter, removeCompressor, removeCrucible$1 as removeCrucibleNihilo, removeCrucibleSource, removeCrucible as removeCrucibleThermal, removeExtreme, removeFurnace, removeFurnace$1 as removeFurnaceThermal, removeHammer, removeInsolator, removeLaser, removeLaserPreferred, removePulverizer, removeQED, removeSawmill, removeShaped, removeShapeless, removeSieve, removeSmelter, removeTransposerExtract, removeTransposerFill, replace, replaceMany, withEnchantment, withEnchantments, withName, withTag, withTooltip, withTooltipShift };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-flow",
3
- "version": "1.4.2",
3
+ "version": "1.7.0",
4
4
  "description": "MineTweaker ZenScript made easy.",
5
5
  "main": "dist/zenflow.cjs",
6
6
  "module": "dist/zenflow.mjs",