From 247b5f05ee78d88e09ae503690d45b0adafc88f5 Mon Sep 17 00:00:00 2001 From: yor42 <49832212+yor42@users.noreply.github.com> Date: Sat, 23 Nov 2024 20:46:54 +0900 Subject: [PATCH] Add Grs Docs for Academycraft (#27) * feat: Added documentation for AcademyCraft-UEL * fix some unnecessary changes * fix comments * add recipe builder documentation * update documentation according to changed code * improve sorting of documentation --- docs/groovy-script/mods/academy/imag_fusor.md | 140 ++++++++++++ docs/groovy-script/mods/academy/index.md | 15 ++ .../mods/academy/metal_former.md | 208 ++++++++++++++++++ docs/groovy-script/mods/index.md | 1 + 4 files changed, 364 insertions(+) create mode 100644 docs/groovy-script/mods/academy/imag_fusor.md create mode 100644 docs/groovy-script/mods/academy/index.md create mode 100644 docs/groovy-script/mods/academy/metal_former.md diff --git a/docs/groovy-script/mods/academy/imag_fusor.md b/docs/groovy-script/mods/academy/imag_fusor.md new file mode 100644 index 0000000..8975385 --- /dev/null +++ b/docs/groovy-script/mods/academy/imag_fusor.md @@ -0,0 +1,140 @@ +--- +title: "Imag Fusor" +titleTemplate: "AcademyCraft | CleanroomMC" +description: "Converts one item and defined amount of Imag Phase Liquid into one item." +source_code_link: "https://github.com/yor42/AcademyCraft/blob/master/src/main/java/cn/academy/support/groovyscript/modules/ImagFusor.java" +--- + +# Imag Fusor (AcademyCraft) + +## Description + +Converts one item and defined amount of Imag Phase Liquid into one item. + +## Identifier + +Refer to this via any of the following: + +```groovy:no-line-numbers {1} +mods.academy.imag_fusor/* Used as page default */ // [!code focus] +mods.academy.imagfusor +mods.academy.imagFusor +mods.academy.ImagFusor +``` + + +## Adding Recipes + +- Add the given recipe to the recipe list: + + ```groovy:no-line-numbers + mods.academy.imag_fusor.add(ImagFusorRecipes.IFRecipe) + ``` + +- Adds recipes in the format `output`, `input`, `amount of Imag Phase Liquid`: + + ```groovy:no-line-numbers + mods.academy.imag_fusor.addRecipe(ItemStack, IIngredient, int) + ``` + +:::::::::: details Example {open id="example"} +```groovy:no-line-numbers +mods.academy.imag_fusor.addRecipe(item('academy:crystal_normal'), item('academy:crystal_low'), 3000) +``` + +:::::::::: + +### Recipe Builder + +Just like other recipe types, the Imag Fusor also uses a recipe builder. + +Don't know what a builder is? Check [the builder info page](../../getting_started/builder.md) out. + +:::::::::: details mods.academy.imag_fusor.recipeBuilder() {open id="abstract"} +- `IngredientList`. Sets the item inputs of the recipe. Requires exactly 1. + + ```groovy:no-line-numbers + input(IIngredient) + input(IIngredient...) + input(Collection) + ``` + +- `ItemStackList`. Sets the item outputs of the recipe. Requires exactly 1. + + ```groovy:no-line-numbers + output(ItemStack) + output(ItemStack...) + output(Collection) + ``` + +- `int`. Amount of Imag Phase Liquid consumed for this recipe. Requires greater than 0. (Default `1000`). + + ```groovy:no-line-numbers + fluid(int) + ``` + +- First validates the builder, returning `null` and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returns `null` or `cn.academy.crafting.ImagFusorRecipes$IFRecipe`). + + ```groovy:no-line-numbers + register() + ``` + +::::::::: details Example {open id="example"} +```groovy:no-line-numbers +mods.academy.imag_fusor.recipeBuilder() + .input(item('minecraft:clay')) + .output(item('minecraft:diamond')) + .fluid(1000) + .register() + +mods.academy.imag_fusor.recipeBuilder() + .input(item('minecraft:clay')) + .output(item('minecraft:diamond')) + .fluid(3000) + .register() + +mods.academy.imag_fusor.recipeBuilder() + .input(item('minecraft:gold_ingot')) + .output(item('minecraft:clay') * 2) + .register() +``` + +::::::::: + +:::::::::: + +## Removing Recipes + +- Removes the given recipe from the recipe list: + + ```groovy:no-line-numbers + mods.academy.imag_fusor.remove(ImagFusorRecipes.IFRecipe) + ``` + +- Removes an entry matching the given `ItemStack`: + + ```groovy:no-line-numbers + mods.academy.imag_fusor.removeByInput(ItemStack) + ``` + +- Removes all registered recipes: + + ```groovy:no-line-numbers + mods.academy.imag_fusor.removeAll() + ``` + +:::::::::: details Example {open id="example"} +```groovy:no-line-numbers +mods.academy.imag_fusor.removeByInput(item('academy:crystal_normal')) +mods.academy.imag_fusor.removeAll() +``` + +:::::::::: + +## Getting the value of recipes + +- Iterates through every entry in the registry, with the ability to call remove on any element to remove it: + + ```groovy:no-line-numbers + mods.academy.imag_fusor.streamRecipes() + ``` diff --git a/docs/groovy-script/mods/academy/index.md b/docs/groovy-script/mods/academy/index.md new file mode 100644 index 0000000..866ebb0 --- /dev/null +++ b/docs/groovy-script/mods/academy/index.md @@ -0,0 +1,15 @@ +--- +aside: false +--- + + +# AcademyCraft + +## Categories + +Has 2 subcategories. + +* [Imag Fusor](./imag_fusor.md) + +* [Metal Former](./metal_former.md) + diff --git a/docs/groovy-script/mods/academy/metal_former.md b/docs/groovy-script/mods/academy/metal_former.md new file mode 100644 index 0000000..0e68a43 --- /dev/null +++ b/docs/groovy-script/mods/academy/metal_former.md @@ -0,0 +1,208 @@ +--- +title: "Metal Former" +titleTemplate: "AcademyCraft | CleanroomMC" +description: "Converts an item into another item, according to the mode of the machine." +source_code_link: "https://github.com/yor42/AcademyCraft/blob/master/src/main/java/cn/academy/support/groovyscript/modules/MetalFormer.java" +--- + +# Metal Former (AcademyCraft) + +## Description + +Converts an item into another item, according to the mode of the machine. + +## Identifier + +Refer to this via any of the following: + +```groovy:no-line-numbers {1} +mods.academy.metal_former/* Used as page default */ // [!code focus] +mods.academy.metalformer +mods.academy.metalFormer +mods.academy.MetalFormer +``` + + +## Adding Recipes + +- Adds etching recipes in the format `input`, `output`: + + ```groovy:no-line-numbers + mods.academy.metal_former.addEtchRecipe(IIngredient, ItemStack) + ``` + +- Adds incising recipes in the format `input`, `output`: + + ```groovy:no-line-numbers + mods.academy.metal_former.addInciseRecipe(IIngredient, ItemStack) + ``` + +- Adds plating recipes in the format `input`, `output`: + + ```groovy:no-line-numbers + mods.academy.metal_former.addPlateRecipe(IIngredient, ItemStack) + ``` + +- Adds refining recipes in the format `input`, `output`: + + ```groovy:no-line-numbers + mods.academy.metal_former.addRefineRecipe(IIngredient, ItemStack) + ``` + +:::::::::: details Example {open id="example"} +```groovy:no-line-numbers +mods.academy.metal_former.addEtchRecipe(item('minecraft:stonebrick'), item('minecraft:stonebrick', 3)) +mods.academy.metal_former.addInciseRecipe(item('minecraft:cobblestone'), item('minecraft:stone_slab', 3)) +mods.academy.metal_former.addPlateRecipe(ore('ingotIron'), item('academy:reinforced_iron_plate')) +mods.academy.metal_former.addRefineRecipe(ore('oreDiamond'), item('minecraft:diamond') * 64) +``` + +:::::::::: + +### Recipe Builder + +Just like other recipe types, the Metal Former also uses a recipe builder. + +Don't know what a builder is? Check [the builder info page](../../getting_started/builder.md) out. + +:::::::::: details mods.academy.metal_former.recipeBuilder() {open id="abstract"} +- `IngredientList`. Sets the item inputs of the recipe. Requires exactly 1. + + ```groovy:no-line-numbers + input(IIngredient) + input(IIngredient...) + input(Collection) + ``` + +- `ItemStackList`. Sets the item outputs of the recipe. Requires exactly 1. + + ```groovy:no-line-numbers + output(ItemStack) + output(ItemStack...) + output(Collection) + ``` + +- `TileMetalFormer.Mode`. Working mode of Metal former required for this recipe. Requires not null. (Default `ETCH`). + + ```groovy:no-line-numbers + etch() + plate() + incise() + refine() + mode(TileMetalFormer.Mode) + ``` + +- First validates the builder, returning `null` and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returns `null` or `cn.academy.crafting.MetalFormerRecipes$RecipeObject`). + + ```groovy:no-line-numbers + register() + ``` + +::::::::: details Example {open id="example"} +```groovy:no-line-numbers +mods.academy.metal_former.recipeBuilder() + .input(item('minecraft:clay')) + .output(item('minecraft:diamond')) + .refine() + .register() + +mods.academy.metal_former.recipeBuilder() + .input(item('minecraft:clay')) + .output(item('minecraft:diamond')) + .incise() + .register() + +mods.academy.metal_former.recipeBuilder() + .input(item('minecraft:gold_ingot')) + .output(item('minecraft:clay') * 2) + .register() +``` + +::::::::: + +:::::::::: + +## Removing Recipes + +- Removes the given recipe from the recipe list: + + ```groovy:no-line-numbers + mods.academy.metal_former.remove(MetalFormerRecipes.RecipeObject) + ``` + +- Removes an entry matching the given `ItemStack` from etching recipes: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeEtchByInput(IIngredient) + ``` + +- Removes an entry matching the given `ItemStack` from incise recipes: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeInciseByInput(IIngredient) + ``` + +- Removes an entry matching the given `ItemStack` from plate recipes: + + ```groovy:no-line-numbers + mods.academy.metal_former.removePlateByInput(IIngredient) + ``` + +- Removes an entry matching the given `ItemStack` from refine recipes: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeRefineByInput(IIngredient) + ``` + +- Removes all registered recipes: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeAll() + ``` + +- Removes all etching entry of metal former: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeAllEtch() + ``` + +- Removes all incising entry of metal former: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeAllIncise() + ``` + +- Removes all plating entry of metal former: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeAllPlate() + ``` + +- Removes all refining entry of metal former: + + ```groovy:no-line-numbers + mods.academy.metal_former.removeAllRefine() + ``` + +:::::::::: details Example {open id="example"} +```groovy:no-line-numbers +mods.academy.metal_former.removeEtchByInput(ore('oreDiamond')) +mods.academy.metal_former.removeInciseByInput(ore('oreDiamond')) +mods.academy.metal_former.removePlateByInput(ore('oreDiamond')) +mods.academy.metal_former.removeRefineByInput(ore('oreDiamond')) +mods.academy.metal_former.removeAll() +mods.academy.metal_former.removeAllEtch() +mods.academy.metal_former.removeAllIncise() +mods.academy.metal_former.removeAllPlate() +mods.academy.metal_former.removeAllRefine() +``` + +:::::::::: + +## Getting the value of recipes + +- Iterates through every entry in the registry, with the ability to call remove on any element to remove it: + + ```groovy:no-line-numbers + mods.academy.metal_former.streamRecipes() + ``` diff --git a/docs/groovy-script/mods/index.md b/docs/groovy-script/mods/index.md index 35c0d9d..8caa2a4 100644 --- a/docs/groovy-script/mods/index.md +++ b/docs/groovy-script/mods/index.md @@ -6,6 +6,7 @@ search: # Mods * [Abyssalcraft 2 (with Abyssal Tweaker)](./abyssaltweaker/) +* [AcademyCraft Unofficial Extended Support](./academy/) * [Actually Additions](./actuallyadditions/) * [Advanced Mortars](./advancedmortars/) * [Advanced Rocketry](./advancedrocketry/)