Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup of Recipes and moving to RecipeHandlers #141

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

ALongStringOfNumbers
Copy link
Collaborator

@ALongStringOfNumbers ALongStringOfNumbers commented May 2, 2021

This PR cleans up various recipe removals and additions, where recipes are removed and then a duplicate recipe is added.

In addition, this PR refactors crafting table recipe removals, namely through wrapping the previously used GTCE methods so that we can add additional logging to see if a removal has failed.

GAConfig

  • Added a clarification to the double ingots to plates config option
  • Moved the Bundler config option to be grouped with all the other higher tier machine options
  • Added a config option for if Gem tools should be made with a hammer or a file

GAEnums

  • Rearranges the creation of the OrePrefix added by the mod, so that they are able to be directly referenced in other sections of the code
  • Adds a constant field, WIRE_DOUBLING_ORDER, as GTCE's is not able to be referenced

GregicAdditions

  • Registers our Recipe Handlers
  • Breaks out some Registration to be in different methods

GAMetaItems

  • Refer to the OrePrefixes through their new reference methods
  • Remove the section where Recipes were being registered from the MetaTools class

GAMetaTool

  • Removes all recipe registration to be moved to recipe handlers

ComponentRegistration

  • Adds recipes for all Components (Robot Arms, etc). Hand crafting, Assembler, and Assembly Line

GAMachineRecipeRemoval

  • Removes a lot of recipe removals, as they were moved to Recipe Handlers. Basically if it was in a loop of the material registry, it is now in Recipe Handlers
  • Removes a failing recipe removal for the primitive circuit
  • Removes the Ash Centrifuging removal, because we basically add back the same thing
  • Removes the Diesel mixing recipe, because we add back the exact same recipe
  • Moves all the removals to HelperMethods

GARecipeAddition

  • Moves some Large boiler recipes into this class, out of the "by hand" recipe class
  • Changes removals to use the new helper methods
  • Removes some failing Schematic recipe removals
  • Formatting
  • Removing Material Registry loops to the Recipe Handler
  • Adjusts Wooden Pipes based on if the bendingPipes config option is enabled. This cannot be done in Recipe Handlers, because there is no curved wood plate
  • Adjusts the recipe of the Max Hull from GTCE, now respecting if the harder hull config option from GTCE is enabled
  • Breaks methods into several distinct methods to address different recipes
  • Adds covering recipes for Superconductor wires
  • Removes the component recipes, as they have been transferred to their own file
  • cleanup
  • Some adjustments to the big mess in generatedRecipes, consolidating some checks and adding a TODO to break it down in a future PR
  • Minor cleanups to the logs -> planks modifying, need to check it against GTCE's config option that might do similar

GeneratorFuels

  • Moves the removals to HelperMethods

MachineCraftingRecipes

  • Fixes a bunch of cases where machines were removed from GTCE and then a duplicate recipe was added
  • Formats the machine recipes
  • Fixes a bug where machines would be gave recipes with tier - 1 components when there was a missing lower tier machines. This was seen for the extruder, where there is no LV variant, and so the MV Extruder was made using all LV components, including the casing.
  • Commenting on the recipe changes
  • Adds Assembler recipes for Drums and Crates

MatterReplication

  • Minor Formatting

RecipeHandlers

  • The main thing added by this PR
  • Registers several OrePrefix handlers to be covered by RecipeHandlers, some based on if various config options are enabled

Process Ingot

This handles the expensive Wrenches and creating recipes for the Bending Cylinders, both config based

Process Tiny Dust

Changes Tiny dusts to be made using the schematic instead of the integrated circuit

Process Small Dust

Changes Small dusts to be made using the schematic instead of the integrated circuit

Process Foil

Adds recipes for handcrafting foils and Cluster Milling foils, both config based

Process Ring

Changes the Ring Recipes to use the Bending Cylinder, config based

Process Round

Adds hand crafting and lathe recipes for the round

Process Plate Curved

Add recipes converting from plates to curved plates, and vice versa, for both hand crafting and the bender
Registers Recipes for pipes using curved plates (Adds handcrafting recipes for Tiny and Large pipes, which did not have them in base GTCE)
Registers Recipes for Rotors with curved plates (by hand and machine), or else restores the rotor assembler recipes removed by GTCE

Process Double Ingot

Adds recipes for Double Ingots and Double Ingots to plates

Process Plate

Adds handcrafting recipes for Tiny and Large pipes (similar to what is done with curved plates), when curved plates are not enabled

Process Wire GT

Adds Bundler recipes
Adds the GT5U cable recipes (Which is a big mess)

  • Doesn't apply to ULV or LV cables
  • Removes the old cable recipes
  • If the cable is IV tier or above:
    • adds recipes with material foils (two types, Polyphenylene Sulfide foils and foils the material of the cable)
    • adds recipes with the different cable dusts and the foils
  • If the cable is MV to EV tier
    • Adds normal insulation recipes
    • Adds insulation recipes with the cable dusts

Process Gems

  • Adds mirrored recipes for tools with gem heads
  • Deals with the config option to replace the hammer with the file in gem tool recipes
  • Both of these could probably be removed

HelperMethods

This class currently just wraps the GTCE removal methods so that we can attach logging to the removals. When I am done testing this PR, the logging levels will be moved to debug on pass and warn on fail.

Closes #144

A Note of conversation. The double ingots flag and config option currently will generate recipes for plates that normally do not have recipes, due to the NO_SMASHING flag. Do we want to add this flag to Double ingot generation, to prevent these materials from being generated, or to the crafting recipes, to prevent the hand crafting recipes from being generated? This is a break from previous behavior, but it does make some sense.

Copy link
Collaborator

@Exaxxion Exaxxion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this struck me as a bit odd as I read through the changes. I'm assuming most of the recipe changes are accurate at this point, but I left comments on things that seemed unusual to me.

Also if this is still a work in progress and waiting on other changes from GTCE to be released, perhaps it would be sensible to mark this as a Draft PR rather than one ready for review.

@@ -242,7 +139,7 @@ public static void init() {
ModHandler.addShapedRecipe("stainless_steel_drum", GATileEntities.STAINLESS_STEEL_DRUM.getStackForm(), " h ", "PRP", "PRP", 'P', "plateCurvedStainlessSteel", 'R', "stickLongStainlessSteel");
ModHandler.addShapedRecipe("titanium_drum", GATileEntities.TITANIUM_DRUM.getStackForm(), " h ", "PRP", "PRP", 'P', "plateCurvedTitanium", 'R', "stickLongTitanium");
ModHandler.addShapedRecipe("tungstensteel_drum", GATileEntities.TUNGSTENSTEEL_DRUM.getStackForm(), " h ", "PRP", "PRP", 'P', "plateCurvedTungstenSteel", 'R', "stickLongTungstenSteel");
} else if (!(GAConfig.GT6.BendingCurvedPlates || GAConfig.GT6.BendingCylinders)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to pertain to config options to change default recipes based on how things work in GT6. Is there a reason it's being removed from the logic here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here is redundant, as if the curved plates are not registered, then regular plates should just be used. In addition, it can be seen that before the final line was added on the initial if, checking if the curved plates were registered, that the conditionals on this else if were basically inverted from the conditionals on the if.


//Power Manipulation Machines
ItemStack last_bat = (GAConfig.GT5U.replaceUVwithMAXBat ? GAMetaItems.MAX_BATTERY : MetaItems.ZPM2).getStackForm();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does GTCE natively have chargers through MAX tier? Not sure why these are being removed otherwise. There's also various configs that control how some of these are added.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, GTCE natively has chargers though MAX tier. I am unsure if there is any config option for adding the higher tier chargers, but I can check for that as well.

ModHandler.addShapedRecipe("ga_steam_turbine_lv", MetaTileEntities.STEAM_TURBINE[0].getStackForm(), "PCP", "RMR", "EWE", 'M', MetaTileEntities.HULL[GTValues.LV].getStackForm(), 'E', MetaItems.ELECTRIC_MOTOR_LV, 'R', new UnificationEntry(OrePrefix.rotor, Materials.Tin), 'C', new UnificationEntry(OrePrefix.valueOf("circuit"), Tier.Basic), 'W', new UnificationEntry(OrePrefix.cableGtSingle, Materials.Tin), 'P', new UnificationEntry(OrePrefix.pipeMedium, Materials.Bronze));
ModHandler.addShapedRecipe("ga_steam_turbine_mv", MetaTileEntities.STEAM_TURBINE[1].getStackForm(), "PCP", "RMR", "EWE", 'M', MetaTileEntities.HULL[GTValues.MV].getStackForm(), 'E', MetaItems.ELECTRIC_MOTOR_MV, 'R', new UnificationEntry(OrePrefix.rotor, Materials.Bronze), 'C', new UnificationEntry(OrePrefix.valueOf("circuit"), Tier.Good), 'W', new UnificationEntry(OrePrefix.cableGtSingle, Materials.Copper), 'P', new UnificationEntry(OrePrefix.pipeMedium, Materials.Steel));
ModHandler.addShapedRecipe("ga_steam_turbine_hv", MetaTileEntities.STEAM_TURBINE[2].getStackForm(), "PCP", "RMR", "EWE", 'M', MetaTileEntities.HULL[GTValues.HV].getStackForm(), 'E', MetaItems.ELECTRIC_MOTOR_HV, 'R', new UnificationEntry(OrePrefix.rotor, Materials.Steel), 'C', new UnificationEntry(OrePrefix.valueOf("circuit"), Tier.Advanced), 'W', new UnificationEntry(OrePrefix.cableGtSingle, Materials.Gold), 'P', new UnificationEntry(OrePrefix.pipeMedium, Materials.StainlessSteel));
ModHandler.addShapedRecipe("ga_magic_energy_absorber", MetaTileEntities.MAGIC_ENERGY_ABSORBER.getStackForm(), "PCP", "PMP", "PCP", 'M', MetaTileEntities.HULL[GTValues.EV].getStackForm(), 'P', MetaItems.SENSOR_EV, 'C', new UnificationEntry(OrePrefix.valueOf("circuit"), Tier.Elite));
if (MetaTileEntities.MAGIC_ENERGY_ABSORBER != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is definitely a different recipe than the base GTCE one, reducing the tier from EV to MV.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at the line above your comment, we also attempt to set the recipe to EV tier components (Which happens to be the same as GTCE). I am unsure why we are attempting to set the recipe for this machine twice, once at EV and one at MV, but since this machine gives out EV power, and the original recipe in GTCE is EV, I went with removing the MV recipe.

@ALongStringOfNumbers ALongStringOfNumbers changed the title Cleanup of MachineCraftingRecipes Cleanup of duplicate recipes and recipe removals May 6, 2021
@Exaxxion Exaxxion added the cleanup Code cleanups & refactoring label May 6, 2021
@Exaxxion Exaxxion marked this pull request as draft May 11, 2021 19:43
@ALongStringOfNumbers ALongStringOfNumbers changed the title Cleanup of duplicate recipes and recipe removals Cleanup of Recipes and moving to RecipeHandlers May 13, 2021
@ALongStringOfNumbers ALongStringOfNumbers marked this pull request as ready for review June 11, 2021 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanups & refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TODO: investigate better ways to implement recipe replacements
2 participants