@adeficior/data-modifier-thermal 2.0.0-rc.20260814115618

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.
@@ -0,0 +1,6 @@
1
+ export { default } from "./module";
2
+ export * from "./serializer";
3
+ export * from "./serializer/catalyst";
4
+ export * from "./serializer/fuel";
5
+ export * from "./serializer/module";
6
+ export * from "./serializer/treeExtraction";
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { default } from "./module";
2
+ export * from "./serializer";
3
+ export * from "./serializer/catalyst";
4
+ export * from "./serializer/fuel";
5
+ export * from "./serializer/module";
6
+ export * from "./serializer/treeExtraction";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@adeficior/data-modifier-core").ModuleConfig<import("@adeficior/data-modifier-core").ModuleTypes>;
2
+ export default _default;
package/dist/module.js ADDED
@@ -0,0 +1,13 @@
1
+ import { defineModule } from "@adeficior/data-modifier-core";
2
+ import { name } from "../package.json";
3
+ import { registerParsers } from "./registration";
4
+ export default defineModule({
5
+ importModule: name,
6
+ dependencies: {
7
+ "@adeficior/data-modifier-recipes": "required",
8
+ },
9
+ setup: (pack) => {
10
+ pack.hook("recipes:register-parser", registerParsers);
11
+ },
12
+ });
13
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAe,YAAY,CAAC;IAC1B,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE;QACZ,kCAAkC,EAAE,UAAU;KAC/C;IACD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;QACd,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type RegisterRecipeParser } from "@adeficior/data-modifier-recipes";
2
+ export declare function registerParsers(event: RegisterRecipeParser): void;
@@ -0,0 +1,31 @@
1
+ import {} from "@adeficior/data-modifier-recipes";
2
+ import { ThermalRecipeParser } from "./serializer";
3
+ import { ThermalCatalystRecipeParser } from "./serializer/catalyst";
4
+ import { ThermalFuelRecipeParser } from "./serializer/fuel";
5
+ import { TreeExtractionRecipeParser } from "./serializer/treeExtraction";
6
+ export function registerParsers(event) {
7
+ event.register("thermal:bottler", new ThermalRecipeParser());
8
+ event.register("thermal:centrifuge", new ThermalRecipeParser());
9
+ event.register("thermal:chiller", new ThermalRecipeParser());
10
+ event.register("thermal:crucible", new ThermalRecipeParser());
11
+ event.register("thermal:crystallizer", new ThermalRecipeParser());
12
+ event.register("thermal:furnace", new ThermalRecipeParser());
13
+ event.register("thermal:insolator", new ThermalRecipeParser());
14
+ event.register("thermal:insolator_catalyst", new ThermalCatalystRecipeParser());
15
+ event.register("thermal:press", new ThermalRecipeParser());
16
+ event.register("thermal:pulverizer", new ThermalRecipeParser());
17
+ event.register("thermal:pulverizer_recycle", new ThermalRecipeParser());
18
+ event.register("thermal:pulverizer_catalyst", new ThermalCatalystRecipeParser());
19
+ event.register("thermal:pyrolyzer", new ThermalRecipeParser());
20
+ event.register("thermal:refinery", new ThermalRecipeParser());
21
+ event.register("thermal:sawmill", new ThermalRecipeParser());
22
+ event.register("thermal:smelter", new ThermalRecipeParser());
23
+ event.register("thermal:smelter_recycle", new ThermalRecipeParser());
24
+ event.register("thermal:smelter_catalyst", new ThermalCatalystRecipeParser());
25
+ event.register("thermal:tree_extractor", new TreeExtractionRecipeParser());
26
+ event.register("thermal:compression_fuel", new ThermalFuelRecipeParser());
27
+ event.register("thermal:magmatic_fuel", new ThermalFuelRecipeParser());
28
+ event.register("thermal:gourmand_fuel", new ThermalFuelRecipeParser());
29
+ event.register("thermal:numismatic_fuel", new ThermalFuelRecipeParser());
30
+ }
31
+ //# sourceMappingURL=registration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registration.js","sourceRoot":"","sources":["../src/registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEzE,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,KAAK,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAC7D,KAAK,CAAC,QAAQ,CAAC,oBAAoB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAChE,KAAK,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAC7D,KAAK,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAC9D,KAAK,CAAC,QAAQ,CAAC,sBAAsB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAClE,KAAK,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAC7D,KAAK,CAAC,QAAQ,CAAC,mBAAmB,E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AAC,QAAQ,CAAC,yBAAyB,EAAE,IAAI,uBAAuB,EAAE,CAAC,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { type Ingredient } from "@adeficior/data-modifier-ingredients";
2
+ import { Recipe, RecipeParser, type RecipeDefinition, type RecipeModifier, type RecipeParseContext } from "@adeficior/data-modifier-recipes";
3
+ export type ThermalCatalystRecipeDefinition = RecipeDefinition & Readonly<{
4
+ ingredient: unknown;
5
+ primary_mod?: number;
6
+ secondary_mod?: number;
7
+ energy_mod?: number;
8
+ min_chance?: number;
9
+ use_chance?: number;
10
+ }>;
11
+ export declare class ThermalCatalystRecipe extends Recipe {
12
+ private readonly ingredient;
13
+ constructor(ingredient: Ingredient);
14
+ getIngredients(): Ingredient[];
15
+ getResults(): never[];
16
+ modify(modifier: RecipeModifier): ThermalCatalystRecipe;
17
+ serialize(context: RecipeParseContext): Partial<ThermalCatalystRecipeDefinition>;
18
+ }
19
+ export declare class ThermalCatalystRecipeParser extends RecipeParser<ThermalCatalystRecipeDefinition, ThermalCatalystRecipe> {
20
+ deserialize(definition: ThermalCatalystRecipeDefinition, context: RecipeParseContext): ThermalCatalystRecipe;
21
+ }
@@ -0,0 +1,30 @@
1
+ import {} from "@adeficior/data-modifier-ingredients";
2
+ import { Recipe, RecipeParser, } from "@adeficior/data-modifier-recipes";
3
+ export class ThermalCatalystRecipe extends Recipe {
4
+ ingredient;
5
+ constructor(ingredient) {
6
+ super();
7
+ this.ingredient = ingredient;
8
+ }
9
+ getIngredients() {
10
+ return [this.ingredient];
11
+ }
12
+ getResults() {
13
+ return [];
14
+ }
15
+ modify(modifier) {
16
+ return new ThermalCatalystRecipe(modifier.ingredient(this.ingredient));
17
+ }
18
+ serialize(context) {
19
+ return {
20
+ ingredient: context.ingredients.serialize(this.ingredient),
21
+ };
22
+ }
23
+ }
24
+ export class ThermalCatalystRecipeParser extends RecipeParser {
25
+ deserialize(definition, context) {
26
+ const ingredient = context.ingredients.deserialize(definition.ingredient);
27
+ return new ThermalCatalystRecipe(ingredient);
28
+ }
29
+ }
30
+ //# sourceMappingURL=catalyst.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../src/serializer/catalyst.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,MAAM,EACN,YAAY,GAIb,MAAM,kCAAkC,CAAC;AAY1C,MAAM,OAAO,qBAAsB,SAAQ,MAAM;IAClB;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACzE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,YAGhD;IACC,WAAW,CACT,UAA2C,EAC3C,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC1E,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ import { type Ingredient } from "@adeficior/data-modifier-ingredients";
2
+ import { Recipe, RecipeParser, type RecipeDefinition, type RecipeModifier, type RecipeParseContext } from "@adeficior/data-modifier-recipes";
3
+ export type ThermalFuelRecipeDefinition = RecipeDefinition & Readonly<{
4
+ energy: number;
5
+ ingredient: unknown;
6
+ }>;
7
+ export declare class ThermalFuelRecipe extends Recipe {
8
+ private readonly ingredient;
9
+ constructor(ingredient: Ingredient);
10
+ getIngredients(): Ingredient[];
11
+ getResults(): never[];
12
+ modify(modifier: RecipeModifier): ThermalFuelRecipe;
13
+ serialize(context: RecipeParseContext): Partial<ThermalFuelRecipeDefinition>;
14
+ }
15
+ export declare class ThermalFuelRecipeParser extends RecipeParser<ThermalFuelRecipeDefinition, ThermalFuelRecipe> {
16
+ deserialize(definition: ThermalFuelRecipeDefinition, context: RecipeParseContext): ThermalFuelRecipe;
17
+ }
@@ -0,0 +1,31 @@
1
+ import {} from "@adeficior/data-modifier-ingredients";
2
+ import { Recipe, RecipeParser, } from "@adeficior/data-modifier-recipes";
3
+ // TODO could be same as catalyst
4
+ export class ThermalFuelRecipe extends Recipe {
5
+ ingredient;
6
+ constructor(ingredient) {
7
+ super();
8
+ this.ingredient = ingredient;
9
+ }
10
+ getIngredients() {
11
+ return [this.ingredient];
12
+ }
13
+ getResults() {
14
+ return [];
15
+ }
16
+ modify(modifier) {
17
+ return new ThermalFuelRecipe(modifier.ingredient(this.ingredient));
18
+ }
19
+ serialize(context) {
20
+ return {
21
+ ingredient: context.ingredients.serialize(this.ingredient),
22
+ };
23
+ }
24
+ }
25
+ export class ThermalFuelRecipeParser extends RecipeParser {
26
+ deserialize(definition, context) {
27
+ const ingredient = context.ingredients.deserialize(definition.ingredient);
28
+ return new ThermalFuelRecipe(ingredient);
29
+ }
30
+ }
31
+ //# sourceMappingURL=fuel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../src/serializer/fuel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,MAAM,EACN,YAAY,GAIb,MAAM,kCAAkC,CAAC;AAQ1C,iCAAiC;AACjC,MAAM,OAAO,iBAAkB,SAAQ,MAAM;IACd;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,MAAM,CAAC,QAAwB;QACtC,OAAO,IAAI,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,YAG5C;IACC,WAAW,CACT,UAAuC,EACvC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC1E,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ import { type Ingredient, type Result } from "@adeficior/data-modifier-ingredients";
2
+ import { Recipe, RecipeParser, type RecipeDefinition, type RecipeModifier, type RecipeParseContext } from "@adeficior/data-modifier-recipes";
3
+ export type ThermalRecipeDefinition = RecipeDefinition & Readonly<{
4
+ ingredient?: unknown;
5
+ ingredients?: unknown[];
6
+ result: unknown;
7
+ energy?: number;
8
+ experience?: number;
9
+ }>;
10
+ export declare class ThermalRecipe extends Recipe {
11
+ private readonly ingredients;
12
+ private readonly results;
13
+ constructor(ingredients: Ingredient[], results: Result[]);
14
+ getIngredients(): Ingredient[];
15
+ getResults(): Result[];
16
+ modify(modifier: RecipeModifier): ThermalRecipe;
17
+ serialize(context: RecipeParseContext): Partial<ThermalRecipeDefinition>;
18
+ }
19
+ export declare class ThermalRecipeParser extends RecipeParser<ThermalRecipeDefinition, ThermalRecipe> {
20
+ ingredientModules(): {
21
+ 15: import("@adeficior/data-modifier-core/serializer").SerializerModule<Ingredient, unknown>;
22
+ };
23
+ deserialize(definition: ThermalRecipeDefinition, context: RecipeParseContext): ThermalRecipe;
24
+ }
@@ -0,0 +1,52 @@
1
+ import { IllegalShapeError } from "@adeficior/data-modifier-core";
2
+ import {} from "@adeficior/data-modifier-ingredients";
3
+ import { Recipe, RecipeParser, } from "@adeficior/data-modifier-recipes";
4
+ import { ingredientSerializerModules } from "./module";
5
+ export class ThermalRecipe extends Recipe {
6
+ ingredients;
7
+ results;
8
+ constructor(ingredients, results) {
9
+ super();
10
+ this.ingredients = ingredients;
11
+ this.results = results;
12
+ }
13
+ getIngredients() {
14
+ return this.ingredients;
15
+ }
16
+ getResults() {
17
+ return this.results;
18
+ }
19
+ modify(modifier) {
20
+ return new ThermalRecipe(this.ingredients.map(modifier.ingredient), this.results.map(modifier.result));
21
+ }
22
+ serialize(context) {
23
+ const serialized = {
24
+ result: context.results.serializeList(this.results),
25
+ };
26
+ if (this.ingredients.length === 1) {
27
+ serialized.ingredient = context.ingredients.serialize(this.ingredients[0]);
28
+ }
29
+ else {
30
+ serialized.ingredients = context.ingredients.serializeList(this.ingredients);
31
+ }
32
+ return serialized;
33
+ }
34
+ }
35
+ export class ThermalRecipeParser extends RecipeParser {
36
+ ingredientModules() {
37
+ return ingredientSerializerModules;
38
+ }
39
+ deserialize(definition, context) {
40
+ const rawIngredients = definition.ingredient
41
+ ? [definition.ingredient]
42
+ : (definition.ingredients ?? []);
43
+ if (rawIngredients.length === 0)
44
+ throw new IllegalShapeError("ingredients missing or empty", definition);
45
+ const ingredients = context.ingredients.deserializeList(rawIngredients);
46
+ const results = Array.isArray(definition.result)
47
+ ? context.results.deserializeList(definition.result)
48
+ : [context.results.deserialize(definition.result)];
49
+ return new ThermalRecipe(ingredients, results);
50
+ }
51
+ }
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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AAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,YAGxC;IACU,iBAAiB;QACxB,OAAO,2BAA2B,CAAC;IACrC,CAAC;IAED,WAAW,CACT,UAAmC,EACnC,OAA2B;QAE3B,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU;YAC1C,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;YACzB,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAEnC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAC7B,MAAM,IAAI,iBAAiB,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;QAE1E,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;QAExE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YAC9C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC;YACpD,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAErD,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import { type Ingredient } from "@adeficior/data-modifier-ingredients";
2
+ export declare const ingredientSerializerModules: {
3
+ 15: import("@adeficior/data-modifier-core/serializer").SerializerModule<Ingredient, unknown>;
4
+ };
@@ -0,0 +1,34 @@
1
+ import { IdSchema } from "@adeficior/data-modifier-core";
2
+ import { createSerializerModule, isObjectWith, } from "@adeficior/data-modifier-core/serializer";
3
+ import { AmountSchema, CountSchema, FluidTagIngredient, ItemIngredient, ItemTagIngredient, ListIngredient, } from "@adeficior/data-modifier-ingredients";
4
+ import * as z from "zod";
5
+ const ThermalFluidTagSchema = z.object({
6
+ fluid_tag: IdSchema,
7
+ amount: AmountSchema,
8
+ });
9
+ const ThermalItemEntry = z.object({
10
+ item: IdSchema,
11
+ });
12
+ const ThermalTagEntry = z.object({
13
+ tag: IdSchema,
14
+ });
15
+ const ThermalIngredientEntry = ThermalItemEntry.or(ThermalTagEntry);
16
+ const ThermalIngredientList = z.object({
17
+ value: z.array(ThermalIngredientEntry),
18
+ count: CountSchema,
19
+ });
20
+ const ingredientSerializer15 = createSerializerModule((builder) => {
21
+ builder.deserializer(isObjectWith("value"), (input) => {
22
+ const { value, count } = ThermalIngredientList.parse(input);
23
+ return new ListIngredient(value.map((it) => {
24
+ if ("item" in it)
25
+ return new ItemIngredient(it.item, count);
26
+ return new ItemTagIngredient(it.tag, count);
27
+ }));
28
+ });
29
+ builder.register(FluidTagIngredient, isObjectWith("fluid_tag"), ThermalFluidTagSchema, ({ fluid_tag, amount }) => new FluidTagIngredient(fluid_tag, amount), ({ tag, amount }) => ({ fluid_tag: tag, amount }));
30
+ });
31
+ export const ingredientSerializerModules = {
32
+ 15: ingredientSerializer15,
33
+ };
34
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/serializer/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,YAAY,GACb,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,GAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,YAAY;CACrB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IA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CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,EAAE,EAAE,sBAAsB;CAC3B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type Ingredient, type Result } from "@adeficior/data-modifier-ingredients";
2
+ import { Recipe, type RecipeDefinition, type RecipeModifier, type RecipeParseContext, RecipeParser } from "@adeficior/data-modifier-recipes";
3
+ import { type BlockId } from "@adeficior/data-modifier/generated";
4
+ type BlockStateIngredient = {
5
+ Name: BlockId;
6
+ Properties?: Record<string, unknown>;
7
+ };
8
+ export type TreeExtractionRecipeDefinition = RecipeDefinition & Readonly<{
9
+ leaves: BlockStateIngredient;
10
+ trunk: BlockStateIngredient;
11
+ sapling: BlockId;
12
+ result: unknown;
13
+ }>;
14
+ export declare class TreeExtractionRecipe extends Recipe {
15
+ private readonly trunk;
16
+ private readonly leaves;
17
+ private readonly sapling;
18
+ private readonly result;
19
+ constructor(trunk: Ingredient, leaves: Ingredient, sapling: Ingredient, result: Result);
20
+ getIngredients(): Ingredient[];
21
+ getResults(): Result[];
22
+ modify(modifier: RecipeModifier): TreeExtractionRecipe;
23
+ private serializeBlockIngredient;
24
+ private serializeBlockStateIngredient;
25
+ serialize(context: RecipeParseContext): Partial<TreeExtractionRecipeDefinition>;
26
+ }
27
+ export declare class TreeExtractionRecipeParser extends RecipeParser<TreeExtractionRecipeDefinition, TreeExtractionRecipe> {
28
+ deserialize(definition: TreeExtractionRecipeDefinition, context: RecipeParseContext): TreeExtractionRecipe;
29
+ }
30
+ export {};
@@ -0,0 +1,59 @@
1
+ import { encodeId, IllegalShapeError } from "@adeficior/data-modifier-core";
2
+ import { BlockIngredient, } from "@adeficior/data-modifier-ingredients";
3
+ import { Recipe, RecipeParser, } from "@adeficior/data-modifier-recipes";
4
+ import {} from "@adeficior/data-modifier/generated";
5
+ export class TreeExtractionRecipe extends Recipe {
6
+ trunk;
7
+ leaves;
8
+ sapling;
9
+ result;
10
+ constructor(trunk, leaves, sapling, result) {
11
+ super();
12
+ this.trunk = trunk;
13
+ this.leaves = leaves;
14
+ this.sapling = sapling;
15
+ this.result = result;
16
+ }
17
+ getIngredients() {
18
+ return [this.trunk, this.leaves];
19
+ }
20
+ getResults() {
21
+ return [this.result];
22
+ }
23
+ modify(modifier) {
24
+ return new TreeExtractionRecipe(modifier.ingredient(this.trunk), modifier.ingredient(this.leaves), modifier.ingredient(this.sapling), modifier.result(this.result));
25
+ }
26
+ serializeBlockIngredient(ingredient) {
27
+ if (ingredient instanceof BlockIngredient) {
28
+ return encodeId(ingredient.id);
29
+ }
30
+ throw new IllegalShapeError("tree extraction recipes ingredients need to be blocks", ingredient);
31
+ }
32
+ serializeBlockStateIngredient(ingredient) {
33
+ if (ingredient instanceof BlockIngredient) {
34
+ return {
35
+ // TODO "Properties"
36
+ Name: encodeId(ingredient.id),
37
+ };
38
+ }
39
+ throw new IllegalShapeError("tree extraction recipes ingredients need to be blocks", ingredient);
40
+ }
41
+ serialize(context) {
42
+ return {
43
+ result: context.results.serialize(this.result),
44
+ trunk: this.serializeBlockStateIngredient(this.trunk),
45
+ leaves: this.serializeBlockStateIngredient(this.leaves),
46
+ sapling: this.serializeBlockIngredient(this.sapling),
47
+ };
48
+ }
49
+ }
50
+ export class TreeExtractionRecipeParser extends RecipeParser {
51
+ deserialize(definition, context) {
52
+ const trunk = context.ingredients.deserialize(new BlockIngredient(definition.trunk.Name));
53
+ const leaves = context.ingredients.deserialize(new BlockIngredient(definition.leaves.Name));
54
+ const sapling = context.ingredients.deserialize(new BlockIngredient(definition.sapling));
55
+ const result = context.results.deserialize(definition.result);
56
+ return new TreeExtractionRecipe(trunk, leaves, sapling, result);
57
+ }
58
+ }
59
+ //# sourceMappingURL=treeExtraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"treeExtraction.js","sourceRoot":"","sources":["../../src/serializer/treeExtraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC5E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ports": {
5
+ ".": "./dist/index.js"
6
+ },
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "type": "module",
12
+ "scripts": {
13
+ "build": "tsc --project tsconfig.build.json",
14
+ "check": "tsc --noEmit",
15
+ "dev": "bun run build --watch",
16
+ "lint": "eslint {src,test}",
17
+ "test": "bun test --timeout 10000",
18
+ "prune": "bun run datamod-dev --prune",
19
+ "prepare": "datamod-dev --configs && datamod-dev --types",
20
+ "test:ci": "bun run lint && bun run check && bun run test --coverage"
21
+ },
22
+ "devDependencies": {
23
+ "@adeficior/configs": "workspace:*",
24
+ "@adeficior/testing": "workspace:*",
25
+ "@adeficior/data-modifier-recipes": "workspace:*"
26
+ },
27
+ "peerDependencies": {
28
+ "@adeficior/pack-resolver": "catalog:",
29
+ "typescript": "catalog:",
30
+ "zod": "catalog:",
31
+ "@adeficior/data-modifier-core": "workspace:*",
32
+ "@adeficior/data-modifier-recipes": "workspace:*",
33
+ "@adeficior/data-modifier-ingredients": "workspace:*",
34
+ "@adeficior/data-modifier-tags": "workspace:*"
35
+ }
36
+ }