@adeficior/data-modifier 1.0.0-rc.12 → 1.0.0-rc.14
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/dist/common/id.d.ts +1 -0
- package/dist/common/id.js +4 -0
- package/dist/common/id.js.map +1 -1
- package/dist/common/ingredient/filter.d.ts +6 -0
- package/dist/common/ingredient/filter.js +97 -0
- package/dist/common/ingredient/filter.js.map +1 -0
- package/dist/common/ingredient/index.d.ts +74 -0
- package/dist/common/ingredient/index.js +112 -0
- package/dist/common/ingredient/index.js.map +1 -0
- package/dist/common/ingredient/input.d.ts +3 -0
- package/dist/common/ingredient/input.js +1 -0
- package/dist/common/ingredient/input.js.map +1 -0
- package/dist/common/ingredient/serializer.d.ts +17 -0
- package/dist/common/ingredient/serializer.js +112 -0
- package/dist/common/ingredient/serializer.js.map +1 -0
- package/dist/common/predicates.d.ts +2 -1
- package/dist/common/predicates.js.map +1 -1
- package/dist/common/result/filter.d.ts +6 -0
- package/dist/common/result/filter.js +68 -0
- package/dist/common/result/filter.js.map +1 -0
- package/dist/common/result/index.d.ts +41 -0
- package/dist/common/result/index.js +59 -0
- package/dist/common/result/index.js.map +1 -0
- package/dist/common/result/input.d.ts +3 -0
- package/dist/common/result/input.js +1 -0
- package/dist/common/result/input.js.map +1 -0
- package/dist/common/result/serializer.d.ts +15 -0
- package/dist/common/result/serializer.js +81 -0
- package/dist/common/result/serializer.js.map +1 -0
- package/dist/common/serializable.d.ts +6 -0
- package/dist/common/serializable.js +1 -0
- package/dist/common/serializable.js.map +1 -0
- package/dist/common/units.d.ts +1 -0
- package/dist/common/units.js +2 -0
- package/dist/common/units.js.map +1 -0
- package/dist/emit/blacklist.d.ts +4 -6
- package/dist/emit/blacklist.js +19 -21
- package/dist/emit/blacklist.js.map +1 -1
- package/dist/emit/data/loot.d.ts +6 -8
- package/dist/emit/data/loot.js +11 -13
- package/dist/emit/data/loot.js.map +1 -1
- package/dist/emit/data/recipe.d.ts +20 -18
- package/dist/emit/data/recipe.js +40 -29
- package/dist/emit/data/recipe.js.map +1 -1
- package/dist/emit/data/tags.d.ts +1 -1
- package/dist/emit/data/tags.js.map +1 -1
- package/dist/emit/polytoneTabs.d.ts +1 -1
- package/dist/emit/polytoneTabs.js +1 -2
- package/dist/emit/polytoneTabs.js.map +1 -1
- package/dist/emit/rule/lootTable.d.ts +2 -1
- package/dist/emit/rule/lootTable.js +4 -2
- package/dist/emit/rule/lootTable.js.map +1 -1
- package/dist/emit/rule/recipe.d.ts +7 -5
- package/dist/emit/rule/recipe.js.map +1 -1
- package/dist/emit/ruled.d.ts +2 -1
- package/dist/emit/ruled.js +5 -2
- package/dist/emit/ruled.js.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/loader/context.d.ts +12 -0
- package/dist/loader/context.js +1 -0
- package/dist/loader/context.js.map +1 -0
- package/dist/loader/pack.d.ts +13 -7
- package/dist/loader/pack.js +43 -25
- package/dist/loader/pack.js.map +1 -1
- package/dist/loader/recipe.d.ts +9 -5
- package/dist/loader/recipe.js +39 -48
- package/dist/loader/recipe.js.map +1 -1
- package/dist/loader/registry/dump.d.ts +0 -2
- package/dist/loader/registry/dump.js +0 -11
- package/dist/loader/registry/dump.js.map +1 -1
- package/dist/loader/registry/index.d.ts +0 -2
- package/dist/loader/registry/wrapped.d.ts +13 -0
- package/dist/loader/registry/wrapped.js +26 -0
- package/dist/loader/registry/wrapped.js.map +1 -0
- package/dist/loader/tags.d.ts +1 -1
- package/dist/loader/tags.js.map +1 -1
- package/dist/parser/adAstra.d.ts +5 -11
- package/dist/parser/adAstra.js +5 -5
- package/dist/parser/adAstra.js.map +1 -1
- package/dist/parser/botania.d.ts +10 -20
- package/dist/parser/botania.js +10 -10
- package/dist/parser/botania.js.map +1 -1
- package/dist/parser/create.d.ts +2 -4
- package/dist/parser/create.js +2 -2
- package/dist/parser/create.js.map +1 -1
- package/dist/parser/index.d.ts +7 -13
- package/dist/parser/index.js +7 -7
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/lootTable.d.ts +7 -6
- package/dist/parser/lootTable.js +25 -23
- package/dist/parser/lootTable.js.map +1 -1
- package/dist/parser/recipe/adAstra/conversion.d.ts +15 -14
- package/dist/parser/recipe/adAstra/conversion.js +27 -20
- package/dist/parser/recipe/adAstra/conversion.js.map +1 -1
- package/dist/parser/recipe/adAstra/hammering.d.ts +3 -17
- package/dist/parser/recipe/adAstra/hammering.js +2 -25
- package/dist/parser/recipe/adAstra/hammering.js.map +1 -1
- package/dist/parser/recipe/adAstra/inputOutput.d.ts +16 -19
- package/dist/parser/recipe/adAstra/inputOutput.js +37 -29
- package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
- package/dist/parser/recipe/adAstra/nasaWorkbench.d.ts +3 -19
- package/dist/parser/recipe/adAstra/nasaWorkbench.js +2 -28
- package/dist/parser/recipe/adAstra/nasaWorkbench.js.map +1 -1
- package/dist/parser/recipe/adAstra/spaceStation.d.ts +15 -14
- package/dist/parser/recipe/adAstra/spaceStation.js +33 -14
- package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
- package/dist/parser/recipe/botania/apothecary.d.ts +17 -14
- package/dist/parser/recipe/botania/apothecary.js +26 -17
- package/dist/parser/recipe/botania/apothecary.js.map +1 -1
- package/dist/parser/recipe/botania/blocks.d.ts +21 -0
- package/dist/parser/recipe/botania/blocks.js +77 -0
- package/dist/parser/recipe/botania/blocks.js.map +1 -0
- package/dist/parser/recipe/botania/brew.d.ts +13 -12
- package/dist/parser/recipe/botania/brew.js +16 -11
- package/dist/parser/recipe/botania/brew.js.map +1 -1
- package/dist/parser/recipe/botania/elvenTrade.d.ts +8 -13
- package/dist/parser/recipe/botania/elvenTrade.js +11 -22
- package/dist/parser/recipe/botania/elvenTrade.js.map +1 -1
- package/dist/parser/recipe/botania/gogWrapper.d.ts +12 -12
- package/dist/parser/recipe/botania/gogWrapper.js +14 -15
- package/dist/parser/recipe/botania/gogWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/manaInfusion.d.ts +18 -15
- package/dist/parser/recipe/botania/manaInfusion.js +29 -21
- package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
- package/dist/parser/recipe/botania/nbtWrapper.d.ts +12 -12
- package/dist/parser/recipe/botania/nbtWrapper.js +12 -13
- package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -1
- package/dist/parser/recipe/botania/orechid.d.ts +3 -30
- package/dist/parser/recipe/botania/orechid.js +2 -72
- package/dist/parser/recipe/botania/orechid.js.map +1 -1
- package/dist/parser/recipe/botania/pureDaisy.d.ts +3 -18
- package/dist/parser/recipe/botania/pureDaisy.js +2 -28
- package/dist/parser/recipe/botania/pureDaisy.js.map +1 -1
- package/dist/parser/recipe/botania/runicAltar.d.ts +8 -13
- package/dist/parser/recipe/botania/runicAltar.js +11 -22
- package/dist/parser/recipe/botania/runicAltar.js.map +1 -1
- package/dist/parser/recipe/botania/terraPlate.d.ts +4 -16
- package/dist/parser/recipe/botania/terraPlate.js +2 -25
- package/dist/parser/recipe/botania/terraPlate.js.map +1 -1
- package/dist/parser/recipe/create/assembly.d.ts +18 -17
- package/dist/parser/recipe/create/assembly.js +28 -28
- package/dist/parser/recipe/create/assembly.js.map +1 -1
- package/dist/parser/recipe/create/processing.d.ts +4 -16
- package/dist/parser/recipe/create/processing.js +2 -25
- package/dist/parser/recipe/create/processing.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cooking.d.ts +16 -12
- package/dist/parser/recipe/farmersdelight/cooking.js +27 -15
- package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
- package/dist/parser/recipe/farmersdelight/cutting.d.ts +14 -15
- package/dist/parser/recipe/farmersdelight/cutting.js +32 -29
- package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
- package/dist/parser/recipe/forge/conditional.d.ts +11 -11
- package/dist/parser/recipe/forge/conditional.js +17 -21
- package/dist/parser/recipe/forge/conditional.js.map +1 -1
- package/dist/parser/recipe/index.d.ts +36 -13
- package/dist/parser/recipe/index.js +38 -5
- package/dist/parser/recipe/index.js.map +1 -1
- package/dist/parser/recipe/ingredientMap.d.ts +12 -0
- package/dist/parser/recipe/ingredientMap.js +17 -0
- package/dist/parser/recipe/ingredientMap.js.map +1 -0
- package/dist/parser/recipe/manyToMany.d.ts +20 -0
- package/dist/parser/recipe/manyToMany.js +33 -0
- package/dist/parser/recipe/manyToMany.js.map +1 -0
- package/dist/parser/recipe/manyToOne.d.ts +20 -0
- package/dist/parser/recipe/manyToOne.js +33 -0
- package/dist/parser/recipe/manyToOne.js.map +1 -0
- package/dist/parser/recipe/oneToOne.d.ts +20 -0
- package/dist/parser/recipe/oneToOne.js +33 -0
- package/dist/parser/recipe/oneToOne.js.map +1 -0
- package/dist/parser/recipe/roots/component.d.ts +13 -12
- package/dist/parser/recipe/roots/component.js +16 -11
- package/dist/parser/recipe/roots/component.js.map +1 -1
- package/dist/parser/recipe/roots/ritual.d.ts +14 -16
- package/dist/parser/recipe/roots/ritual.js +18 -25
- package/dist/parser/recipe/roots/ritual.js.map +1 -1
- package/dist/parser/recipe/sullys/polishing.d.ts +4 -16
- package/dist/parser/recipe/sullys/polishing.js +2 -25
- package/dist/parser/recipe/sullys/polishing.js.map +1 -1
- package/dist/parser/recipe/thermal/catalyst.d.ts +13 -12
- package/dist/parser/recipe/thermal/catalyst.js +16 -11
- package/dist/parser/recipe/thermal/catalyst.js.map +1 -1
- package/dist/parser/recipe/thermal/fuel.d.ts +13 -12
- package/dist/parser/recipe/thermal/fuel.js +17 -11
- package/dist/parser/recipe/thermal/fuel.js.map +1 -1
- package/dist/parser/recipe/thermal/index.d.ts +16 -14
- package/dist/parser/recipe/thermal/index.js +35 -24
- package/dist/parser/recipe/thermal/index.js.map +1 -1
- package/dist/parser/recipe/thermal/ingredient.d.ts +4 -21
- package/dist/parser/recipe/thermal/ingredient.js +40 -33
- package/dist/parser/recipe/thermal/ingredient.js.map +1 -1
- package/dist/parser/recipe/thermal/treeExtraction.d.ts +17 -17
- package/dist/parser/recipe/thermal/treeExtraction.js +30 -31
- package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -1
- package/dist/parser/recipe/vanilla/shaped.d.ts +17 -13
- package/dist/parser/recipe/vanilla/shaped.js +21 -16
- package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
- package/dist/parser/recipe/vanilla/shapeless.d.ts +3 -17
- package/dist/parser/recipe/vanilla/shapeless.js +2 -25
- package/dist/parser/recipe/vanilla/shapeless.js.map +1 -1
- package/dist/parser/recipe/vanilla/smelting.d.ts +16 -13
- package/dist/parser/recipe/vanilla/smelting.js +21 -15
- package/dist/parser/recipe/vanilla/smelting.js.map +1 -1
- package/dist/parser/recipe/vanilla/smithing.d.ts +18 -14
- package/dist/parser/recipe/vanilla/smithing.js +25 -16
- package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
- package/dist/parser/recipe/vanilla/stonecutting.d.ts +15 -13
- package/dist/parser/recipe/vanilla/stonecutting.js +22 -24
- package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -1
- package/dist/parser/roots.d.ts +2 -4
- package/dist/parser/roots.js +2 -2
- package/dist/parser/roots.js.map +1 -1
- package/dist/parser/thermal.d.ts +4 -10
- package/dist/parser/thermal.js +4 -5
- package/dist/parser/thermal.js.map +1 -1
- package/dist/schema/data/recipe.d.ts +2 -1
- package/package.json +2 -1
- package/dist/common/ingredient.d.ts +0 -49
- package/dist/common/ingredient.js +0 -108
- package/dist/common/ingredient.js.map +0 -1
- package/dist/common/result.d.ts +0 -48
- package/dist/common/result.js +0 -37
- package/dist/common/result.js.map +0 -1
- package/dist/parser/recipe/adAstra/index.d.ts +0 -5
- package/dist/parser/recipe/adAstra/index.js +0 -1
- package/dist/parser/recipe/adAstra/index.js.map +0 -1
- package/dist/parser/recipe/ignored.d.ts +0 -10
- package/dist/parser/recipe/ignored.js +0 -16
- package/dist/parser/recipe/ignored.js.map +0 -1
- package/dist/parser/recipe/quark/exclusion.d.ts +0 -20
- package/dist/parser/recipe/quark/exclusion.js +0 -32
- package/dist/parser/recipe/quark/exclusion.js.map +0 -1
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
1
|
+
import RecipeParser, { Recipe, } from "../index.js";
|
|
2
2
|
export class ApothecaryRecipe extends Recipe {
|
|
3
|
+
ingredients;
|
|
4
|
+
result;
|
|
5
|
+
reagent;
|
|
6
|
+
constructor(ingredients, result, reagent) {
|
|
7
|
+
super();
|
|
8
|
+
this.ingredients = ingredients;
|
|
9
|
+
this.result = result;
|
|
10
|
+
this.reagent = reagent;
|
|
11
|
+
}
|
|
3
12
|
getIngredients() {
|
|
4
|
-
return [...this.
|
|
13
|
+
return [...this.ingredients, this.reagent];
|
|
5
14
|
}
|
|
6
15
|
getResults() {
|
|
7
|
-
return [this.
|
|
16
|
+
return [this.result];
|
|
8
17
|
}
|
|
9
|
-
|
|
10
|
-
return new ApothecaryRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
reagent: replace(this.definition.reagent),
|
|
13
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
14
|
-
});
|
|
18
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
19
|
+
return new ApothecaryRecipe(this.ingredients.map(ingredientReplacer), resultReplacer(this.result), ingredientReplacer(this.reagent));
|
|
15
20
|
}
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
output:
|
|
20
|
-
|
|
21
|
+
serialize(context) {
|
|
22
|
+
return {
|
|
23
|
+
ingredients: context.ingredients.serializeList(this.ingredients),
|
|
24
|
+
output: context.results.serialize(this.result),
|
|
25
|
+
reagent: context.ingredients.serialize(this.reagent),
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
export class ApothecaryRecipeParser extends RecipeParser {
|
|
30
|
+
deserialize(definition, context) {
|
|
31
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
32
|
+
const result = context.results.create(definition.output);
|
|
33
|
+
const reagent = context.ingredients.create(definition.ingredients);
|
|
34
|
+
return new ApothecaryRecipe(ingredients, result, reagent);
|
|
26
35
|
}
|
|
27
36
|
}
|
|
28
37
|
//# sourceMappingURL=apothecary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apothecary.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/apothecary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apothecary.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/apothecary.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,aAAa,CAAC;AASrB,MAAM,OAAO,gBAAiB,SAAQ,MAAM;IAErB;IACA;IACA;IAHrB,YACqB,WAAyB,EACzB,MAAc,EACd,OAAmB;QAEtC,KAAK,EAAE,CAAC;QAJW,gBAAW,GAAX,WAAW,CAAc;QACzB,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAAY;IAGxC,CAAC;IAEQ,cAAc;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEQ,UAAU;QACjB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACxC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAC3B,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CACjC,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;YAChE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;SACrD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACnE,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BlockLikeIngredient, Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type IngredientSerializer from "../../../common/ingredient/serializer.js";
|
|
3
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
|
+
import type ResultSerializer from "../../../common/result/serializer.js";
|
|
5
|
+
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
6
|
+
import RecipeParser, { type RecipeParseContext } from "../index.js";
|
|
7
|
+
import { OneToOneRecipe } from "../oneToOne.js";
|
|
8
|
+
export declare function serializeBlockInput(ingredient: Ingredient): unknown;
|
|
9
|
+
export declare function serializeBlockOutput(result: Result | Ingredient): unknown;
|
|
10
|
+
export declare function deserializeBlockInput(ingredients: IngredientSerializer, input: unknown): BlockLikeIngredient;
|
|
11
|
+
export declare function deserializeBlockOutput(results: ResultSerializer, output: unknown): Result;
|
|
12
|
+
export type BotaniaBlockRecipeDefinition = RecipeDefinition & Readonly<{
|
|
13
|
+
input: unknown;
|
|
14
|
+
output: unknown;
|
|
15
|
+
}>;
|
|
16
|
+
export declare class BotaniaBlockRecipe extends OneToOneRecipe {
|
|
17
|
+
serialize(): Partial<BotaniaBlockRecipeDefinition>;
|
|
18
|
+
}
|
|
19
|
+
export default class BotaniaBlockRecipeParser<TDefinition extends BotaniaBlockRecipeDefinition> extends RecipeParser<TDefinition, BotaniaBlockRecipe> {
|
|
20
|
+
deserialize(definition: TDefinition, context: RecipeParseContext): BotaniaBlockRecipe;
|
|
21
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { encodeId, IdSchema } from "../../../common/id.js";
|
|
3
|
+
import { BlockIngredient, BlockTagIngredient, } from "../../../common/ingredient/index.js";
|
|
4
|
+
import { BlockResult } from "../../../common/result/index.js";
|
|
5
|
+
import { IllegalShapeError } from "../../../error.js";
|
|
6
|
+
import RecipeParser, {} from "../index.js";
|
|
7
|
+
import { OneToOneRecipe } from "../oneToOne.js";
|
|
8
|
+
const BlockOutputSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
name: IdSchema,
|
|
11
|
+
})
|
|
12
|
+
.or(IdSchema);
|
|
13
|
+
const BlockInputSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
type: z.literal("block"),
|
|
16
|
+
block: IdSchema,
|
|
17
|
+
})
|
|
18
|
+
.or(z.object({
|
|
19
|
+
type: z.literal("tag"),
|
|
20
|
+
tag: IdSchema,
|
|
21
|
+
}));
|
|
22
|
+
export function serializeBlockInput(ingredient) {
|
|
23
|
+
if (ingredient instanceof BlockIngredient)
|
|
24
|
+
return {
|
|
25
|
+
type: "block",
|
|
26
|
+
block: encodeId(ingredient.id),
|
|
27
|
+
};
|
|
28
|
+
if (ingredient instanceof BlockTagIngredient)
|
|
29
|
+
return {
|
|
30
|
+
type: "tag",
|
|
31
|
+
tag: encodeId(ingredient.tag),
|
|
32
|
+
};
|
|
33
|
+
throw new IllegalShapeError("invalid botania block input ingredient", ingredient);
|
|
34
|
+
}
|
|
35
|
+
export function serializeBlockOutput(result) {
|
|
36
|
+
if (result instanceof BlockResult)
|
|
37
|
+
return {
|
|
38
|
+
name: encodeId(result.id),
|
|
39
|
+
};
|
|
40
|
+
if (result instanceof BlockIngredient)
|
|
41
|
+
return {
|
|
42
|
+
name: encodeId(result.id),
|
|
43
|
+
};
|
|
44
|
+
throw new IllegalShapeError("invalid botania block output result", result);
|
|
45
|
+
}
|
|
46
|
+
export function deserializeBlockInput(ingredients, input) {
|
|
47
|
+
const parsed = BlockInputSchema.parse(input);
|
|
48
|
+
switch (parsed.type) {
|
|
49
|
+
case "block":
|
|
50
|
+
return ingredients.validated(new BlockIngredient(parsed.block));
|
|
51
|
+
case "tag":
|
|
52
|
+
return ingredients.validated(new BlockTagIngredient(parsed.tag));
|
|
53
|
+
default:
|
|
54
|
+
throw new IllegalShapeError(`invalid block input type`, input);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function deserializeBlockOutput(results, output) {
|
|
58
|
+
const parsed = BlockOutputSchema.parse(output);
|
|
59
|
+
const id = typeof parsed === "string" ? parsed : parsed.name;
|
|
60
|
+
return results.create(new BlockResult(id));
|
|
61
|
+
}
|
|
62
|
+
export class BotaniaBlockRecipe extends OneToOneRecipe {
|
|
63
|
+
serialize() {
|
|
64
|
+
return {
|
|
65
|
+
output: serializeBlockOutput(this.result),
|
|
66
|
+
input: serializeBlockOutput(this.ingredient),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export default class BotaniaBlockRecipeParser extends RecipeParser {
|
|
71
|
+
deserialize(definition, context) {
|
|
72
|
+
const ingredient = deserializeBlockInput(context.ingredients, definition.input);
|
|
73
|
+
const result = deserializeBlockOutput(context.results, definition.output);
|
|
74
|
+
return new BotaniaBlockRecipe(ingredient, result);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=blocks.js.map
|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SAAS;QAChB,OAAO;YACL,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC;YACzC,KAAK,EAAE,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC;SAC7C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,CAAC,OAAO,OAAO,wBAEnB,SAAQ,YAA6C;IACrD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,UAAU,GAAG,qBAAqB,CACtC,OAAO,CAAC,WAAW,EACnB,UAAU,CAAC,KAAK,CACjB,CAAC;QACF,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAC1E,OAAO,IAAI,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
4
2
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
3
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
4
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
5
|
export type BrewRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients:
|
|
6
|
+
ingredients: unknown[];
|
|
8
7
|
brew: string;
|
|
9
8
|
}>;
|
|
10
|
-
export declare class BrewRecipe extends Recipe
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
export declare class BrewRecipe extends Recipe {
|
|
10
|
+
private readonly ingredients;
|
|
11
|
+
constructor(ingredients: Ingredient[]);
|
|
12
|
+
getIngredients(): Ingredient[];
|
|
13
|
+
getResults(): never[];
|
|
14
|
+
replace(ingredientReplacer: Replacer<Ingredient>): BrewRecipe;
|
|
15
|
+
serialize(context: RecipeParseContext): Partial<BrewRecipeDefinition>;
|
|
15
16
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
17
|
+
export declare class BrewRecipeParser extends RecipeParser<BrewRecipeDefinition, BrewRecipe> {
|
|
18
|
+
deserialize(definition: BrewRecipeDefinition, context: RecipeParseContext): BrewRecipe;
|
|
18
19
|
}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class BrewRecipe extends Recipe {
|
|
3
|
+
ingredients;
|
|
4
|
+
constructor(ingredients) {
|
|
5
|
+
super();
|
|
6
|
+
this.ingredients = ingredients;
|
|
7
|
+
}
|
|
3
8
|
getIngredients() {
|
|
4
|
-
return this.
|
|
9
|
+
return this.ingredients;
|
|
5
10
|
}
|
|
6
11
|
getResults() {
|
|
7
12
|
return [];
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
return new BrewRecipe(
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
-
});
|
|
14
|
+
replace(ingredientReplacer) {
|
|
15
|
+
return new BrewRecipe(this.ingredients.map(ingredientReplacer));
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
+
serialize(context) {
|
|
18
|
+
return {
|
|
19
|
+
ingredients: context.ingredients.serializeList(this.ingredients),
|
|
20
|
+
};
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
export class BrewRecipeParser extends RecipeParser {
|
|
24
|
+
deserialize(definition, context) {
|
|
25
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
26
|
+
return new BrewRecipe(ingredients);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
//# sourceMappingURL=brew.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brew.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/brew.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brew.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/brew.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,UAAW,SAAQ,MAAM;IACP;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAClE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,YAGrC;IACC,WAAW,CACT,UAAgC,EAChC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import type { Replacer } from "../index.js";
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
1
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import
|
|
2
|
+
import RecipeParser, { type RecipeParseContext } from "../index.js";
|
|
3
|
+
import { ManyToManyRecipe } from "../manyToMany.js";
|
|
6
4
|
export type ElvenTradeRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
|
-
ingredients:
|
|
8
|
-
output:
|
|
5
|
+
ingredients: unknown[];
|
|
6
|
+
output: unknown[];
|
|
9
7
|
mana?: number;
|
|
10
8
|
}>;
|
|
11
|
-
export declare class ElvenTradeRecipe extends
|
|
12
|
-
|
|
13
|
-
getResults(): ResultInput[];
|
|
14
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
15
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
9
|
+
export declare class ElvenTradeRecipe extends ManyToManyRecipe {
|
|
10
|
+
serialize(context: RecipeParseContext): Partial<ElvenTradeRecipeDefinition>;
|
|
16
11
|
}
|
|
17
|
-
export
|
|
18
|
-
|
|
12
|
+
export declare class ElvenTradeRecipeParser extends RecipeParser<ElvenTradeRecipeDefinition, ElvenTradeRecipe> {
|
|
13
|
+
deserialize(definition: ElvenTradeRecipeDefinition, context: RecipeParseContext): ElvenTradeRecipe;
|
|
19
14
|
}
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import RecipeParser, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return this.definition.output;
|
|
8
|
-
}
|
|
9
|
-
replaceIngredient(replace) {
|
|
10
|
-
return new ElvenTradeRecipe({
|
|
11
|
-
...this.definition,
|
|
12
|
-
ingredients: this.definition.ingredients.map(replace),
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
replaceResult(replace) {
|
|
16
|
-
return new ElvenTradeRecipe({
|
|
17
|
-
...this.definition,
|
|
18
|
-
output: this.definition.output.map(replace),
|
|
19
|
-
});
|
|
1
|
+
import RecipeParser, {} from "../index.js";
|
|
2
|
+
import { ManyToManyRecipe } from "../manyToMany.js";
|
|
3
|
+
export class ElvenTradeRecipe extends ManyToManyRecipe {
|
|
4
|
+
serialize(context) {
|
|
5
|
+
const { results, ...rest } = super.serialize(context);
|
|
6
|
+
return { ...rest, output: results };
|
|
20
7
|
}
|
|
21
8
|
}
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
export class ElvenTradeRecipeParser extends RecipeParser {
|
|
10
|
+
deserialize(definition, context) {
|
|
11
|
+
const ingredients = context.ingredients.createList(definition.ingredients);
|
|
12
|
+
const results = context.results.createList(definition.output);
|
|
13
|
+
return new ElvenTradeRecipe(ingredients, results);
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
//# sourceMappingURL=elvenTrade.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elvenTrade.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/elvenTrade.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"elvenTrade.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/elvenTrade.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAA2B,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AASpD,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAC3C,SAAS,CAChB,OAA2B;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { RecipeHolder, RecipeParseContext, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type GogWrapperRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
nbt: string;
|
|
8
8
|
base: RecipeDefinition;
|
|
9
9
|
gog: RecipeDefinition;
|
|
10
10
|
}>;
|
|
11
|
-
export declare class GogWrapperRecipe extends Recipe
|
|
11
|
+
export declare class GogWrapperRecipe extends Recipe {
|
|
12
12
|
private readonly base;
|
|
13
13
|
private readonly gog;
|
|
14
|
-
constructor(
|
|
15
|
-
getIngredients():
|
|
16
|
-
getResults():
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
constructor(base: RecipeHolder, gog: RecipeHolder);
|
|
15
|
+
getIngredients(): Ingredient[];
|
|
16
|
+
getResults(): Result[];
|
|
17
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): GogWrapperRecipe;
|
|
18
|
+
serialize(context: RecipeParseContext): Partial<GogWrapperRecipeDefinition>;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
21
|
-
|
|
20
|
+
export declare class GogWrapperRecipeParser extends RecipeParser<GogWrapperRecipeDefinition, GogWrapperRecipe> {
|
|
21
|
+
deserialize(definition: GogWrapperRecipeDefinition, context: RecipeParseContext): GogWrapperRecipe;
|
|
22
22
|
}
|
|
@@ -2,12 +2,8 @@ import RecipeParser, { Recipe } from "../index.js";
|
|
|
2
2
|
export class GogWrapperRecipe extends Recipe {
|
|
3
3
|
base;
|
|
4
4
|
gog;
|
|
5
|
-
constructor(
|
|
6
|
-
super(
|
|
7
|
-
...definition,
|
|
8
|
-
base: base.toJSON(),
|
|
9
|
-
gog: gog.toJSON(),
|
|
10
|
-
});
|
|
5
|
+
constructor(base, gog) {
|
|
6
|
+
super();
|
|
11
7
|
this.base = base;
|
|
12
8
|
this.gog = gog;
|
|
13
9
|
}
|
|
@@ -17,18 +13,21 @@ export class GogWrapperRecipe extends Recipe {
|
|
|
17
13
|
getResults() {
|
|
18
14
|
return [...this.base.getResults(), ...this.gog.getResults()];
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
return new GogWrapperRecipe(this.
|
|
16
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
17
|
+
return new GogWrapperRecipe(this.base.replace(ingredientReplacer, resultReplacer), this.gog.replace(ingredientReplacer, resultReplacer));
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
return
|
|
19
|
+
serialize(context) {
|
|
20
|
+
return {
|
|
21
|
+
base: context.recipes.serialize(this.base),
|
|
22
|
+
gog: context.recipes.serialize(this.gog),
|
|
23
|
+
};
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
const base =
|
|
30
|
-
const gog =
|
|
31
|
-
return new GogWrapperRecipe(
|
|
26
|
+
export class GogWrapperRecipeParser extends RecipeParser {
|
|
27
|
+
deserialize(definition, context) {
|
|
28
|
+
const base = context.recipes.deserialize(definition.base);
|
|
29
|
+
const gog = context.recipes.deserialize(definition.gog);
|
|
30
|
+
return new GogWrapperRecipe(base, gog);
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
//# sourceMappingURL=gogWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gogWrapper.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/gogWrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gogWrapper.js","sourceRoot":"","s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CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACxD,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
6
|
-
import
|
|
4
|
+
import type { RecipeParseContext, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
7
6
|
export type ManaInfusionRecipeDefinition = RecipeDefinition & Readonly<{
|
|
8
|
-
input:
|
|
9
|
-
output:
|
|
10
|
-
catalyst?:
|
|
7
|
+
input: unknown;
|
|
8
|
+
output: unknown;
|
|
9
|
+
catalyst?: unknown;
|
|
11
10
|
mana?: number;
|
|
12
11
|
}>;
|
|
13
|
-
export declare class ManaInfusionRecipe extends Recipe
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
export declare class ManaInfusionRecipe extends Recipe {
|
|
13
|
+
private readonly ingredient;
|
|
14
|
+
private readonly result;
|
|
15
|
+
private readonly catalyst?;
|
|
16
|
+
constructor(ingredient: Ingredient, result: Result, catalyst?: Ingredient | undefined);
|
|
17
|
+
getIngredients(): Ingredient[];
|
|
18
|
+
getResults(): Result[];
|
|
19
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ManaInfusionRecipe;
|
|
20
|
+
serialize(context: RecipeParseContext): Partial<ManaInfusionRecipeDefinition>;
|
|
18
21
|
}
|
|
19
|
-
export
|
|
20
|
-
|
|
22
|
+
export declare class ManaInfusionRecipeParser extends RecipeParser<ManaInfusionRecipeDefinition, ManaInfusionRecipe> {
|
|
23
|
+
deserialize(definition: ManaInfusionRecipeDefinition, context: RecipeParseContext): ManaInfusionRecipe;
|
|
21
24
|
}
|
|
@@ -1,33 +1,41 @@
|
|
|
1
|
+
import { exists } from "@adeficior/pack-resolver";
|
|
1
2
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
-
import {
|
|
3
|
+
import { deserializeBlockInput, serializeBlockInput } from "./blocks.js";
|
|
3
4
|
export class ManaInfusionRecipe extends Recipe {
|
|
5
|
+
ingredient;
|
|
6
|
+
result;
|
|
7
|
+
catalyst;
|
|
8
|
+
constructor(ingredient, result, catalyst) {
|
|
9
|
+
super();
|
|
10
|
+
this.ingredient = ingredient;
|
|
11
|
+
this.result = result;
|
|
12
|
+
this.catalyst = catalyst;
|
|
13
|
+
}
|
|
4
14
|
getIngredients() {
|
|
5
|
-
|
|
6
|
-
return [this.definition.input];
|
|
7
|
-
return [fromBlockInput(this.definition.catalyst), this.definition.input];
|
|
15
|
+
return [this.ingredient, this.catalyst].filter(exists);
|
|
8
16
|
}
|
|
9
17
|
getResults() {
|
|
10
|
-
return [this.
|
|
18
|
+
return [this.result];
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
return new ManaInfusionRecipe(
|
|
14
|
-
...this.definition,
|
|
15
|
-
input: replace(this.definition.input),
|
|
16
|
-
catalyst: (this.definition.catalyst &&
|
|
17
|
-
createBlockInput(replace(fromBlockInput(this.definition.catalyst)))) ??
|
|
18
|
-
this.definition.catalyst,
|
|
19
|
-
});
|
|
20
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
21
|
+
return new ManaInfusionRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result), this.catalyst && ingredientReplacer(this.catalyst));
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
output:
|
|
25
|
-
|
|
23
|
+
serialize(context) {
|
|
24
|
+
return {
|
|
25
|
+
input: context.ingredients.serialize(this.ingredient),
|
|
26
|
+
output: context.results.serialize(this.result),
|
|
27
|
+
catalyst: this.catalyst && serializeBlockInput(this.catalyst),
|
|
28
|
+
};
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
export class ManaInfusionRecipeParser extends RecipeParser {
|
|
32
|
+
deserialize(definition, context) {
|
|
33
|
+
const catalyst = definition.catalyst === undefined
|
|
34
|
+
? undefined
|
|
35
|
+
: deserializeBlockInput(context.ingredients, definition.catalyst);
|
|
36
|
+
const ingredient = context.ingredients.create(definition.input);
|
|
37
|
+
const result = context.results.create(definition.output);
|
|
38
|
+
return new ManaInfusionRecipe(ingredient, result, catalyst);
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
//# sourceMappingURL=manaInfusion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manaInfusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/manaInfusion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manaInfusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/botania/manaInfusion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKlD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUzE,MAAM,OAAO,kBAAmB,SAAQ,MAAM;IAEzB;IACA;IACA;IAHnB,YACmB,UAAsB,EACtB,MAAc,EACd,QAAqB;QAEtC,KAAK,EAAE,CAAC;QAJS,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAa;IAGxC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,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
import
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
1
|
+
import type { Ingredient } from "../../../common/ingredient/index.js";
|
|
2
|
+
import type { Result } from "../../../common/result/index.js";
|
|
4
3
|
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type {
|
|
4
|
+
import type { RecipeHolder, RecipeParseContext, Replacer } from "../index.js";
|
|
5
|
+
import RecipeParser, { Recipe } from "../index.js";
|
|
6
6
|
export type NbtWrapperRecipeDefinition = RecipeDefinition & Readonly<{
|
|
7
7
|
nbt: string;
|
|
8
8
|
recipe: RecipeDefinition;
|
|
9
9
|
}>;
|
|
10
|
-
export declare class NbtWrapperRecipe extends Recipe
|
|
10
|
+
export declare class NbtWrapperRecipe extends Recipe {
|
|
11
11
|
private readonly recipe;
|
|
12
|
-
constructor(
|
|
13
|
-
getIngredients():
|
|
14
|
-
getResults():
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
constructor(recipe: RecipeHolder);
|
|
13
|
+
getIngredients(): Ingredient[];
|
|
14
|
+
getResults(): Result[];
|
|
15
|
+
replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): Recipe;
|
|
16
|
+
serialize(context: RecipeParseContext): Partial<NbtWrapperRecipeDefinition>;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
19
|
-
|
|
18
|
+
export declare class NbtWrapperRecipeParser extends RecipeParser<NbtWrapperRecipeDefinition, NbtWrapperRecipe> {
|
|
19
|
+
deserialize(definition: NbtWrapperRecipeDefinition, context: RecipeParseContext): NbtWrapperRecipe;
|
|
20
20
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import RecipeParser, { Recipe } from "../index.js";
|
|
2
2
|
export class NbtWrapperRecipe extends Recipe {
|
|
3
3
|
recipe;
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
6
|
-
...definition,
|
|
7
|
-
recipe: recipe.toJSON(),
|
|
8
|
-
});
|
|
4
|
+
constructor(recipe) {
|
|
5
|
+
super();
|
|
9
6
|
this.recipe = recipe;
|
|
10
7
|
}
|
|
11
8
|
getIngredients() {
|
|
@@ -14,17 +11,19 @@ export class NbtWrapperRecipe extends Recipe {
|
|
|
14
11
|
getResults() {
|
|
15
12
|
return this.recipe.getResults();
|
|
16
13
|
}
|
|
17
|
-
|
|
18
|
-
return new NbtWrapperRecipe(this.
|
|
14
|
+
replace(ingredientReplacer, resultReplacer) {
|
|
15
|
+
return new NbtWrapperRecipe(this.recipe.replace(ingredientReplacer, resultReplacer));
|
|
19
16
|
}
|
|
20
|
-
|
|
21
|
-
return
|
|
17
|
+
serialize(context) {
|
|
18
|
+
return {
|
|
19
|
+
recipe: context.recipes.serialize(this.recipe),
|
|
20
|
+
};
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
const recipe =
|
|
27
|
-
return new NbtWrapperRecipe(
|
|
23
|
+
export class NbtWrapperRecipeParser extends RecipeParser {
|
|
24
|
+
deserialize(definition, context) {
|
|
25
|
+
const recipe = context.recipes.deserialize(definition.recipe);
|
|
26
|
+
return new NbtWrapperRecipe(recipe);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
//# sourceMappingURL=nbtWrapper.js.map
|