zen-flow 3.0.0 → 3.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Chronocide
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Chronocide
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,89 +1,88 @@
1
- <div align="center">
2
- <img src="logo.png" width="512" alt="logo">
3
- </div>
4
-
5
- <div align="center">
6
- <a href="/LICENSE">
7
- <img alt="License MIT" src="https://img.shields.io/badge/license-MIT-blue.svg" />
8
- </a>
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
- </a>
12
- </div>
13
-
14
- ## Install
15
-
16
- ```shell
17
- $ npm i zen-flow -D
18
- ```
19
-
20
- ***Note**: `zen-flow` only works with Minecraft **1.7.10.***
21
-
22
- ## Features
23
-
24
- - Easy to use API, written in <b>TypeScript</b>.
25
- - <b>Polymorphic</b> and <b>variadic</b>; do more with less code.
26
- - Supports both [MineTweaker3](https://minetweaker3.aizistral.com/wiki/Main_Page) and [ModTweaker](https://minetweaker3.aizistral.com/wiki/ModTweaker).
27
- - <b>Formatted output</b>; makes debugging easier.
28
-
29
- ### Supports
30
-
31
- - Applied Energistics 2
32
- - Avaritia
33
- - Ex Nihilo
34
- - Extra Utilities
35
- - Forestry
36
- - MineFactory Reloaded
37
- - NEI
38
- - Thermal Expansion
39
- - Tinkers' Construct
40
-
41
- ## Example
42
-
43
- ```TypeScript
44
- import { minecraft, nei } from 'zen-flow';
45
-
46
- /**
47
- * recipes.addShaped(<minecraft:saddle>, [
48
- * [<minecraft:leather>, <minecraft:leather>, <minecraft:leather>],
49
- * [<ore:ingotIron>, <minecraft:string>, <ore:ingotIron>],
50
- * [null, null, null]
51
- * ]);
52
- **/
53
- minecraft.add('<minecraft:saddle>', {
54
- 1: '<minecraft:leather>', 2: '<minecraft:leather>', 3: '<minecraft:leather>',
55
- 4: '<ore:ingotIron', 5: '<minecraft:string>', 6: '<ore:ingotIron>'
56
- });
57
-
58
- /**
59
- * recipes.addShaped(<minecraft:saddle>, [
60
- * [null, <minecraft:leather>, null],
61
- * [<minecraft:leather>, null, <minecraft:leather>],
62
- * [null, <minecraft:leather>, null]
63
- * ]);
64
- **/
65
- minecraft.add('<minecraft:saddle>', { edge: '<minecraft:leather>' });
66
-
67
- // Remove & hide Extra Utility generators
68
-
69
- /**
70
- * recipes.remove(<ExtraUtilities:generator>);
71
- * NEI.hide(<ExtraUtilities:generator>);
72
- * [...]
73
- * recipes.remove(<ExtraUtilities:generator.64:10>);
74
- * NEI.hide(<ExtraUtilities:generator.64:10>);
75
- **/
76
- Array.from({ length: 11 })
77
- .map((_, i) => [
78
- `<ExtraUtilities:generator${i === 0 ? '' : `:${i}`}>`,
79
- `<ExtraUtilities:generator.8${i === 0 ? '' : `:${i}`}>`,
80
- `<ExtraUtilities:generator.64${i === 0 ? '' : `:${i}`}>`
81
- ])
82
- .flat()
83
- .map(generator => [
84
- minecraft.remove(generator),
85
- nei.hide(generator)
86
- ].join('\n'));
87
- ```
88
-
89
- More information can be found in the [documentation](https://chronodave.github.io/zen-flow).
1
+ <div align="center">
2
+ <img src="logo.png" width="512" alt="logo">
3
+ </div>
4
+
5
+ <div align="center">
6
+ <a href="/LICENSE">
7
+ <img alt="License MIT" src="https://img.shields.io/badge/license-MIT-blue.svg" />
8
+ </a>
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
+ </a>
12
+ </div>
13
+
14
+ ## Install
15
+
16
+ ```shell
17
+ $ npm i zen-flow -D
18
+ ```
19
+
20
+ ***Note**: `zen-flow` only works with Minecraft **1.7.10.***
21
+
22
+ ## Features
23
+
24
+ - Easy to use API, written in <b>TypeScript</b>.
25
+ - Supports [MineTweaker](https://minetweaker3.aizistral.com/wiki/Main_Page), [ModTweaker](https://minetweaker3.aizistral.com/wiki/ModTweaker) and [ContentTweaker](https://minetweaker3.aizistral.com/wiki/ContentTweaker).
26
+ - Formatted output
27
+
28
+ ### Supports
29
+
30
+ - Applied Energistics 2
31
+ - Avaritia
32
+ - Ex Nihilo
33
+ - Extra Utilities
34
+ - Forestry
35
+ - MineFactory Reloaded
36
+ - NEI
37
+ - Thermal Expansion
38
+ - Tinkers' Construct
39
+
40
+ ## Example
41
+
42
+ ```TypeScript
43
+ import { minecraft, nei } from 'zen-flow';
44
+
45
+ /**
46
+ * recipes.addShaped(<minecraft:saddle>, [
47
+ * [<minecraft:leather>, <minecraft:leather>, <minecraft:leather>],
48
+ * [<ore:ingotIron>, <minecraft:string>, <ore:ingotIron>],
49
+ * [null, null, null]
50
+ * ]);
51
+ **/
52
+ minecraft.add('<minecraft:saddle>', {
53
+ 1: '<minecraft:leather>', 2: '<minecraft:leather>', 3: '<minecraft:leather>',
54
+ 4: '<ore:ingotIron', 5: '<minecraft:string>', 6: '<ore:ingotIron>'
55
+ });
56
+
57
+ /**
58
+ * recipes.addShaped(<minecraft:saddle>, [
59
+ * [null, <minecraft:leather>, null],
60
+ * [<minecraft:leather>, null, <minecraft:leather>],
61
+ * [null, <minecraft:leather>, null]
62
+ * ]);
63
+ **/
64
+ minecraft.add('<minecraft:saddle>', { edge: '<minecraft:leather>' });
65
+
66
+ // Remove & hide Extra Utility generators
67
+
68
+ /**
69
+ * recipes.remove(<ExtraUtilities:generator>);
70
+ * NEI.hide(<ExtraUtilities:generator>);
71
+ * [...]
72
+ * recipes.remove(<ExtraUtilities:generator.64:10>);
73
+ * NEI.hide(<ExtraUtilities:generator.64:10>);
74
+ **/
75
+ Array.from({ length: 11 })
76
+ .map((_, i) => [
77
+ `<ExtraUtilities:generator${i === 0 ? '' : `:${i}`}>`,
78
+ `<ExtraUtilities:generator.8${i === 0 ? '' : `:${i}`}>`,
79
+ `<ExtraUtilities:generator.64${i === 0 ? '' : `:${i}`}>`
80
+ ])
81
+ .flat()
82
+ .map(generator => [
83
+ minecraft.remove(generator),
84
+ nei.hide(generator)
85
+ ].join('\n'));
86
+ ```
87
+
88
+ More information can be found in the [documentation](https://chronodave.github.io/zen-flow).
package/dist/zenflow.cjs CHANGED
@@ -120,6 +120,90 @@ var avaritia = /*#__PURE__*/Object.freeze({
120
120
  removeExtreme: removeExtreme
121
121
  });
122
122
 
123
+ const createBlock = (name, recipe) => {
124
+ const out = formatArgs(
125
+ formatLiteral(name),
126
+ formatLiteral(recipe.id),
127
+ formatLiteral(recipe.material),
128
+ formatLiteral(recipe.texture),
129
+ typeof recipe.creativeTab === "string" && formatLiteral(recipe.creativeTab),
130
+ recipe.renderType,
131
+ recipe.drops,
132
+ recipe.unbreakable,
133
+ typeof recipe.hardness === "number" && formatFloat(recipe.hardness),
134
+ typeof recipe.lightLevel === "number" && formatFloat(recipe.lightLevel),
135
+ recipe.opacity
136
+ );
137
+ return `mods.content.Block.registerBlock(${out});`;
138
+ };
139
+ const createItem = (name, recipe) => {
140
+ const out = formatArgs(
141
+ formatLiteral(name),
142
+ formatLiteral(recipe.id),
143
+ formatLiteral(recipe.texture),
144
+ typeof recipe.creativeTab === "string" && formatLiteral(recipe.creativeTab),
145
+ recipe.damage,
146
+ recipe.stackSize,
147
+ typeof recipe.toolType === "string" && formatLiteral(recipe.toolType),
148
+ recipe.level,
149
+ recipe.is3d,
150
+ Array.isArray(recipe.tooltip) && recipe.tooltip.map(formatLiteral)
151
+ );
152
+ return `mods.content.Item.registerItem(${out});`;
153
+ };
154
+ const createLiquid = (id, recipe) => {
155
+ const out = formatArgs(
156
+ formatLiteral(id),
157
+ recipe.density,
158
+ !!recipe.gaseous,
159
+ recipe.luminosity,
160
+ recipe.temperature,
161
+ recipe.viscosity,
162
+ recipe.colour,
163
+ !!recipe.setFire,
164
+ recipe.castingMaterial,
165
+ typeof recipe.texture?.still === "string" && formatLiteral(recipe.texture.still),
166
+ typeof recipe.texture?.flowing === "string" && formatLiteral(recipe.texture.flowing)
167
+ );
168
+ return `mods.content.Fluid.registerFluid(${out});`;
169
+ };
170
+ const createTinkersMaterial = (id, recipe) => {
171
+ const out = formatArgs(
172
+ formatLiteral(id),
173
+ formatLiteral(recipe.name),
174
+ formatLiteral(recipe.style),
175
+ recipe.resource,
176
+ recipe.material,
177
+ recipe.mining.level,
178
+ recipe.durability,
179
+ recipe.mining.speed,
180
+ recipe.damage,
181
+ recipe.reinforced,
182
+ recipe.colour,
183
+ recipe.value,
184
+ recipe.handleModifier,
185
+ recipe.stonebound,
186
+ !!recipe.buildParts,
187
+ recipe.modifiers,
188
+ formatLiteral(recipe.tooltip),
189
+ recipe.arrow.mass,
190
+ recipe.arrow.breakChance,
191
+ recipe.bow.drawSpeed,
192
+ recipe.bow.speed,
193
+ Array.isArray(recipe.nativeModifiers) && formatArray([formatArray(recipe.nativeModifiers.map(formatIngredient), 2)], 1),
194
+ Array.isArray(recipe.nativeEnchantments) && formatLiteral(recipe.nativeEnchantments.join(" "))
195
+ );
196
+ return `mods.content.Material.registerMaterial(${out});`;
197
+ };
198
+
199
+ var content = /*#__PURE__*/Object.freeze({
200
+ __proto__: null,
201
+ createBlock: createBlock,
202
+ createItem: createItem,
203
+ createLiquid: createLiquid,
204
+ createTinkersMaterial: createTinkersMaterial
205
+ });
206
+
123
207
  const addComposter = (id, recipe) => {
124
208
  const out = formatArgs(
125
209
  id,
@@ -454,6 +538,27 @@ var item = /*#__PURE__*/Object.freeze({
454
538
  withTooltipShift: withTooltipShift
455
539
  });
456
540
 
541
+ const addChestLoot = (id, recipe) => {
542
+ const out = formatArgs(
543
+ formatLiteral(recipe.chest),
544
+ id,
545
+ recipe.chance,
546
+ recipe.n
547
+ );
548
+ return `vanilla.loot.addChestLoot(${out});`;
549
+ };
550
+ const removeChestLoot = (id, chest) => `vanilla.loot.removeChestLoot(${formatArgs(formatLiteral(chest), id)});`;
551
+ const addSeed = (id) => `vanilla.seeds.addSeed(${id});`;
552
+ const removeSeed = (id) => `vanilla.seeds.removeSeed(${id});`;
553
+
554
+ var loot = /*#__PURE__*/Object.freeze({
555
+ __proto__: null,
556
+ addChestLoot: addChestLoot,
557
+ addSeed: addSeed,
558
+ removeChestLoot: removeChestLoot,
559
+ removeSeed: removeSeed
560
+ });
561
+
457
562
  const addShaped = (item, recipe) => {
458
563
  const out = formatArgs(
459
564
  formatIngredient(item),
@@ -994,10 +1099,12 @@ var tinkersConstruct = /*#__PURE__*/Object.freeze({
994
1099
 
995
1100
  exports.appliedEnergistics = appliedEnergistics;
996
1101
  exports.avaritia = avaritia;
1102
+ exports.content = content;
997
1103
  exports.exNihilo = exNihilo;
998
1104
  exports.extraUtilities = extraUtilities;
999
1105
  exports.forestry = forestry;
1000
1106
  exports.item = item;
1107
+ exports.loot = loot;
1001
1108
  exports.mineFactoryReloaded = mineFactoryReloaded;
1002
1109
  exports.minecraft = minecraft;
1003
1110
  exports.nei = nei;
package/dist/zenflow.d.ts CHANGED
@@ -129,6 +129,119 @@ declare namespace avaritia {
129
129
  export { type avaritia_RecipeCompressor as RecipeCompressor, type avaritia_RecipeExtreme as RecipeExtreme, avaritia_addCompressor as addCompressor, avaritia_addExtreme as addExtreme, avaritia_removeCompressor as removeCompressor, avaritia_removeExtreme as removeExtreme };
130
130
  }
131
131
 
132
+ type RecipeBlock = {
133
+ id: string;
134
+ material: string;
135
+ texture: string;
136
+ creativeTab?: string;
137
+ renderType?: number;
138
+ drops?: string[];
139
+ /** If set to `true`, `hardness` is set to `-1` */
140
+ unbreakable?: boolean;
141
+ hardness?: number;
142
+ lightLevel?: number;
143
+ opacity?: number;
144
+ };
145
+ /**
146
+ * Create custom block
147
+ *
148
+ * Textures can be placed in `/config/contenttweaker/icons/blocks/<texture>`
149
+ *
150
+ * @see https://minetweaker3.aizistral.com/wiki/ContentTweaker:BlockItem_Support
151
+ */
152
+ declare const createBlock: (name: string, recipe: RecipeBlock) => string;
153
+ type RecipeItem = {
154
+ id: string;
155
+ texture: string;
156
+ creativeTab?: string;
157
+ damage?: number;
158
+ stackSize?: number;
159
+ toolType?: string;
160
+ level?: number;
161
+ is3d?: boolean;
162
+ tooltip?: string[];
163
+ };
164
+ /**
165
+ * Create custom item
166
+ *
167
+ * Textures can be placed in `/config/contenttweaker/icons/items/<texture>`
168
+ *
169
+ * @see https://minetweaker3.aizistral.com/wiki/ContentTweaker:BlockItem_Support
170
+ */
171
+ declare const createItem: (name: string, recipe: RecipeItem) => string;
172
+ type RecipeFluid = {
173
+ density: number;
174
+ gaseous?: boolean;
175
+ luminosity: number;
176
+ temperature: number;
177
+ viscosity: number;
178
+ colour: string;
179
+ setFire?: boolean;
180
+ castingMaterial?: number;
181
+ texture?: {
182
+ still?: string;
183
+ flowing?: string;
184
+ };
185
+ };
186
+ /**
187
+ * Create custom liquid
188
+ *
189
+ * Textures can be placed in `/config/contenttweaker/icons/blocks/<texture>`
190
+ *
191
+ * @see https://minetweaker3.aizistral.com/wiki/ContentTweaker:BlockItem_Support
192
+ */
193
+ declare const createLiquid: (id: string, recipe: RecipeFluid) => string;
194
+ type RecipeTinkersMaterial = {
195
+ name: string;
196
+ style: string;
197
+ resource: string;
198
+ material: number;
199
+ durability: number;
200
+ mining: {
201
+ speed: number;
202
+ level: number;
203
+ };
204
+ damage: number;
205
+ reinforced: number;
206
+ colour: string;
207
+ value: number;
208
+ handleModifier: number;
209
+ stonebound: number;
210
+ buildParts?: boolean;
211
+ modifiers: number;
212
+ tooltip: string;
213
+ arrow: {
214
+ mass: number;
215
+ breakChance: number;
216
+ };
217
+ bow: {
218
+ drawSpeed: number;
219
+ speed: number;
220
+ };
221
+ nativeModifiers: Ingredient[];
222
+ nativeEnchantments: string[];
223
+ };
224
+ /**
225
+ * Create custom [Tinkers' Construct material](https://tinkers-construct.fandom.com/wiki/Material_Stats)
226
+ *
227
+ * Textures can be placed in `/config/contenttweaker/icons/items/<texture>`
228
+ *
229
+ * @see https://minetweaker3.aizistral.com/wiki/ContentTweaker:BlockItem_Support
230
+ */
231
+ declare const createTinkersMaterial: (id: string, recipe: RecipeTinkersMaterial) => string;
232
+
233
+ type content_RecipeBlock = RecipeBlock;
234
+ type content_RecipeFluid = RecipeFluid;
235
+ type content_RecipeItem = RecipeItem;
236
+ type content_RecipeTinkersMaterial = RecipeTinkersMaterial;
237
+ declare const content_createBlock: typeof createBlock;
238
+ declare const content_createItem: typeof createItem;
239
+ declare const content_createLiquid: typeof createLiquid;
240
+ declare const content_createTinkersMaterial: typeof createTinkersMaterial;
241
+ declare namespace content {
242
+ export { type content_RecipeBlock as RecipeBlock, type content_RecipeFluid as RecipeFluid, type content_RecipeItem as RecipeItem, type content_RecipeTinkersMaterial as RecipeTinkersMaterial, content_createBlock as createBlock, content_createItem as createItem, content_createLiquid as createLiquid, content_createTinkersMaterial as createTinkersMaterial };
243
+ }
244
+
132
245
  type RecipeComposter = {
133
246
  n: number;
134
247
  colour?: string;
@@ -501,6 +614,53 @@ declare namespace item {
501
614
  export { item_COLORS as COLORS, item_ENCHANTMENTS as ENCHANTMENTS, type item_Enchantment as Enchantment, item_FORMATS as FORMATS, item_NAME_COLOR as NAME_COLOR, item_NAME_FORMAT as NAME_FORMAT, item_TOOLTIP_COLOR as TOOLTIP_COLOR, item_TOOLTIP_FORMAT as TOOLTIP_FORMAT, type item_Text as Text, type item_TextRich as TextRich, item_withEnchantment as withEnchantment, item_withName as withName, item_withTag as withTag, item_withTooltip as withTooltip, item_withTooltipShift as withTooltipShift };
502
615
  }
503
616
 
617
+ type RecipeChestLoot = {
618
+ chest: string;
619
+ n?: number;
620
+ chance?: number;
621
+ };
622
+ /**
623
+ * Add item to dungeon loot
624
+ *
625
+ * Common values:
626
+ * - `dungeonChest`
627
+ * - `mineshaftChest`
628
+ *
629
+ * A loot table can be generated using `/mt loot`
630
+ *
631
+ * @see https://minetweaker3.aizistral.com/wiki/Tutorial:Loot
632
+ */
633
+ declare const addChestLoot: (id: string, recipe: RecipeChestLoot) => string;
634
+ /**
635
+ * Remove item to dungeon loot
636
+ *
637
+ * @see https://minetweaker3.aizistral.com/wiki/Tutorial:Loot
638
+ */
639
+ declare const removeChestLoot: (id: string, chest: string) => string;
640
+ /**
641
+ * Add item to tall grass
642
+ *
643
+ * A loot table can be generated using `/mt seeds`
644
+ *
645
+ * @see https://minetweaker3.aizistral.com/wiki/Tutorial:Loot
646
+ */
647
+ declare const addSeed: (id: string) => string;
648
+ /**
649
+ * Remove item from tall grass
650
+ *
651
+ * @see https://minetweaker3.aizistral.com/wiki/Tutorial:Loot
652
+ */
653
+ declare const removeSeed: (id: string) => string;
654
+
655
+ type loot_RecipeChestLoot = RecipeChestLoot;
656
+ declare const loot_addChestLoot: typeof addChestLoot;
657
+ declare const loot_addSeed: typeof addSeed;
658
+ declare const loot_removeChestLoot: typeof removeChestLoot;
659
+ declare const loot_removeSeed: typeof removeSeed;
660
+ declare namespace loot {
661
+ export { type loot_RecipeChestLoot as RecipeChestLoot, loot_addChestLoot as addChestLoot, loot_addSeed as addSeed, loot_removeChestLoot as removeChestLoot, loot_removeSeed as removeSeed };
662
+ }
663
+
504
664
  /**
505
665
  * Add shaped crafting recipe
506
666
  *
@@ -1584,4 +1744,4 @@ declare namespace tinkersConstruct {
1584
1744
  export { tinkersConstruct_MATERIALS as MATERIALS, tinkersConstruct_MODIFIERS as MODIFIERS, type tinkersConstruct_RecipeArrowStats as RecipeArrowStats, type tinkersConstruct_RecipeBowMaterialStats as RecipeBowMaterialStats, type tinkersConstruct_RecipeCastingBasin as RecipeCastingBasin, type tinkersConstruct_RecipeCastingTable as RecipeCastingTable, type tinkersConstruct_RecipeDryingRack as RecipeDryingRack, type tinkersConstruct_RecipeRepairMaterial as RecipeRepairMaterial, type tinkersConstruct_RecipeSmelteryFluid as RecipeSmelteryFluid, type tinkersConstruct_RecipeSmelteryFuel as RecipeSmelteryFuel, type tinkersConstruct_RecipeToolStats as RecipeToolStats, tinkersConstruct_addCastingBasin as addCastingBasin, tinkersConstruct_addCastingTable as addCastingTable, tinkersConstruct_addDryingRack as addDryingRack, tinkersConstruct_addRepairMaterial as addRepairMaterial, tinkersConstruct_addSmelteryAlloy as addSmelteryAlloy, tinkersConstruct_addSmelteryFluid as addSmelteryFluid, tinkersConstruct_addSmelteryFuel as addSmelteryFuel, tinkersConstruct_removeCastingBasin as removeCastingBasin, tinkersConstruct_removeCastingTable as removeCastingTable, tinkersConstruct_removeDryingRack as removeDryingRack, tinkersConstruct_removeModifier as removeModifier, tinkersConstruct_removeRepairMaterial as removeRepairMaterial, tinkersConstruct_removeSmelteryAlloy as removeSmelteryAlloy, tinkersConstruct_removeSmelteryFluid as removeSmelteryFluid, tinkersConstruct_removeSmelteryFuel as removeSmelteryFuel, tinkersConstruct_setArrowAccuracy as setArrowAccuracy, tinkersConstruct_setArrowBreakChance as setArrowBreakChance, tinkersConstruct_setArrowMass as setArrowMass, tinkersConstruct_setArrowStats as setArrowStats, tinkersConstruct_setBowMaterialDrawspeed as setBowMaterialDrawspeed, tinkersConstruct_setBowMaterialDurability as setBowMaterialDurability, tinkersConstruct_setBowMaterialFlightSpeed as setBowMaterialFlightSpeed, tinkersConstruct_setBowMaterialStats as setBowMaterialStats, tinkersConstruct_setMaterialAbility as setMaterialAbility, tinkersConstruct_setMaterialDamage as setMaterialDamage, tinkersConstruct_setMaterialDurability as setMaterialDurability, tinkersConstruct_setMaterialHandleModifier as setMaterialHandleModifier, tinkersConstruct_setMaterialLevelStonebound as setMaterialLevelStonebound, tinkersConstruct_setMaterialMiningLevel as setMaterialMiningLevel, tinkersConstruct_setMaterialName as setMaterialName, tinkersConstruct_setMaterialReinforcedLevel as setMaterialReinforcedLevel, tinkersConstruct_setMaterialSpeed as setMaterialSpeed, tinkersConstruct_setMaterialStats as setMaterialStats, tinkersConstruct_setMaterialStyle as setMaterialStyle };
1585
1745
  }
1586
1746
 
1587
- export { type Bonus, type Cast, type Ingredient, type Recipe, type RecipeShaped, type RecipeShapeless, type Stack, appliedEnergistics, avaritia, exNihilo, extraUtilities, forestry, item, mineFactoryReloaded, minecraft, nei, thermalExpansion, tinkersConstruct };
1747
+ export { type Bonus, type Cast, type Ingredient, type Recipe, type RecipeShaped, type RecipeShapeless, type Stack, appliedEnergistics, avaritia, content, exNihilo, extraUtilities, forestry, item, loot, mineFactoryReloaded, minecraft, nei, thermalExpansion, tinkersConstruct };
package/dist/zenflow.mjs CHANGED
@@ -118,6 +118,90 @@ var avaritia = /*#__PURE__*/Object.freeze({
118
118
  removeExtreme: removeExtreme
119
119
  });
120
120
 
121
+ const createBlock = (name, recipe) => {
122
+ const out = formatArgs(
123
+ formatLiteral(name),
124
+ formatLiteral(recipe.id),
125
+ formatLiteral(recipe.material),
126
+ formatLiteral(recipe.texture),
127
+ typeof recipe.creativeTab === "string" && formatLiteral(recipe.creativeTab),
128
+ recipe.renderType,
129
+ recipe.drops,
130
+ recipe.unbreakable,
131
+ typeof recipe.hardness === "number" && formatFloat(recipe.hardness),
132
+ typeof recipe.lightLevel === "number" && formatFloat(recipe.lightLevel),
133
+ recipe.opacity
134
+ );
135
+ return `mods.content.Block.registerBlock(${out});`;
136
+ };
137
+ const createItem = (name, recipe) => {
138
+ const out = formatArgs(
139
+ formatLiteral(name),
140
+ formatLiteral(recipe.id),
141
+ formatLiteral(recipe.texture),
142
+ typeof recipe.creativeTab === "string" && formatLiteral(recipe.creativeTab),
143
+ recipe.damage,
144
+ recipe.stackSize,
145
+ typeof recipe.toolType === "string" && formatLiteral(recipe.toolType),
146
+ recipe.level,
147
+ recipe.is3d,
148
+ Array.isArray(recipe.tooltip) && recipe.tooltip.map(formatLiteral)
149
+ );
150
+ return `mods.content.Item.registerItem(${out});`;
151
+ };
152
+ const createLiquid = (id, recipe) => {
153
+ const out = formatArgs(
154
+ formatLiteral(id),
155
+ recipe.density,
156
+ !!recipe.gaseous,
157
+ recipe.luminosity,
158
+ recipe.temperature,
159
+ recipe.viscosity,
160
+ recipe.colour,
161
+ !!recipe.setFire,
162
+ recipe.castingMaterial,
163
+ typeof recipe.texture?.still === "string" && formatLiteral(recipe.texture.still),
164
+ typeof recipe.texture?.flowing === "string" && formatLiteral(recipe.texture.flowing)
165
+ );
166
+ return `mods.content.Fluid.registerFluid(${out});`;
167
+ };
168
+ const createTinkersMaterial = (id, recipe) => {
169
+ const out = formatArgs(
170
+ formatLiteral(id),
171
+ formatLiteral(recipe.name),
172
+ formatLiteral(recipe.style),
173
+ recipe.resource,
174
+ recipe.material,
175
+ recipe.mining.level,
176
+ recipe.durability,
177
+ recipe.mining.speed,
178
+ recipe.damage,
179
+ recipe.reinforced,
180
+ recipe.colour,
181
+ recipe.value,
182
+ recipe.handleModifier,
183
+ recipe.stonebound,
184
+ !!recipe.buildParts,
185
+ recipe.modifiers,
186
+ formatLiteral(recipe.tooltip),
187
+ recipe.arrow.mass,
188
+ recipe.arrow.breakChance,
189
+ recipe.bow.drawSpeed,
190
+ recipe.bow.speed,
191
+ Array.isArray(recipe.nativeModifiers) && formatArray([formatArray(recipe.nativeModifiers.map(formatIngredient), 2)], 1),
192
+ Array.isArray(recipe.nativeEnchantments) && formatLiteral(recipe.nativeEnchantments.join(" "))
193
+ );
194
+ return `mods.content.Material.registerMaterial(${out});`;
195
+ };
196
+
197
+ var content = /*#__PURE__*/Object.freeze({
198
+ __proto__: null,
199
+ createBlock: createBlock,
200
+ createItem: createItem,
201
+ createLiquid: createLiquid,
202
+ createTinkersMaterial: createTinkersMaterial
203
+ });
204
+
121
205
  const addComposter = (id, recipe) => {
122
206
  const out = formatArgs(
123
207
  id,
@@ -452,6 +536,27 @@ var item = /*#__PURE__*/Object.freeze({
452
536
  withTooltipShift: withTooltipShift
453
537
  });
454
538
 
539
+ const addChestLoot = (id, recipe) => {
540
+ const out = formatArgs(
541
+ formatLiteral(recipe.chest),
542
+ id,
543
+ recipe.chance,
544
+ recipe.n
545
+ );
546
+ return `vanilla.loot.addChestLoot(${out});`;
547
+ };
548
+ const removeChestLoot = (id, chest) => `vanilla.loot.removeChestLoot(${formatArgs(formatLiteral(chest), id)});`;
549
+ const addSeed = (id) => `vanilla.seeds.addSeed(${id});`;
550
+ const removeSeed = (id) => `vanilla.seeds.removeSeed(${id});`;
551
+
552
+ var loot = /*#__PURE__*/Object.freeze({
553
+ __proto__: null,
554
+ addChestLoot: addChestLoot,
555
+ addSeed: addSeed,
556
+ removeChestLoot: removeChestLoot,
557
+ removeSeed: removeSeed
558
+ });
559
+
455
560
  const addShaped = (item, recipe) => {
456
561
  const out = formatArgs(
457
562
  formatIngredient(item),
@@ -990,4 +1095,4 @@ var tinkersConstruct = /*#__PURE__*/Object.freeze({
990
1095
  setMaterialStyle: setMaterialStyle
991
1096
  });
992
1097
 
993
- export { appliedEnergistics, avaritia, exNihilo, extraUtilities, forestry, item, mineFactoryReloaded, minecraft, nei, thermalExpansion, tinkersConstruct };
1098
+ export { appliedEnergistics, avaritia, content, exNihilo, extraUtilities, forestry, item, loot, mineFactoryReloaded, minecraft, nei, thermalExpansion, tinkersConstruct };
package/package.json CHANGED
@@ -1,54 +1,56 @@
1
- {
2
- "name": "zen-flow",
3
- "version": "3.0.0",
4
- "description": "MineTweaker ZenScript made easy.",
5
- "main": "dist/zenflow.cjs",
6
- "module": "dist/zenflow.mjs",
7
- "types": "dist/zenflow.d.ts",
8
- "type": "module",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/zenflow.mjs",
12
- "require": "./dist/zenflow.cjs"
13
- }
14
- },
15
- "keywords": [
16
- "minetweaker",
17
- "minecraft",
18
- "feed the beast",
19
- "modded",
20
- "zenscript"
21
- ],
22
- "files": [
23
- "dist/**/*"
24
- ],
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/chronoDave/zen-flow.git"
28
- },
29
- "author": "Chronocide",
30
- "license": "MIT",
31
- "engines": {
32
- "node": ">21.1.0"
33
- },
34
- "scripts": {
35
- "lint": "eslint src",
36
- "lint:fix": "eslint src --fix",
37
- "build": "rollup -c",
38
- "build:docs": "typedoc src/index.ts",
39
- "test": "node scripts/tape.js && tape build/**/*.spec.js",
40
- "prepublishOnly": "npm run build && npm run build:docs"
41
- },
42
- "devDependencies": {
43
- "@chronocide/eslint-config": "github:chronoDave/eslint-config",
44
- "@types/tape": "^5.8.0",
45
- "esbuild": "^0.23.1",
46
- "eslint": "^9.9.0",
47
- "rollup": "^4.21.0",
48
- "rollup-plugin-dts": "^6.1.1",
49
- "rollup-plugin-esbuild": "^6.1.1",
50
- "tape": "^5.8.1",
51
- "typedoc": "^0.27.5",
52
- "typescript": "^5.5.4"
53
- }
54
- }
1
+ {
2
+ "name": "zen-flow",
3
+ "version": "3.2.0",
4
+ "description": "MineTweaker ZenScript made easy.",
5
+ "main": "dist/zenflow.cjs",
6
+ "module": "dist/zenflow.mjs",
7
+ "types": "dist/zenflow.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/zenflow.mjs",
12
+ "require": "./dist/zenflow.cjs"
13
+ }
14
+ },
15
+ "keywords": [
16
+ "minetweaker",
17
+ "minecraft",
18
+ "feed the beast",
19
+ "modded",
20
+ "zenscript"
21
+ ],
22
+ "files": [
23
+ "dist/**/*"
24
+ ],
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/chronoDave/zen-flow.git"
28
+ },
29
+ "author": "Chronocide",
30
+ "license": "MIT",
31
+ "engines": {
32
+ "node": ">21.1.0"
33
+ },
34
+ "scripts": {
35
+ "lint": "eslint src",
36
+ "lint:fix": "eslint src --fix",
37
+ "build": "rollup -c",
38
+ "build:docs": "typedoc src/index.ts",
39
+ "test": "node scripts/tape.js && tape build/**/*.spec.js",
40
+ "preversion": "npm run lint && npm run test",
41
+ "postversion": "npm run build:docs",
42
+ "prepublishOnly": "npm run build"
43
+ },
44
+ "devDependencies": {
45
+ "@chronocide/eslint-config": "github:chronoDave/eslint-config",
46
+ "@types/tape": "^5.8.0",
47
+ "esbuild": "^0.23.1",
48
+ "eslint": "^9.9.0",
49
+ "rollup": "^4.21.0",
50
+ "rollup-plugin-dts": "^6.1.1",
51
+ "rollup-plugin-esbuild": "^6.1.1",
52
+ "tape": "^5.8.1",
53
+ "typedoc": "^0.27.5",
54
+ "typescript": "^5.5.4"
55
+ }
56
+ }