diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2023-04-02 00:02:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-01 18:02:47 +0200 |
commit | 6b77557e0e87cf5afd9ebd3985323ff1249e615c (patch) | |
tree | 36474042ef39f863aedc007eab81a9b09cc7aa78 /docs | |
parent | 655cc902d3df19a1ac2bfaa38cc928ed629d0171 (diff) | |
download | GT5-Unofficial-6b77557e0e87cf5afd9ebd3985323ff1249e615c.tar.gz GT5-Unofficial-6b77557e0e87cf5afd9ebd3985323ff1249e615c.tar.bz2 GT5-Unofficial-6b77557e0e87cf5afd9ebd3985323ff1249e615c.zip |
Recipe Adder v2 (#1770)
* add everything
* fixes
* migrate plasma forge recipes
* syntax update
* make chances array length differ a fatal error
* time constants + long eut overload
* migrate extruder recipes
* migrate electromagnetic separator recipes
* migrate wiremill recipes
* migrate forming press recipes
* migrate bender recipes
* add doc to clarify the three itemInputs
* migrate alloy smelter recipes
* migrate arc furnace recipes
* added ModIDs enum
* sort ModIDs
* migrate autoclave recipes
* migrated some assembler recipes
* split a bit more assembler recipes
* migrate canner recipes
* migrate brewing recipes
* ic2 mod check in canner recipes
* use some loops to reduce the amount of recipes to migrate
* add requested helper methods
* migrate vacuum freezer recipes
* migrate thermal centrifuge recipes
* format smelter recipes only, doesn't go through normal GT recipe
* migrated slicer recipes
* migrated sifter recipes
* Use proper enum now
* remove more constants
* cleaning cutting recipes before migration
* remove tons of dead commented recipes
* migrate pyrolyse recipes
* use ModIDs enum more
* migrate printer recipes
* add a less confusing way to specify value of specialItem
* migrate pulverizer recipes
* less confusing special item specification
* even more ModIDs enum usage
* fix auto * import confusing Minecraft enum value with Minecraft client object
* migrated blast furnace recipes
* migrated Centrifuge recipes
* migrated assembler recipes
* migrated implosion compressor recipes
* migrated extractor recipes
* migrated mixer recipes
* remove useless code
* mgrate universal chemical recipes
* refactor chemical recipes
* migrate single block only chem reactor recipes
* migrate chem reactor recipes
* reworked circuit assembler recipes before migrating them
* migrated circuit assembler recipes
* fix merge conflict for assembler recipes
* remove leftover of the merge conflicts
* fix weird translation glitch
* example of assembly line recipe using RA2
* bugfixes for assline
* remove specialValue usage in blast furnace recipes
* fix more bugs
* add nooptimize to where it make sense
* add recipe descriptions
* Materials.Superconductor -> Materials.SuperconductorUHV
* remove useless Object creations
* remove explicit long casts
* migrate assemblyline recipes
* migrate chemical bath recipes
* migrate compressor recipes
* move smelting recipe where it belongs
* migrated cutting machine recipes
* migrated fermenter recipes (unhide alcohol)
* remove explicit long casts
* migrate fluid canner recipes
* migrate fluid heater recipes
* migrated fusion recipes
* migrated lathe recipes
* migrated laser engraver recipes
* migrated packager recipes
* migrated forge hammer recipes
* migrated TPM recipes
* exit early and reduced indents
* migrated fluid extractor recipes
* migrated fluid solidifier recipes
* migrated electrolyzer recipes
* migrated crop processing recipes
* migrated default polymerization recipes
* migrate distillery recipes
* migrate matter amplifier recipes
* add metadata identifier for fusion ignition threshold
* migrate fuel recipes
* update bs
(cherry picked from commit c2d931c9b6caa0376e9d50591894cd849021104d)
* spotless
(cherry picked from commit 1060f5357fb95e28bfae1f052025f55dabc21a0f)
* guard against null itemstacks
* wrong translation
* fix empty arrays being accessed
* add 0 duration and 0 EU/t for fuel recipes
* fix typo in matter amplifier recipes
* spotless apply
---------
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/RecipeBuilder.md | 60 | ||||
-rw-r--r-- | docs/ResourcePacks_Guide.md | 67 |
2 files changed, 127 insertions, 0 deletions
diff --git a/docs/RecipeBuilder.md b/docs/RecipeBuilder.md new file mode 100644 index 0000000000..710f1b2dbc --- /dev/null +++ b/docs/RecipeBuilder.md @@ -0,0 +1,60 @@ +# 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. + +# 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 IGT_RecipeMap 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 IGT_RecipeMap in GT_RecipeConstants. +4. If the target isn't a real recipe map (e.g. AssLine stuff), define a new IGT_RecipeMap 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 IGT_RecipeMap.deepCopyInput() before adding yourself as a downstream. + +## setRecipeSpecialHandler or setRecipeEmitterSingle + +Prefer setRecipeSpecialHandler, unless it would throw exception on builder.build(). + +## Special Value and Special Item + +These are considered legacy. IGT_RecipeMap should avoid using these and use the more readable metadata system. + +## Use recipe builder or add() directly inside IGT_RecipeMap.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..5b3dabbcd1 --- /dev/null +++ b/docs/ResourcePacks_Guide.md @@ -0,0 +1,67 @@ +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 if your texture has similar color to text. You can place mcmeta files at the following locations: +- `gregtech/textures/gui/background/singleblock_default.mcmeta` (most of the machines) +- `gregtech/textures/gui/background/bronze.mcmeta` (steam bronze machines) +- `gregtech/textures/gui/background/steel.mcmeta` (steam steel machines) +- `gregtech/textures/gui/background/primitive.mcmeta` (steam primitive machines) +- `gregtech/textures/gui/background/fusion_computer.mcmeta` (fusion reactor controller) +- `modularui/textures/gui/background/vanilla_background.mcmeta` (NEI) + +(and there might be more in the future, but currently these are exhaustive.) + +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. + + - 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` |