@adeficior/data-modifier 1.0.0-rc.11 → 1.0.0-rc.13
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 -7
- package/dist/emit/data/loot.js +14 -13
- package/dist/emit/data/loot.js.map +1 -1
- package/dist/emit/data/recipe.d.ts +18 -16
- package/dist/emit/data/recipe.js +28 -22
- 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 +4 -2
- 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 +1 -4
- package/dist/index.js +1 -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 +15 -8
- package/dist/loader/pack.js +43 -25
- package/dist/loader/pack.js.map +1 -1
- package/dist/loader/recipe.d.ts +8 -4
- package/dist/loader/recipe.js +41 -47
- 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/packFormat.d.ts +11 -0
- package/dist/packFormat.js +59 -0
- package/dist/packFormat.js.map +1 -0
- 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 +6 -12
- package/dist/parser/index.js +6 -6
- 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 +26 -19
- 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 +12 -13
- 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 +10 -11
- 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 +27 -27
- 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 -14
- 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 +10 -10
- package/dist/parser/recipe/forge/conditional.js +13 -17
- package/dist/parser/recipe/forge/conditional.js.map +1 -1
- package/dist/parser/recipe/index.d.ts +21 -12
- package/dist/parser/recipe/index.js +10 -3
- 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 -15
- 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 +29 -30
- 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 +3 -2
- 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
package/dist/parser/roots.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roots.js","sourceRoot":"","sources":["../../src/parser/roots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roots.js","sourceRoot":"","sources":["../../src/parser/roots.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
package/dist/parser/thermal.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export type { ThermalCatalystRecipeDefinition } from "./recipe/thermal/catalyst.js";
|
|
6
|
-
export { ThermalCatalystRecipe, default as ThermalCatalystRecipeParser, } from "./recipe/thermal/catalyst.js";
|
|
7
|
-
export type { ThermalFuelRecipeDefinition } from "./recipe/thermal/fuel.js";
|
|
8
|
-
export { ThermalFuelRecipe, default as ThermalFuelRecipeParser, } from "./recipe/thermal/fuel.js";
|
|
9
|
-
export type { ThermalIngredientInput } from "./recipe/thermal/ingredient.js";
|
|
10
|
-
export { fromThermalIngredient, toThermalIngredient, } from "./recipe/thermal/ingredient.js";
|
|
1
|
+
export * from "./recipe/thermal/catalyst.js";
|
|
2
|
+
export * from "./recipe/thermal/fuel.js";
|
|
3
|
+
export * from "./recipe/thermal/index.js";
|
|
4
|
+
export * from "./recipe/thermal/treeExtraction.js";
|
package/dist/parser/thermal.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export { fromThermalIngredient, toThermalIngredient, } from "./recipe/thermal/ingredient.js";
|
|
1
|
+
export * from "./recipe/thermal/catalyst.js";
|
|
2
|
+
export * from "./recipe/thermal/fuel.js";
|
|
3
|
+
export * from "./recipe/thermal/index.js";
|
|
4
|
+
export * from "./recipe/thermal/treeExtraction.js";
|
|
6
5
|
//# sourceMappingURL=thermal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thermal.js","sourceRoot":"","sources":["../../src/parser/thermal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"thermal.js","sourceRoot":"","sources":["../../src/parser/thermal.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RecipeSerializerId } from "@adeficior/data-modifier/generated";
|
|
1
2
|
export type ForgeCondition = Readonly<{
|
|
2
3
|
type: string;
|
|
3
4
|
[key: string]: unknown;
|
|
@@ -7,7 +8,7 @@ export type FabricCondition = Readonly<{
|
|
|
7
8
|
[key: string]: unknown;
|
|
8
9
|
}>;
|
|
9
10
|
export type RecipeDefinition = Readonly<{
|
|
10
|
-
type:
|
|
11
|
+
type: RecipeSerializerId;
|
|
11
12
|
conditions?: ForgeCondition[];
|
|
12
13
|
"fabric:load_conditions"?: FabricCondition[];
|
|
13
14
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adeficior/data-modifier",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.13",
|
|
4
4
|
"description": "Data Modifier",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -53,9 +53,10 @@
|
|
|
53
53
|
"packageManager": "bun@1.3.14",
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsc --project tsconfig.build.json",
|
|
56
|
-
"
|
|
56
|
+
"check": "tsc --noEmit",
|
|
57
57
|
"cli": "bun run build && node dist/cli/index.js",
|
|
58
58
|
"test": "bun test",
|
|
59
|
+
"lint": "eslint {src,test}",
|
|
59
60
|
"format": "prettier --write {src,test}",
|
|
60
61
|
"test:ci": "bun run lint && bun run test --coverage"
|
|
61
62
|
},
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ItemId } from "@adeficior/data-modifier/generated";
|
|
2
|
-
import type { Logger } from "@adeficior/pack-resolver";
|
|
3
|
-
import zod from "zod";
|
|
4
|
-
import type RegistryLookup from "../loader/registry/index.js";
|
|
5
|
-
import type { TagRegistryHolder } from "../loader/tags.js";
|
|
6
|
-
import type { Block, FluidStack, ItemStack } from "./result.js";
|
|
7
|
-
export declare const ItemTagSchema: zod.ZodObject<{
|
|
8
|
-
tag: zod.ZodString;
|
|
9
|
-
count: zod.ZodOptional<zod.ZodNumber>;
|
|
10
|
-
}, "strip", zod.ZodTypeAny, {
|
|
11
|
-
tag: string;
|
|
12
|
-
count?: number | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
tag: string;
|
|
15
|
-
count?: number | undefined;
|
|
16
|
-
}>;
|
|
17
|
-
export type ItemTag = zod.infer<typeof ItemTagSchema>;
|
|
18
|
-
export declare const FluidTagSchema: zod.ZodObject<{
|
|
19
|
-
fluidTag: zod.ZodString;
|
|
20
|
-
amount: zod.ZodOptional<zod.ZodNumber>;
|
|
21
|
-
}, "strip", zod.ZodTypeAny, {
|
|
22
|
-
fluidTag: string;
|
|
23
|
-
amount?: number | undefined;
|
|
24
|
-
}, {
|
|
25
|
-
fluidTag: string;
|
|
26
|
-
amount?: number | undefined;
|
|
27
|
-
}>;
|
|
28
|
-
export type FluidTag = zod.infer<typeof FluidTagSchema>;
|
|
29
|
-
export declare const BlockTagSchema: zod.ZodObject<{
|
|
30
|
-
blockTag: zod.ZodString;
|
|
31
|
-
weight: zod.ZodOptional<zod.ZodNumber>;
|
|
32
|
-
}, "strip", zod.ZodTypeAny, {
|
|
33
|
-
blockTag: string;
|
|
34
|
-
weight?: number | undefined;
|
|
35
|
-
}, {
|
|
36
|
-
blockTag: string;
|
|
37
|
-
weight?: number | undefined;
|
|
38
|
-
}>;
|
|
39
|
-
export type BlockTag = zod.infer<typeof BlockTagSchema>;
|
|
40
|
-
export type ItemIngredient = ItemStack | ItemTag;
|
|
41
|
-
export type FluidIngredient = FluidStack | FluidTag;
|
|
42
|
-
export type BlockIngredient = Block | BlockTag;
|
|
43
|
-
export type Ingredient = ItemIngredient | FluidIngredient | BlockIngredient | Ingredient[];
|
|
44
|
-
export type IngredientInput = Ingredient | ItemId | `#${string}` | IngredientInput[];
|
|
45
|
-
export declare function createIngredient(input: unknown, lookup?: RegistryLookup): Ingredient;
|
|
46
|
-
export type Predicate<T> = (value: T, logger?: Logger) => boolean;
|
|
47
|
-
export type CommonTest<T> = RegExp | Predicate<T> | T;
|
|
48
|
-
export type IngredientTest = CommonTest<Ingredient> | ItemId | `#${string}`;
|
|
49
|
-
export declare function resolveIngredientTest(test: IngredientTest, tags: TagRegistryHolder, lookup: RegistryLookup | undefined): Predicate<IngredientInput>;
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { exists } from "@adeficior/pack-resolver";
|
|
2
|
-
import zod from "zod";
|
|
3
|
-
import { IllegalShapeError, tryCatching } from "../error.js";
|
|
4
|
-
import { createId, encodeId, IdSchema } from "./id.js";
|
|
5
|
-
import { resolveCommonTest } from "./predicates.js";
|
|
6
|
-
import { createResult } from "./result.js";
|
|
7
|
-
export const ItemTagSchema = zod.object({
|
|
8
|
-
tag: IdSchema,
|
|
9
|
-
count: zod.number().optional(),
|
|
10
|
-
});
|
|
11
|
-
export const FluidTagSchema = zod.object({
|
|
12
|
-
fluidTag: IdSchema,
|
|
13
|
-
amount: zod.number().optional(),
|
|
14
|
-
});
|
|
15
|
-
export const BlockTagSchema = zod.object({
|
|
16
|
-
blockTag: IdSchema,
|
|
17
|
-
weight: zod.number().optional(),
|
|
18
|
-
});
|
|
19
|
-
function createUnvalidatedIngredient(input, lookup) {
|
|
20
|
-
if (!input)
|
|
21
|
-
throw new IllegalShapeError("ingredient input may not be null");
|
|
22
|
-
if (typeof input === "string") {
|
|
23
|
-
if (input.startsWith("#"))
|
|
24
|
-
return { tag: input.substring(1) };
|
|
25
|
-
else
|
|
26
|
-
return { item: input };
|
|
27
|
-
}
|
|
28
|
-
if (Array.isArray(input)) {
|
|
29
|
-
return input.map((it) => createIngredient(it, lookup));
|
|
30
|
-
}
|
|
31
|
-
if (typeof input === "object") {
|
|
32
|
-
if ("tag" in input)
|
|
33
|
-
return ItemTagSchema.parse(input);
|
|
34
|
-
if ("fluidTag" in input)
|
|
35
|
-
return FluidTagSchema.parse(input);
|
|
36
|
-
if ("blockTag" in input)
|
|
37
|
-
return BlockTagSchema.parse(input);
|
|
38
|
-
return createResult(input, lookup);
|
|
39
|
-
}
|
|
40
|
-
throw new IllegalShapeError("unknown ingredient shape", input);
|
|
41
|
-
}
|
|
42
|
-
export function createIngredient(input, lookup) {
|
|
43
|
-
const unvalidated = createUnvalidatedIngredient(input, lookup);
|
|
44
|
-
lookup?.validate(unvalidated);
|
|
45
|
-
return unvalidated;
|
|
46
|
-
}
|
|
47
|
-
function resolveIdIngredientTest(test, tags, idSupplier) {
|
|
48
|
-
function resolveIds(it) {
|
|
49
|
-
if (Array.isArray(it)) {
|
|
50
|
-
return it.flatMap(resolveIds);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return [idSupplier(createIngredient(it))].filter(exists);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return resolveCommonTest(test, (input, logger) => tryCatching(logger, () => {
|
|
57
|
-
return resolveIds(input).map(encodeId);
|
|
58
|
-
}) ?? [], tags);
|
|
59
|
-
}
|
|
60
|
-
function extractItemID(ingredient) {
|
|
61
|
-
if ("tag" in ingredient)
|
|
62
|
-
return { ...createId(ingredient.tag), isTag: true };
|
|
63
|
-
if ("item" in ingredient)
|
|
64
|
-
return createId(ingredient.item);
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
function extractFluidID(ingredient) {
|
|
68
|
-
if ("fluidTag" in ingredient)
|
|
69
|
-
return { ...createId(ingredient.fluidTag), isTag: true };
|
|
70
|
-
if ("fluid" in ingredient)
|
|
71
|
-
return createId(ingredient.fluid);
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
function extractBlockID(ingredient) {
|
|
75
|
-
if ("blockTag" in ingredient)
|
|
76
|
-
return { ...createId(ingredient.blockTag), isTag: true };
|
|
77
|
-
if ("block" in ingredient)
|
|
78
|
-
return createId(ingredient.block);
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
export function resolveIngredientTest(test, tags, lookup) {
|
|
82
|
-
if (typeof test === "string") {
|
|
83
|
-
if (!test.startsWith("#"))
|
|
84
|
-
return resolveIngredientTest({ item: test }, tags, lookup);
|
|
85
|
-
return resolveIngredientTest({ tag: test.substring(1) }, tags, lookup);
|
|
86
|
-
}
|
|
87
|
-
if (test instanceof RegExp) {
|
|
88
|
-
return resolveIdIngredientTest(test, tags.registry("item"), extractItemID);
|
|
89
|
-
}
|
|
90
|
-
if (typeof test === "function") {
|
|
91
|
-
return (it, logger) => test(createIngredient(it), logger);
|
|
92
|
-
}
|
|
93
|
-
lookup?.validate(test);
|
|
94
|
-
if ("item" in test)
|
|
95
|
-
return resolveIdIngredientTest(encodeId(test.item), tags.registry("item"), extractItemID);
|
|
96
|
-
if ("tag" in test)
|
|
97
|
-
return resolveIdIngredientTest(`#${encodeId(test.tag)}`, tags.registry("item"), extractItemID);
|
|
98
|
-
if ("fluid" in test)
|
|
99
|
-
return resolveIdIngredientTest(encodeId(test.fluid), tags.registry("fluid"), extractFluidID);
|
|
100
|
-
if ("fluidTag" in test)
|
|
101
|
-
return resolveIdIngredientTest(`#${encodeId(test.fluidTag)}`, tags.registry("fluid"), extractFluidID);
|
|
102
|
-
if ("block" in test)
|
|
103
|
-
return resolveIdIngredientTest(encodeId(test.block), tags.registry("block"), extractBlockID);
|
|
104
|
-
if ("blockTag" in test)
|
|
105
|
-
return resolveIdIngredientTest(`#${encodeId(test.blockTag)}`, tags.registry("block"), extractBlockID);
|
|
106
|
-
return () => false;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=ingredient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ingredient.js","sourceRoot":"","sources":["../../src/common/ingredient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC;IACtC,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAmBH,SAAS,2BAA2B,CAClC,KAAc,EACd,MAAuB;IAEvB,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,iBAAiB,CAAC,kC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O,IAAI,IAAI;QACjB,OAAO,uBAAuB,CAC5B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EACpB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EACtB,cAAc,CACf,CAAC;IACJ,IAAI,UAAU,IAAI,IAAI;QACpB,OAAO,uBAAuB,CAC5B,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAC7B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EACtB,cAAc,CACf,CAAC;IAEJ,IAAI,OAAO,IAAI,IAAI;QACjB,OAAO,uBAAuB,CAC5B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EACpB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EACtB,cAAc,CACf,CAAC;IACJ,IAAI,UAAU,IAAI,IAAI;QACpB,OAAO,uBAAuB,CAC5B,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAC7B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EACtB,cAAc,CACf,CAAC;IAEJ,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;AACrB,CAAC"}
|
package/dist/common/result.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { BlockId, FluidId, ItemId } from "@adeficior/data-modifier/generated";
|
|
2
|
-
import zod from "zod";
|
|
3
|
-
import type RegistryLookup from "../loader/registry/index.js";
|
|
4
|
-
export declare const ItemStackSchema: zod.ZodObject<{
|
|
5
|
-
item: zod.ZodString;
|
|
6
|
-
count: zod.ZodOptional<zod.ZodNumber>;
|
|
7
|
-
chance: zod.ZodOptional<zod.ZodNumber>;
|
|
8
|
-
}, "strip", zod.ZodTypeAny, {
|
|
9
|
-
item: string;
|
|
10
|
-
count?: number | undefined;
|
|
11
|
-
chance?: number | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
item: string;
|
|
14
|
-
count?: number | undefined;
|
|
15
|
-
chance?: number | undefined;
|
|
16
|
-
}>;
|
|
17
|
-
export type ItemStack = Omit<zod.infer<typeof ItemStackSchema>, "item"> & {
|
|
18
|
-
item: ItemId;
|
|
19
|
-
};
|
|
20
|
-
export declare const FluidStackSchema: zod.ZodObject<{
|
|
21
|
-
fluid: zod.ZodString;
|
|
22
|
-
amount: zod.ZodOptional<zod.ZodNumber>;
|
|
23
|
-
chance: zod.ZodOptional<zod.ZodNumber>;
|
|
24
|
-
}, "strip", zod.ZodTypeAny, {
|
|
25
|
-
fluid: string;
|
|
26
|
-
chance?: number | undefined;
|
|
27
|
-
amount?: number | undefined;
|
|
28
|
-
}, {
|
|
29
|
-
fluid: string;
|
|
30
|
-
chance?: number | undefined;
|
|
31
|
-
amount?: number | undefined;
|
|
32
|
-
}>;
|
|
33
|
-
export type FluidStack = Omit<zod.infer<typeof FluidStackSchema>, "fluid"> & {
|
|
34
|
-
fluid: FluidId;
|
|
35
|
-
};
|
|
36
|
-
export declare const BlockSchema: zod.ZodObject<{
|
|
37
|
-
block: zod.ZodString;
|
|
38
|
-
}, "strip", zod.ZodTypeAny, {
|
|
39
|
-
block: string;
|
|
40
|
-
}, {
|
|
41
|
-
block: string;
|
|
42
|
-
}>;
|
|
43
|
-
export type Block = Omit<zod.infer<typeof BlockSchema>, "block"> & {
|
|
44
|
-
block: BlockId;
|
|
45
|
-
};
|
|
46
|
-
export type Result = ItemStack | FluidStack | Block;
|
|
47
|
-
export type ResultInput = Result | ItemId;
|
|
48
|
-
export declare function createResult(input: unknown, lookup?: RegistryLookup): Result;
|
package/dist/common/result.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import zod from "zod";
|
|
2
|
-
import { IllegalShapeError } from "../error.js";
|
|
3
|
-
import { IdSchema } from "./id.js";
|
|
4
|
-
export const ItemStackSchema = zod.object({
|
|
5
|
-
item: IdSchema,
|
|
6
|
-
count: zod.number().int().optional(),
|
|
7
|
-
chance: zod.number().optional(),
|
|
8
|
-
});
|
|
9
|
-
export const FluidStackSchema = zod.object({
|
|
10
|
-
fluid: IdSchema,
|
|
11
|
-
amount: zod.number().optional(),
|
|
12
|
-
chance: zod.number().optional(),
|
|
13
|
-
});
|
|
14
|
-
export const BlockSchema = zod.object({
|
|
15
|
-
block: IdSchema,
|
|
16
|
-
});
|
|
17
|
-
function createUnvalidatedResult(input) {
|
|
18
|
-
if (!input)
|
|
19
|
-
throw new IllegalShapeError("result input may not be null");
|
|
20
|
-
if (typeof input === "string")
|
|
21
|
-
return { item: input };
|
|
22
|
-
if (typeof input === "object") {
|
|
23
|
-
if ("block" in input)
|
|
24
|
-
return BlockSchema.parse(input);
|
|
25
|
-
if ("item" in input)
|
|
26
|
-
return ItemStackSchema.parse(input);
|
|
27
|
-
if ("fluid" in input)
|
|
28
|
-
return FluidStackSchema.parse(input);
|
|
29
|
-
}
|
|
30
|
-
throw new IllegalShapeError(`unknown result shape`, input);
|
|
31
|
-
}
|
|
32
|
-
export function createResult(input, lookup) {
|
|
33
|
-
const unvalidated = createUnvalidatedResult(input);
|
|
34
|
-
lookup?.validate(unvalidated);
|
|
35
|
-
return unvalidated;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=result.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/common/result.ts"],"names":[],"mappings":"AAKA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,gBAAgB,GA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ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Recipe } from "./index.js";
|
|
2
|
-
import type { IngredientInput } from "../../common/ingredient.js";
|
|
3
|
-
import type { ResultInput } from "../../common/result.js";
|
|
4
|
-
import type { RecipeDefinition } from "../../schema/data/recipe.js";
|
|
5
|
-
export default class IgnoredRecipe<T extends RecipeDefinition> extends Recipe<T> {
|
|
6
|
-
getIngredients(): IngredientInput[];
|
|
7
|
-
getResults(): ResultInput[];
|
|
8
|
-
replaceIngredient(): Recipe;
|
|
9
|
-
replaceResult(): Recipe;
|
|
10
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Recipe } from "./index.js";
|
|
2
|
-
export default class IgnoredRecipe extends Recipe {
|
|
3
|
-
getIngredients() {
|
|
4
|
-
return [];
|
|
5
|
-
}
|
|
6
|
-
getResults() {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
replaceIngredient() {
|
|
10
|
-
return new IgnoredRecipe(this.definition);
|
|
11
|
-
}
|
|
12
|
-
replaceResult() {
|
|
13
|
-
return new IgnoredRecipe(this.definition);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=ignored.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ignored.js","sourceRoot":"","sources":["../../../src/parser/recipe/ignored.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKpC,MAAM,CAAC,OAAO,OAAO,aAEnB,SAAQ,MAAS;IACjB,cAAc;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED,aAAa;QACX,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { InlineRecipeParser, Replacer } from "../index.js";
|
|
2
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
3
|
-
import type { Ingredient, IngredientInput } from "../../../common/ingredient.js";
|
|
4
|
-
import type { RecipeDefinition } from "../../../schema/data/recipe.js";
|
|
5
|
-
import type { Result, ResultInput } from "../../../common/result.js";
|
|
6
|
-
export type QuarkExclusionRecipeDefinition<T extends RecipeDefinition = RecipeDefinition> = T & Readonly<{
|
|
7
|
-
true_type: string;
|
|
8
|
-
exclusions?: string[];
|
|
9
|
-
}>;
|
|
10
|
-
export declare class QuarkExclusionRecipe<TDefinition extends RecipeDefinition = RecipeDefinition, TRecipe extends Recipe<TDefinition> = Recipe<TDefinition>> extends Recipe<QuarkExclusionRecipeDefinition<TDefinition>> {
|
|
11
|
-
private readonly trueRecipe;
|
|
12
|
-
constructor(definition: QuarkExclusionRecipeDefinition<TDefinition>, trueRecipe: TRecipe);
|
|
13
|
-
getIngredients(): IngredientInput[];
|
|
14
|
-
getResults(): ResultInput[];
|
|
15
|
-
replaceIngredient(replace: Replacer<Ingredient>): Recipe;
|
|
16
|
-
replaceResult(replace: Replacer<Result>): Recipe;
|
|
17
|
-
}
|
|
18
|
-
export default class QuarkExclusionRecipeParser extends RecipeParser<QuarkExclusionRecipeDefinition, QuarkExclusionRecipe> {
|
|
19
|
-
create(definition: QuarkExclusionRecipeDefinition, parser: InlineRecipeParser): QuarkExclusionRecipe;
|
|
20
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import RecipeParser, { Recipe } from "../index.js";
|
|
2
|
-
export class QuarkExclusionRecipe extends Recipe {
|
|
3
|
-
trueRecipe;
|
|
4
|
-
constructor(definition, trueRecipe) {
|
|
5
|
-
super({
|
|
6
|
-
...definition,
|
|
7
|
-
...trueRecipe.toJSON(),
|
|
8
|
-
true_type: trueRecipe.toJSON().type,
|
|
9
|
-
type: definition.type,
|
|
10
|
-
});
|
|
11
|
-
this.trueRecipe = trueRecipe;
|
|
12
|
-
}
|
|
13
|
-
getIngredients() {
|
|
14
|
-
return this.trueRecipe.getIngredients();
|
|
15
|
-
}
|
|
16
|
-
getResults() {
|
|
17
|
-
return this.trueRecipe.getResults();
|
|
18
|
-
}
|
|
19
|
-
replaceIngredient(replace) {
|
|
20
|
-
return new QuarkExclusionRecipe(this.definition, this.trueRecipe.replaceIngredient(replace));
|
|
21
|
-
}
|
|
22
|
-
replaceResult(replace) {
|
|
23
|
-
return new QuarkExclusionRecipe(this.definition, this.trueRecipe.replaceResult(replace));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export default class QuarkExclusionRecipeParser extends RecipeParser {
|
|
27
|
-
create(definition, parser) {
|
|
28
|
-
const trueRecipe = parser({ ...definition, type: definition.true_type });
|
|
29
|
-
return new QuarkExclusionRecipe(definition, trueRecipe);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=exclusion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exclusion.js","sourceRoot":"","sources":["../../../../src/parser/recipe/quark/exclusion.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAgBnD,MAAM,OAAO,oBAGX,SAAQ,MAAmD;IAGxC;IAFnB,YACE,UAAuD,EACtC,UAAmB;QAEpC,KAAK,CAAC;YACJ,GAAG,UAAU;YACb,GAAG,UAAU,CAAC,MAAM,EAAE;YACtB,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI;YACnC,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC,CAAC;QAPc,eAAU,GAAV,UAAU,CAAS;IAQtC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IAC1C,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,UAAU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