diff --git a/public/mcdoc/create.mcdoc b/public/mcdoc/create.mcdoc index 7af6198e..41488032 100644 --- a/public/mcdoc/create.mcdoc +++ b/public/mcdoc/create.mcdoc @@ -1,9 +1,12 @@ +use ::java::world::component::DataComponentPatch + dispatch minecraft:resource[create:recipes] to struct Recipes { - type: #[id] Type, + type: Type, ...create:recipes[[type]], } enum(string) Type { + Compacting = "create:compacting", Crushing = "create:crushing", Cutting = "create:cutting", Deploying = "create:deploying", @@ -25,6 +28,48 @@ struct NBT { Potion?: string, } +type Item = struct { + #[until="1.20.2"] + item: string, + #[since="1.21.1"] + id: string, + chance?: float @ 0.., + count?: int @ 1.., + #[since="1.21.1"] + components?: DataComponentPatch, +} + +type ItemWithCount = struct { + #[until="1.20.2"] + item: string, + #[since="1.21.1"] + id: string, + count?: int @ 0.., + #[since="1.21.1"] + components?: DataComponentPatch, +} + +type SimpleItem = struct { + #[until="1.20.2"] + item: string, + #[since="1.21.1"] + id: string, + #[since="1.21.1"] + components?: DataComponentPatch, +} + +type Fluid = struct { + #[until="1.20.2"] + fluid: string, + #[until="1.20.2"] + nbt?: NBT, + #[since="1.21.1"] + id: string, + amount: int @ 1.., + #[since="1.21.1"] + components?: DataComponentPatch, +} + type ItemOrTag = ( struct { item: string, @@ -33,168 +78,171 @@ type ItemOrTag = ( } ) +type ItemOrTagWithCount = ( + struct { + item: string, + count?: int @ 1.., + } | struct { + tag: string, + count?: int @ 1.., + } +) + type FluidOrTag = ( struct { fluid: string, + #[since="1.21.1"] + type: "fluid_stack", amount: int @ 1.., + #[until="1.20.2"] nbt?: NBT, + #[since="1.21.1"] + components?: DataComponentPatch, } | struct { + #[until="1.20.2"] fluidTag: string, + #[since="1.21.1"] + fluid_tag: string, + #[since="1.21.1"] + type: "fluid_tag", amount: int @ 1.., + #[until="1.20.2"] nbt?: NBT, + #[since="1.21.1"] + components?: DataComponentPatch, } ) +type MixingResult = struct { + id: string, + /// Used for items; optional field. + count?: int @ 1.., + /// Used for fluids; mandatory field. + amount?: int @ 1.., + components?: DataComponentPatch, +} + +dispatch create:recipes[create:compacting] to struct { + ingredients: [(ItemOrTagWithCount | FluidOrTag)] @ 1.., + #[until="1.20.2"] + results: [(ItemWithCount | Fluid)] @ 1.., + #[since="1.21.1"] + results: [MixingResult] @ 1, +} + dispatch create:recipes[create:crushing] to struct { + #[until="1.20.2"] processingTime: int @ 1.., + #[since="1.21.1"] + processing_time: int @ 1.., ingredients: [ItemOrTag] @ 1, - results: [struct { - chance?: float @ 0.., - count?: int @ 1.., - item: string, - }] @ 1.., + results: [Item] @ 1.., } dispatch create:recipes[create:cutting] to struct { + #[until="1.20.2"] processingTime: int @ 1.., - ingredients: [struct { - item?: string, // Make the user select only one - tag?: string, - count?: int @ 1.., - }] @ 1, - results: [struct { - item: string, - count?: int @ 1.., - }] @ 1, + #[since="1.21.1"] + processing_time: int @ 1.., + ingredients: [ItemOrTag] @ 1, + results: [Item] @ 1, } dispatch create:recipes[create:deploying] to struct { - /// The first object is the base item and the second object is the ingredient + /// The first item is the base item; the second is the ingredient to be deployed. ingredients: [ItemOrTag] @ 2, + /// Defaults to false. + #[until="1.20.2"] keepHeldItem?: boolean, - results: [struct { - item: string, - }] @ 1, + /// Defaults to false. + #[since="1.21.1"] + keep_held_item?: boolean, + results: [SimpleItem] @ 1, } dispatch create:recipes[create:emptying] to struct { ingredients: [ItemOrTag] @ 1, - results: [struct { - item: string, - count?: int @ 1.., - }, struct { - fluid: string, - amount: int @ 1.., - }], + results: [SimpleItem, Fluid], } dispatch create:recipes[create:filling] to struct { ingredients: [ItemOrTag, FluidOrTag], - results: [struct { item: string }] @ 1, + results: [SimpleItem] @ 1, } dispatch create:recipes[create:haunting] to struct { ingredients: [ItemOrTag] @ 1, - results: [struct { - chance?: float @ 0.., - count?: int @ 1.., - item: string, - }] @ 1.., + results: [Item] @ 1.., } dispatch create:recipes[create:item_application] to struct { - /// The first object is the base item and the second object is the ingredient + /// The first item is the base item; the second is the ingredient to be applied. ingredients: [ItemOrTag] @ 2, - results: [struct { - item: string, - }] @ 1, + results: [SimpleItem] @ 1, } dispatch create:recipes[create:mechanical_crafting] to struct { - acceptMirrored?: boolean, - /// Warning: JEI will not display recipes greater in size than 9x9 - pattern: [string], + #[until="1.20.2"] + acceptMirrored: boolean, + #[since="1.21.1"] + accept_mirrored: boolean, + /// Identifier for the category this goes in the recipe book. + #[since="1.21.1"] + category: string, + /// Warning: Recipes larger than 9x9 will not be displayed in JEI. + pattern: [#[crafting_ingredient(definition=true)] string], key: struct { - [string]: ItemOrTag, - }, - result: struct { - count?: int @ 1.., - item: string, + [#[crafting_ingredient] string]: ItemOrTag, }, + result: ItemWithCount, + /// Determines if a notification is shown when unlocking this recipe. Defaults to true. + #[since="1.21.1"] + show_notification?: boolean, } dispatch create:recipes[create:milling] to struct { + #[until="1.20.2"] processingTime: int @ 1.., + #[since="1.21.1"] + processing_time: int @ 1.., ingredients: [ItemOrTag] @ 1, - results: [struct { - chance?: float @ 0.., - count?: int @ 1.., - item: string, - }] @ 1.., + results: [Item] @ 1.., } dispatch create:recipes[create:mixing] to struct { + #[until="1.20.2"] heatRequirement?: ("heated" | "superheated"), - ingredients: [(struct { - count: int @ 1.., - item: string, - } | struct { - count: int @ 1.., - tag: string, - } | struct { - fluid: string, - amount: int @ 1.., - nbt?: NBT, - } | struct { - fluidTag: string, - amount: int @ 1.., - nbt?: NBT, - })] @ 1.., - results: [(struct { - count: int @ 1.., - item: string, - } | struct { - fluid: string, - amount: int @ 1.., - nbt?: NBT, - })] @ 1, + #[since="1.21.1"] + heat_requirement?: ("heated" | "superheated"), + ingredients: [(ItemOrTagWithCount | FluidOrTag)] @ 1.., + #[until="1.20.2"] + results: [(ItemWithCount | Fluid)] @ 1.., + #[since="1.21.1"] + results: [MixingResult] @ 1, } dispatch create:recipes[create:pressing] to struct { - ingredients: [ItemOrTag] @ 1, - results: [struct { - item: string, - count?: int @ 1.., - }] @ 1, + ingredients: [ItemOrTag] @ 1.., + results: [ItemWithCount] @ 1, } dispatch create:recipes[create:sandpaper_polishing] to struct { ingredients: [ItemOrTag] @ 1, - results: [struct { - item: string, - count?: int @ 1.., - }] @ 1, + results: [ItemWithCount] @ 1, } dispatch create:recipes[create:sequenced_assembly] to struct { ingredient: ItemOrTag, loops: int @ 1.., - results: [struct { - chance?: float @ 0.., - count?: int @ 1.., - item: string, - }], + results: [Item] @ 1.., sequence: [Recipes], - transitionalItem: struct { - item: string, - }, + #[until="1.20.2"] + transitionalItem: SimpleItem, + #[since="1.21.1"] + transitional_item: SimpleItem, } dispatch create:recipes[create:splashing] to struct { ingredients: [ItemOrTag] @ 1, - results: [struct { - chance?: float @ 0.., - count?: int @ 1.., - item: string, - }] @ 1.., + results: [Item] @ 1.., }