From 7f22828d8fc58379353faa2f2f937d5e3c33a3a3 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Sun, 4 Aug 2024 20:16:41 +1000 Subject: [PATCH] Allow Empowered Void Crystal to Take Any Oil Type (#856) [FEATURE] --- .../Post-Initial/Main/Mod-Specific/aa.groovy | 90 +++++++++++++++++++ overrides/scripts/CraftingCoreUpgrade.zs | 78 ---------------- overrides/scripts/aa xu2.zs | 44 +-------- 3 files changed, 91 insertions(+), 121 deletions(-) create mode 100644 overrides/groovy/postInit/Post-Initial/Main/Mod-Specific/aa.groovy diff --git a/overrides/groovy/postInit/Post-Initial/Main/Mod-Specific/aa.groovy b/overrides/groovy/postInit/Post-Initial/Main/Mod-Specific/aa.groovy new file mode 100644 index 0000000..0537906 --- /dev/null +++ b/overrides/groovy/postInit/Post-Initial/Main/Mod-Specific/aa.groovy @@ -0,0 +1,90 @@ +import de.ellpeck.actuallyadditions.api.recipe.EmpowererRecipe +import gregtech.api.items.metaitem.MetaItem +import gregtech.common.items.MetaItems +import net.minecraft.item.ItemStack +import net.minecraftforge.fluids.FluidStack +import net.minecraftforge.fluids.capability.CapabilityFluidHandler + +import java.awt.Color + +// Actually Additions Specific Modifications + +/* Helpers */ +var setupEmpowerer = { int blockItemMeta, Color particleColor -> + return mods.actuallyadditions.empowerer.recipeBuilder() + .mainInput(item('actuallyadditions:block_crystal', blockItemMeta)) + .output(item('actuallyadditions:block_crystal_empowered', blockItemMeta)) + .particleColor(particleColor.getRGB()) + .energy(1_000_000) + .time(400) +} + +var removeEmpowerer = { int blockItemMeta, ItemStack gear -> + mods.actuallyadditions.empowerer.removeByOutput(item('actuallyadditions:item_crystal_empowered', blockItemMeta)) + mods.actuallyadditions.empowerer.removeByOutput(item('actuallyadditions:block_crystal_empowered', blockItemMeta)) + mods.actuallyadditions.empowerer.removeByOutput(gear) +} + +var setupAndRemoveEmpowerer = { int blockItemMeta, ItemStack gear, Color particleColor -> + removeEmpowerer(blockItemMeta, gear) + return setupEmpowerer(blockItemMeta, particleColor) +} + +var fillMetaItem = { FluidStack toFill, MetaItem.MetaValueItem item -> + var fill = item.stackForm + var fluidCap = fill.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null) + if (fluidCap == null) return fill; + + fluidCap.fill(toFill * 1000, true) + return fluidCap.container +} + +/* Custom Empowerer Recipes */ + +// Empowered Restonia +setupAndRemoveEmpowerer(0, item('moreplates:empowered_restonia_gear'), Color.RED) + .input(ore('gemAlmandine'), ore('ingotRedAlloy'), fillMetaItem(fluid('sulfuric_acid'), MetaItems.FLUID_CELL_GLASS_VIAL), item('extendedcrafting:material', 19)) + .register() + +// Empowered Palis +setupAndRemoveEmpowerer(1, item('moreplates:empowered_palis_gear'), Color.BLUE) + .input(ore('gemSapphire'), item('thermalfoundation:material', 136), fillMetaItem(fluid('water'), MetaItems.FLUID_CELL), item('extendedcrafting:material', 16)) + .register() + +// Empowered Diamatine +setupAndRemoveEmpowerer(2, item('moreplates:empowered_diamatine_gear'), Color.CYAN) + .input(item('extendedcrafting:material', 40), item('extendedcrafting:material', 24), fillMetaItem(fluid('nitrogen_dioxide'), MetaItems.FLUID_CELL), item('extendedcrafting:material', 18)) + .register() + +// Empowered Void +removeEmpowerer(3, item('moreplates:empowered_void_gear')) +for (var oilType : ['oil', 'oil_heavy', 'oil_medium', 'oil_light']) { + setupEmpowerer(3, Color.DARK_GRAY) + .input(item('actuallyadditions:item_misc', 5), ore('ingotDarkSteel'), fillMetaItem(fluid(oilType), MetaItems.FLUID_CELL), item('extendedcrafting:material', 15)) + .register() +} + +// Empowered Emeradic +setupAndRemoveEmpowerer(4, item('moreplates:empowered_emeradic_gear'), Color.GREEN) + .input(item('nomilabs:stabilizeduranium'), ore('ingotVibrantAlloy'), fillMetaItem(fluid('argon'), MetaItems.FLUID_CELL), item('extendedcrafting:material', 17)) + .register() + +// Empowered Enori +setupAndRemoveEmpowerer(5, item('moreplates:empowered_enori_gear'), Color.WHITE) + .input(ore('gemApatite'), ore('ingotEndSteel'), fillMetaItem(fluid('helium'), MetaItems.FLUID_CELL), item('extendedcrafting:material', 14)) + .register() + +/* For EVERY Empowerer Recipe, add a Combination Crafting Recipe */ +mods.actuallyadditions.empowerer.streamRecipes() + .forEach { EmpowererRecipe recipe -> + mods.extendedcrafting.combination_crafting.recipeBuilder() + .input(recipe.input.matchingStacks[0]) + .pedestals(recipe.standOne.matchingStacks[0]) + .pedestals(recipe.standTwo.matchingStacks[0]) + .pedestals(recipe.standThree.matchingStacks[0]) + .pedestals(recipe.standFour.matchingStacks[0]) + .output(recipe.output) + .totalCost(4_000_000) + .costPerTick(400_000) + .register() + } diff --git a/overrides/scripts/CraftingCoreUpgrade.zs b/overrides/scripts/CraftingCoreUpgrade.zs index 9aeb68e..d48c262 100644 --- a/overrides/scripts/CraftingCoreUpgrade.zs +++ b/overrides/scripts/CraftingCoreUpgrade.zs @@ -10,81 +10,3 @@ recipes.addShaped(, [ [, , ], [, , ], [, , ]]); - - -var outputInputMap as IIngredient[][IItemStack] = { - #Empowered Canola Seed - : [ - , //crystallized canola seed - , - , - , - - ], - #Empowered Restonia - : [ - , - , - , - .withTag({Fluid: {FluidName: "sulfuric_acid", Amount: 1000}}), - //conflux component - ], - #Empowered Palis - : [ - , - , - , - .withTag({Fluid: {FluidName: "water", Amount: 1000}}), - - ], - #Empowered Diamatine - : [ - , - , - , - .withTag({Fluid: {FluidName: "nitrogen_dioxide", Amount: 1000}}), - - ], - #Empowered Void Crystal - : [ - , - , - , - .withTag({Fluid: {FluidName: "oil", Amount: 1000}}), - - ], - #Empowered Emeradic - : [ - , - , - , - .withTag({Fluid: {FluidName: "argon", Amount: 1000}}), - - ], - #Empowered Enori - : [ - , - , - , - .withTag({Fluid: {FluidName: "helium", Amount: 1000}}), - - ] -}; - -for output, inputArray in outputInputMap { - var input as IItemStack = inputArray[0]; - mods.extendedcrafting.CombinationCrafting.addRecipe( - output, - 4000000, - 400000, - input, [ - inputArray[1], - inputArray[2], - inputArray[3], - inputArray[4] - ]); -} - - - - diff --git a/overrides/scripts/aa xu2.zs b/overrides/scripts/aa xu2.zs index d87e526..2235810 100644 --- a/overrides/scripts/aa xu2.zs +++ b/overrides/scripts/aa xu2.zs @@ -11,49 +11,7 @@ mods.thermalexpansion.Compactor.removeGearRecipe( * 4); mods.thermalexpansion.Compactor.removeGearRecipe( * 4); - - -//Empowered Restonia -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.addRecipe(, , , , .withTag({Fluid: {FluidName: "sulfuric_acid", Amount: 1000}}), , 1000000, 400); - - -//Empowered Palis -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.addRecipe(, , , , .withTag({Fluid: {FluidName: "water", Amount: 1000}}), , 1000000, 400); - - -//Empowered Enori -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.addRecipe(, , , , .withTag({Fluid: {FluidName: "helium", Amount: 1000}}), , 1000000, 400); - - -//Empowered Void Crystal -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.addRecipe(, , , , .withTag({Fluid: {FluidName: "oil", Amount: 1000}}), , 1000000, 400); - - -//Empowered Diamatine -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.addRecipe(, , , , .withTag({Fluid: {FluidName: "nitrogen_dioxide", Amount: 1000}}), , 1000000, 400); - - - -//Empowered Emerald -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.removeRecipe(); -mods.actuallyadditions.Empowerer.addRecipe(, , , , .withTag({Fluid: {FluidName: "argon", Amount: 1000}}), , 1000000, 400); +// Empowerer Recipes (Moved to Groovy) //Black Quartz electrolyzer.recipeBuilder()