@adeficior/data-modifier 1.0.0-rc.13 → 1.0.0-rc.15

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.
Files changed (96) hide show
  1. package/dist/emit/data/recipe.d.ts +6 -5
  2. package/dist/emit/data/recipe.js +16 -8
  3. package/dist/emit/data/recipe.js.map +1 -1
  4. package/dist/emit/rule/recipe.d.ts +4 -4
  5. package/dist/emit/rule/recipe.js.map +1 -1
  6. package/dist/loader/recipe.d.ts +3 -3
  7. package/dist/loader/recipe.js +4 -5
  8. package/dist/loader/recipe.js.map +1 -1
  9. package/dist/parser/index.d.ts +1 -1
  10. package/dist/parser/index.js +1 -1
  11. package/dist/parser/index.js.map +1 -1
  12. package/dist/parser/recipe/adAstra/conversion.d.ts +3 -3
  13. package/dist/parser/recipe/adAstra/conversion.js +5 -5
  14. package/dist/parser/recipe/adAstra/conversion.js.map +1 -1
  15. package/dist/parser/recipe/adAstra/inputOutput.d.ts +4 -4
  16. package/dist/parser/recipe/adAstra/inputOutput.js +5 -5
  17. package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
  18. package/dist/parser/recipe/adAstra/spaceStation.d.ts +3 -3
  19. package/dist/parser/recipe/adAstra/spaceStation.js +5 -5
  20. package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
  21. package/dist/parser/recipe/botania/apothecary.d.ts +3 -3
  22. package/dist/parser/recipe/botania/apothecary.js +5 -5
  23. package/dist/parser/recipe/botania/apothecary.js.map +1 -1
  24. package/dist/parser/recipe/botania/blocks.js +1 -1
  25. package/dist/parser/recipe/botania/blocks.js.map +1 -1
  26. package/dist/parser/recipe/botania/brew.d.ts +3 -3
  27. package/dist/parser/recipe/botania/brew.js +5 -5
  28. package/dist/parser/recipe/botania/brew.js.map +1 -1
  29. package/dist/parser/recipe/botania/elvenTrade.js +1 -1
  30. package/dist/parser/recipe/botania/elvenTrade.js.map +1 -1
  31. package/dist/parser/recipe/botania/gogWrapper.d.ts +5 -7
  32. package/dist/parser/recipe/botania/gogWrapper.js +5 -5
  33. package/dist/parser/recipe/botania/gogWrapper.js.map +1 -1
  34. package/dist/parser/recipe/botania/manaInfusion.d.ts +3 -3
  35. package/dist/parser/recipe/botania/manaInfusion.js +5 -5
  36. package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
  37. package/dist/parser/recipe/botania/nbtWrapper.d.ts +5 -7
  38. package/dist/parser/recipe/botania/nbtWrapper.js +5 -5
  39. package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -1
  40. package/dist/parser/recipe/botania/runicAltar.js +1 -1
  41. package/dist/parser/recipe/botania/runicAltar.js.map +1 -1
  42. package/dist/parser/recipe/create/assembly.d.ts +3 -3
  43. package/dist/parser/recipe/create/assembly.js +5 -5
  44. package/dist/parser/recipe/create/assembly.js.map +1 -1
  45. package/dist/parser/recipe/farmersdelight/cooking.d.ts +3 -3
  46. package/dist/parser/recipe/farmersdelight/cooking.js +5 -5
  47. package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
  48. package/dist/parser/recipe/farmersdelight/cutting.d.ts +3 -4
  49. package/dist/parser/recipe/farmersdelight/cutting.js +5 -5
  50. package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
  51. package/dist/parser/recipe/forge/conditional.d.ts +6 -8
  52. package/dist/parser/recipe/forge/conditional.js +7 -7
  53. package/dist/parser/recipe/forge/conditional.js.map +1 -1
  54. package/dist/parser/recipe/index.d.ts +26 -8
  55. package/dist/parser/recipe/index.js +38 -6
  56. package/dist/parser/recipe/index.js.map +1 -1
  57. package/dist/parser/recipe/manyToMany.d.ts +3 -3
  58. package/dist/parser/recipe/manyToMany.js +5 -5
  59. package/dist/parser/recipe/manyToMany.js.map +1 -1
  60. package/dist/parser/recipe/manyToOne.d.ts +3 -3
  61. package/dist/parser/recipe/manyToOne.js +5 -5
  62. package/dist/parser/recipe/manyToOne.js.map +1 -1
  63. package/dist/parser/recipe/oneToOne.d.ts +3 -3
  64. package/dist/parser/recipe/oneToOne.js +5 -5
  65. package/dist/parser/recipe/oneToOne.js.map +1 -1
  66. package/dist/parser/recipe/roots/component.d.ts +3 -3
  67. package/dist/parser/recipe/roots/component.js +5 -5
  68. package/dist/parser/recipe/roots/component.js.map +1 -1
  69. package/dist/parser/recipe/roots/ritual.d.ts +3 -4
  70. package/dist/parser/recipe/roots/ritual.js +5 -5
  71. package/dist/parser/recipe/roots/ritual.js.map +1 -1
  72. package/dist/parser/recipe/thermal/catalyst.d.ts +3 -3
  73. package/dist/parser/recipe/thermal/catalyst.js +5 -5
  74. package/dist/parser/recipe/thermal/catalyst.js.map +1 -1
  75. package/dist/parser/recipe/thermal/fuel.d.ts +3 -3
  76. package/dist/parser/recipe/thermal/fuel.js +5 -5
  77. package/dist/parser/recipe/thermal/fuel.js.map +1 -1
  78. package/dist/parser/recipe/thermal/index.d.ts +3 -3
  79. package/dist/parser/recipe/thermal/index.js +5 -5
  80. package/dist/parser/recipe/thermal/index.js.map +1 -1
  81. package/dist/parser/recipe/thermal/treeExtraction.d.ts +3 -3
  82. package/dist/parser/recipe/thermal/treeExtraction.js +5 -5
  83. package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -1
  84. package/dist/parser/recipe/vanilla/shaped.d.ts +4 -5
  85. package/dist/parser/recipe/vanilla/shaped.js +5 -5
  86. package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
  87. package/dist/parser/recipe/vanilla/smelting.d.ts +3 -3
  88. package/dist/parser/recipe/vanilla/smelting.js +5 -5
  89. package/dist/parser/recipe/vanilla/smelting.js.map +1 -1
  90. package/dist/parser/recipe/vanilla/smithing.d.ts +3 -3
  91. package/dist/parser/recipe/vanilla/smithing.js +5 -5
  92. package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
  93. package/dist/parser/recipe/vanilla/stonecutting.d.ts +3 -3
  94. package/dist/parser/recipe/vanilla/stonecutting.js +5 -5
  95. package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -1
  96. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"treeExtraction.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/treeExtraction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,eAAe,GAEhB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,aAAa,CAAC;AASrB,MAAM,OAAO,oBAAqB,SAAQ,MAAM;IAG3B;IACA;IACA;IAJnB,YACE,UAA4B,EACX,KAAiB,EACjB,MAAkB,EAClB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAJD,UAAK,GAAL,KAAK,CAAY;QACjB,WAAM,GAAN,MAAM,CAAY;QAClB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,oBAAoB,CAC7B,IAAI,CAAC,UAAU,EACf,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAC9B,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAC/B,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,UAAsB;QACrD,IAAI,UAAU,YAAY,eAAe,EAAE,CAAC;YAC1C,OAAO,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,iBAAiB,CACzB,uDAAuD,EACvD,UAAU,CACX,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,O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AAI,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CACvC,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -1,7 +1,6 @@
1
- import type { Ingredient } from "../../../common/ingredient/index.js";
2
1
  import type { Result } from "../../../common/result/index.js";
3
2
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
3
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
4
  import RecipeParser, { Recipe } from "../index.js";
6
5
  import type { IngredientMap, IngredientMapInput } from "../ingredientMap.js";
7
6
  export type ShapedRecipeDefinition = RecipeDefinition & Readonly<{
@@ -12,10 +11,10 @@ export type ShapedRecipeDefinition = RecipeDefinition & Readonly<{
12
11
  export declare class ShapedRecipe extends Recipe {
13
12
  private readonly ingredients;
14
13
  private readonly result;
15
- constructor(definition: RecipeDefinition, ingredients: IngredientMap, result: Result);
16
- getIngredients(): Ingredient[];
14
+ constructor(ingredients: IngredientMap, result: Result);
15
+ getIngredients(): import("../../../common/ingredient/index.js").Ingredient[];
17
16
  getResults(): Result[];
18
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ShapedRecipe;
17
+ replace(modifier: RecipeModifier): ShapedRecipe;
19
18
  serialize(context: RecipeParseContext): Partial<ShapedRecipeDefinition>;
20
19
  }
21
20
  export declare class ShapedParser extends RecipeParser<ShapedRecipeDefinition, ShapedRecipe> {
@@ -2,8 +2,8 @@ import RecipeParser, { Recipe } from "../index.js";
2
2
  export class ShapedRecipe extends Recipe {
3
3
  ingredients;
4
4
  result;
5
- constructor(definition, ingredients, result) {
6
- super(definition);
5
+ constructor(ingredients, result) {
6
+ super();
7
7
  this.ingredients = ingredients;
8
8
  this.result = result;
9
9
  }
@@ -13,8 +13,8 @@ export class ShapedRecipe extends Recipe {
13
13
  getResults() {
14
14
  return [this.result];
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new ShapedRecipe(this.definition, this.ingredients.replace(ingredientReplacer), resultReplacer(this.result));
16
+ replace(modifier) {
17
+ return new ShapedRecipe(this.ingredients.replace(modifier.ingredient), modifier.result(this.result));
18
18
  }
19
19
  serialize(context) {
20
20
  return {
@@ -27,7 +27,7 @@ export class ShapedParser extends RecipeParser {
27
27
  deserialize(definition, context) {
28
28
  const ingredients = context.ingredients.ingredientMap(definition.key);
29
29
  const result = context.results.create(definition.result);
30
- return new ShapedRecipe(definition, ingredients, result);
30
+ return new ShapedRecipe(ingredients, result);
31
31
  }
32
32
  }
33
33
  //# sourceMappingURL=shaped.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shaped.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/shaped.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUnD,MAAM,OAAO,YAAa,SAAQ,MAAM;IAGnB;IACA;IAHnB,YACE,UAA4B,EACX,WAA0B,EAC1B,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAHD,gBAAW,GAAX,WAAW,CAAe;QAC1B,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,CACL,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,YAAY,CACrB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAC5C,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC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,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC;YACxC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,YAGjC;IACC,WAAW,CACT,UAAkC,EAClC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type SmeltingRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  ingredient: unknown;
@@ -11,10 +11,10 @@ export type SmeltingRecipeDefinition = RecipeDefinition & Readonly<{
11
11
  export declare class SmeltingRecipe extends Recipe {
12
12
  private readonly ingredient;
13
13
  private readonly result;
14
- constructor(definition: RecipeDefinition, ingredient: Ingredient, result: Result);
14
+ constructor(ingredient: Ingredient, result: Result);
15
15
  getIngredients(): Ingredient[];
16
16
  getResults(): Result[];
17
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): SmeltingRecipe;
17
+ replace(modifier: RecipeModifier): SmeltingRecipe;
18
18
  serialize(context: RecipeParseContext): Partial<SmeltingRecipeDefinition>;
19
19
  }
20
20
  export declare class SmeltingParser extends RecipeParser<SmeltingRecipeDefinition, SmeltingRecipe> {
@@ -2,8 +2,8 @@ import RecipeParser, { Recipe } from "../index.js";
2
2
  export class SmeltingRecipe extends Recipe {
3
3
  ingredient;
4
4
  result;
5
- constructor(definition, ingredient, result) {
6
- super(definition);
5
+ constructor(ingredient, result) {
6
+ super();
7
7
  this.ingredient = ingredient;
8
8
  this.result = result;
9
9
  }
@@ -13,8 +13,8 @@ export class SmeltingRecipe extends Recipe {
13
13
  getResults() {
14
14
  return [this.result];
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new SmeltingRecipe(this.definition, ingredientReplacer(this.ingredient), resultReplacer(this.result));
16
+ replace(modifier) {
17
+ return new SmeltingRecipe(modifier.ingredient(this.ingredient), modifier.result(this.result));
18
18
  }
19
19
  serialize(context) {
20
20
  return {
@@ -27,7 +27,7 @@ export class SmeltingParser extends RecipeParser {
27
27
  deserialize(definition, context) {
28
28
  const ingredient = context.ingredients.create(definition.ingredient);
29
29
  const result = context.results.create(definition.result);
30
- return new SmeltingRecipe(definition, ingredient, result);
30
+ return new SmeltingRecipe(ingredient, result);
31
31
  }
32
32
  }
33
33
  //# sourceMappingURL=smelting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smelting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smelting.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGrB;IACA;IAHnB,YACE,UAA4B,EACX,UAAsB,EACtB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAHD,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,CAA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AAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,cAAc,CACvB,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EACpC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAC7B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,YAGnC;IACC,WAAW,CACT,UAAoC,EACpC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type SmithingRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  base: unknown;
@@ -12,10 +12,10 @@ export declare class SmithingRecipe extends Recipe {
12
12
  private readonly base;
13
13
  private readonly addition;
14
14
  private readonly result;
15
- constructor(definition: RecipeDefinition, base: Ingredient, addition: Ingredient, result: Result);
15
+ constructor(base: Ingredient, addition: Ingredient, result: Result);
16
16
  getIngredients(): Ingredient[];
17
17
  getResults(): Result[];
18
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): SmithingRecipe;
18
+ replace(modifier: RecipeModifier): SmithingRecipe;
19
19
  serialize(context: RecipeParseContext): Partial<SmithingRecipeDefinition>;
20
20
  }
21
21
  export declare class SmithingParser extends RecipeParser<SmithingRecipeDefinition, SmithingRecipe> {
@@ -3,8 +3,8 @@ export class SmithingRecipe extends Recipe {
3
3
  base;
4
4
  addition;
5
5
  result;
6
- constructor(definition, base, addition, result) {
7
- super(definition);
6
+ constructor(base, addition, result) {
7
+ super();
8
8
  this.base = base;
9
9
  this.addition = addition;
10
10
  this.result = result;
@@ -15,8 +15,8 @@ export class SmithingRecipe extends Recipe {
15
15
  getResults() {
16
16
  return [this.result];
17
17
  }
18
- replace(ingredientReplacer, resultReplacer) {
19
- return new SmithingRecipe(this.definition, ingredientReplacer(this.base), ingredientReplacer(this.addition), resultReplacer(this.result));
18
+ replace(modifier) {
19
+ return new SmithingRecipe(modifier.ingredient(this.base), modifier.ingredient(this.addition), modifier.result(this.result));
20
20
  }
21
21
  serialize(context) {
22
22
  return {
@@ -31,7 +31,7 @@ export class SmithingParser extends RecipeParser {
31
31
  const base = context.ingredients.create(definition.base);
32
32
  const addition = context.ingredients.create(definition.addition);
33
33
  const result = context.results.create(definition.result);
34
- return new SmithingRecipe(definition, base, addition, result);
34
+ return new SmithingRecipe(base, addition, result);
35
35
  }
36
36
  }
37
37
  //# sourceMappingURL=smithing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"smithing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smithing.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAGrB;IACA;IACA;IAJnB,YACE,UAA4B,EACX,IAAgB,EAChB,Q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C;IACC,WAAW,CACT,UAAoC,EACpC,OAA2B;QAE3B,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type StonecuttingRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  ingredient: unknown;
@@ -11,10 +11,10 @@ export type StonecuttingRecipeDefinition = RecipeDefinition & Readonly<{
11
11
  export declare class StonecuttingRecipe extends Recipe {
12
12
  private readonly ingredient;
13
13
  private readonly result;
14
- constructor(definition: RecipeDefinition, ingredient: Ingredient, result: Result);
14
+ constructor(ingredient: Ingredient, result: Result);
15
15
  getIngredients(): Ingredient[];
16
16
  getResults(): Result[];
17
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): StonecuttingRecipe;
17
+ replace(modifier: RecipeModifier): StonecuttingRecipe;
18
18
  serialize(context: RecipeParseContext): Partial<StonecuttingRecipeDefinition>;
19
19
  }
20
20
  export declare class StonecuttingParser extends RecipeParser<StonecuttingRecipeDefinition, StonecuttingRecipe> {
@@ -3,8 +3,8 @@ import RecipeParser, { Recipe } from "../index.js";
3
3
  export class StonecuttingRecipe extends Recipe {
4
4
  ingredient;
5
5
  result;
6
- constructor(definition, ingredient, result) {
7
- super(definition);
6
+ constructor(ingredient, result) {
7
+ super();
8
8
  this.ingredient = ingredient;
9
9
  this.result = result;
10
10
  }
@@ -14,8 +14,8 @@ export class StonecuttingRecipe extends Recipe {
14
14
  getResults() {
15
15
  return [this.result];
16
16
  }
17
- replace(ingredientReplacer, resultReplacer) {
18
- return new StonecuttingRecipe(this.definition, ingredientReplacer(this.ingredient), resultReplacer(this.result));
17
+ replace(modifier) {
18
+ return new StonecuttingRecipe(modifier.ingredient(this.ingredient), modifier.result(this.result));
19
19
  }
20
20
  serialize(context) {
21
21
  return {
@@ -28,7 +28,7 @@ export class StonecuttingParser extends RecipeParser {
28
28
  deserialize(definition, context) {
29
29
  const ingredient = context.ingredients.create(definition.ingredient);
30
30
  const result = context.results.create(definition.result);
31
- return new StonecuttingRecipe(definition, ingredient, result);
31
+ return new StonecuttingRecipe(ingredient, result);
32
32
  }
33
33
  }
34
34
  //# sourceMappingURL=stonecutting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stonecutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/stonecutting.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,qCAAqC;AACrC,MAAM,OAAO,kBAAmB,SAAQ,MAAM;IAGzB;IACA;IAHnB,YACE,UAA4B,EACX,UAAsB,EACtB,MAAc;QAE/B,KAAK,CAAC,UAAU,CAAC,CAAC;QAHD,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,kBA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;QACvC,OAAO,IAAI,kBAAkB,CAC3B,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EACpC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAC7B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,YAGvC;IACC,WAAW,CACT,UAAwC,EACxC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adeficior/data-modifier",
3
- "version": "1.0.0-rc.13",
3
+ "version": "1.0.0-rc.15",
4
4
  "description": "Data Modifier",
5
5
  "main": "dist/index.js",
6
6
  "bin": {