aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/RecipeBuilder.md66
-rw-r--r--docs/ResourcePacks_Guide.md68
-rw-r--r--docs/img/recipemap-unlocalized-name.pngbin0 -> 25590 bytes
3 files changed, 134 insertions, 0 deletions
diff --git a/docs/RecipeBuilder.md b/docs/RecipeBuilder.md
new file mode 100644
index 0000000000..1607f8fd23
--- /dev/null
+++ b/docs/RecipeBuilder.md
@@ -0,0 +1,66 @@
+# introduction
+
+GT_RecipeBuilder is the replacement of GT_Values.RA.addXXXX for constructing and adding recipes.
+Compared to the old style, this one utilizes the builder pattern to
+
+1. allow greater flexibility in API.
+2. allow us to unify the AssLine recipes and everything else
+3. a much nicer syntax than an awfully long line, i.e. more readability
+
+## metadata
+
+this corresponds to the various int/long parameter on the old recipe adder interface.
+See implosion compressor recipe map for a example on its usage.
+the extension also made it possible to use more complicated value, however there is no such use case yet.
+
+`LOW_GRAVITY` and `CLEANROOM` are common metadata that are supported in most recipe maps. They default to false, and is
+required to be set to true if you want your recipe to have such restriction.
+
+Other metadata used by the specific recipe maps MUST to be documented in some way, with javadoc on the recipe map field
+being the preferred choice.
+
+# Coding Conventions
+
+## Metadata identifiers
+
+1. naming uses snake case, e.g. `my_metadata_identifier`
+2.
+
+## complicated recipe adder
+
+1. If one invocation of recipe adder would add multiple recipe to same recipe map, give that recipe map a recipeEmitter
+2. If one invocation of recipe adder would conditionally add recipe, define a new IRecipeMap in GT_RecipeConstants
+3. If one invocation of recipe adder would add recipe to multiple recipe map,
+ 1. If all recipe maps involved receive recipe only via this type of adding, use the chaining mechanism offered by GT_RecipeMap, i.e. addDownstream().
+
+ e.g.sMultiblockElectrolyzerRecipes and sElectrolyzerRecipes
+ 2. Otherwise, define a new IRecipeMap in GT_RecipeConstants.
+4. If the target isn't a real recipe map (e.g. AssLine stuff), define a new IRecipeMap in GT_RecipeConstants.
+
+## Downstream in an addon
+
+This assumes you need to generate recipe into your own recipe map from a parent recipe map.
+
+## deep copy or not
+
+There is no need to do deep copy EXCEPT you are downstream.
+If you do modify the values in a downstream recipe map, call IRecipeMap.deepCopyInput() before adding yourself as a downstream.
+
+## recipeTransformer or recipeEmitterSingle
+
+Prefer recipeTransformer, unless it would throw exception on builder.build().
+
+## Special Value and Special Item
+
+These are considered legacy. IRecipeMap should avoid using these and use the more readable metadata system.
+
+## Use recipe builder or add() directly inside IRecipeMap.doAdd()?
+
+You SHOULD use the recipe builder and delegate further processing to the doAdd() on that recipe map. e.g. UniversalDistillation
+However, there are situations that you need to bypass those logic. Then add() is a valid choice.
+
+## Reassign builder variable
+
+No. Just like StringBuilder, you should not do this. Builder is guaranteed to return itself, not a copy.
+
+Reassigning wouldn't break anything though. This is a coding convention to help the code to stay organized.
diff --git a/docs/ResourcePacks_Guide.md b/docs/ResourcePacks_Guide.md
new file mode 100644
index 0000000000..30fc219651
--- /dev/null
+++ b/docs/ResourcePacks_Guide.md
@@ -0,0 +1,68 @@
+This is a guide for resource packs to set up advanced configurations for GUI.
+
+## Override text color with mcmeta files
+
+You might want to change color of text displayed on GUI. You can place mcmeta files at the following locations:
+- `gregtech/textures/gui/background/singleblock_default.png.mcmeta` (most of the machines)
+- `gregtech/textures/gui/background/bronze.png.mcmeta` (steam bronze machines)
+- `gregtech/textures/gui/background/steel.png.mcmeta` (steam steel machines)
+- `gregtech/textures/gui/background/primitive.png.mcmeta` (steam primitive machines)
+- `gregtech/textures/gui/background/fusion_computer.png.mcmeta` (fusion reactor controller)
+- `gregtech/textures/gui/background/nei_single_recipe.png.mcmeta` (NEI recipe border)
+
+(and there might be more in the future, but currently these are exhaustive.)
+You also need to place png file corresponding to mcmeta file, even if it's unchanged from the mod's default one.
+
+Here is an example of the file:
+```json
+{
+ "colors": {
+ "guiTint": {
+ "enableGUITint": true,
+ "Black": "202020",
+ "Red": "800000",
+ "Green": "005B00",
+ "Brown": "553C00",
+ "Blue": "002456",
+ "Purple": "551839",
+ "Cyan": "007780",
+ "Light Gray": "AAAAAA",
+ "Gray": "808080",
+ "Pink": "800056",
+ "Lime": "559155",
+ "Yellow": "AAA455",
+ "Light Blue": "55A4AA",
+ "Magenta": "BF4095",
+ "Orange": "AA4F00",
+ "White": "FAFAFF",
+ "Machine Metal": "0047AB"
+ },
+ "textColor": {
+ "title": "FF7700",
+ "title_white": "66FAFA",
+ "text_white": "807BAA",
+ "text_gray": "AAE055",
+ "text_red": "FF2222",
+ "nei": "556D8E",
+ "nei_overlay_yellow": "0xFDD835"
+ }
+ }
+}
+```
+
+## Override progress bar texture
+
+With the transition to ModularUI, many of the textures can be reused in many places now. However, some resource packs still want to add progress bar textures for singleblock machines, unique to each type of them.
+You can simply add textures named by the following rules:
+
+- Basically place at `gregtech/textures/gui/progressbar/${unlocalized name of recipemap}`. Unlocalized name can be found on either of:
+ - Hold shift while hovering over NEI tab. "HandlerID" indicates unlocalized name.
+![](/docs/img/recipemap-unlocalized-name.png)
+ - Read code. Usually they're passed as 2nd argument for `GT_Recipe_Map` constructor. Recipemaps are defined at `gregtech.api.util.GT_Recipe`.
+- For steam machines, append `_bronze`, `_steel`, or `_primitive`.
+- Exceptions: Miner: `miner`, Electric Furnace: `E_Furnace`, Electric Oven: `E_Oven`
+
+Examples:
+- `gregtech/textures/gui/progressbar/gt.recipe.laserengraver.png`
+- `gregtech/textures/gui/progressbar/gt.recipe.alloysmelter_bronze.png`
+- `gregtech/textures/gui/progressbar/E_Furnace.png`
diff --git a/docs/img/recipemap-unlocalized-name.png b/docs/img/recipemap-unlocalized-name.png
new file mode 100644
index 0000000000..31c2b8bec9
--- /dev/null
+++ b/docs/img/recipemap-unlocalized-name.png
Binary files differ