From 388b670ed1ebd48e7d9dfae6020b09ef3f62a9cc Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Sat, 30 Mar 2024 18:23:42 +1100 Subject: [PATCH] Fix Small Dust, Tiny Dust & Dye Conversion Recipes (#696) [EXPAND] [[messages]] messageTitle = "Fix Small Dust & Tiny Dust Crafting Conversion Recipes (#696)" messageBody = ''' [BUG] [DETAILS] detail = "Recipes are now as Shown in JEI! Change your AE2 Patterns!" [DETAILS] ''' [[messages]] messageTitle = "Fix Dust to Dye Conversion Recipes (#696)" messageBody = ''' [BUG] [IGNORE] compareNot = "1.7-alpha-3" [IGNORE] [DETAILS] details = ["Dust to Dye Conversion Recipes are no longer Shapeless."] [DETAILS] ''' --- manifest.json | 2 +- .../Main/General/Misc/dyes.groovy | 105 +++++++++++++++ overrides/scripts/undyeing.zs | 120 ------------------ 3 files changed, 106 insertions(+), 121 deletions(-) create mode 100644 overrides/groovy/postInit/Post-Initial/Main/General/Misc/dyes.groovy delete mode 100644 overrides/scripts/undyeing.zs diff --git a/manifest.json b/manifest.json index 2b99990..498958c 100644 --- a/manifest.json +++ b/manifest.json @@ -763,7 +763,7 @@ }, { "projectID": 932060, - "fileID": 5215193, + "fileID": 5217682, "required": true }, { diff --git a/overrides/groovy/postInit/Post-Initial/Main/General/Misc/dyes.groovy b/overrides/groovy/postInit/Post-Initial/Main/General/Misc/dyes.groovy new file mode 100644 index 0000000..9d94215 --- /dev/null +++ b/overrides/groovy/postInit/Post-Initial/Main/General/Misc/dyes.groovy @@ -0,0 +1,105 @@ +import com.cleanroommc.groovyscript.helper.ingredient.OreDictIngredient +import com.nomiceu.nomilabs.groovy.ShapedConversionRecipe +import net.minecraft.item.EnumDyeColor +import gregtech.api.unification.material.MarkerMaterials +import gregtech.api.unification.material.Materials +import gregtech.api.unification.ore.OrePrefix + +import static gregtech.api.GTValues.* + +// Backport MC 1.14 Dye Mechanics +ore('dyeBlack').remove(item('minecraft:dye', 0)) +ore('dye').remove(item('minecraft:dye', 0)) +addShapedConversionRecipe(metaitem('dye.black'), item('minecraft:dye', 0)) + +ore('dyeBrown').remove(item('minecraft:dye', 3)) +ore('dye').remove(item('minecraft:dye', 3)) +addShapedConversionRecipe(metaitem('dye.brown'), item('minecraft:dye', 3)) +ore('dyeBrown').remove(item('nuclearcraft:cocoa_solids')) +addShapedConversionRecipe(metaitem('dye.brown'), item('nuclearcraft:cocoa_solids')) +addShapedConversionRecipe(metaitem('dye.brown'), metaitem('dustCocoa')); //NC cocoa solids and vanilla cocoa stop being a dye when turned into GT cocoa dust +ore('dyeBrown').remove(metaitem('dustMetalMixture')) +addShapedConversionRecipe(metaitem('dye.brown'), metaitem('dustMetalMixture')) + +ore('dyeBlue').remove(item('minecraft:dye', 4)) +ore('dye').remove(item('minecraft:dye', 4)) +addShapedConversionRecipe(metaitem('dye.blue'), item('minecraft:dye', 4)) +ore('dyeBlue').remove(metaitem('gemLazurite')) +addShapedConversionRecipe(metaitem('dye.blue'), metaitem('gemLazurite')) +ore('dyeBlue').remove(metaitem('gemSodalite')) +addShapedConversionRecipe(metaitem('dye.blue'), metaitem('gemSodalite')) +ore('dyeBlue').remove(metaitem('dustLapis')) +addShapedConversionRecipe(metaitem('dye.blue'), metaitem('dustLapis')) +ore('dyeBlue').remove(metaitem('dustLazurite')) +addShapedConversionRecipe(metaitem('dye.blue'), metaitem('dustLazurite')) +ore('dyeBlue').remove(metaitem('dustSodalite')) +addShapedConversionRecipe(metaitem('dye.blue'), metaitem('dustSodalite')) + +ore('dyeMagenta').remove(item('extrautils2:ingredients', 3)) +addShapedConversionRecipe(metaitem('dye.magenta'), item('extrautils2:ingredients', 3)) + +ore('dyeWhite').remove(item('minecraft:dye', 15)) +ore('dye').remove(item('minecraft:dye', 15)) +addShapedConversionRecipe(metaitem('dye.white'), item('minecraft:dye', 15)) + +def dyeHelperMap = [:] +for (def color : EnumDyeColor.values()) { + dyeHelperMap.put(color.getName(), ore('dye' + color.getName().capitalize())) +} + +// Fix Elevator Redyeing +for (def entry in dyeHelperMap.entrySet()) { + crafting.remove('elevatorid:redye_' + entry.key) + crafting.addShapeless(item('elevatorid:elevator_' + entry.key), [ore('blockElevator'), entry.value]) +} + +// Fix Slime Block Redyeing +for (def color : EnumDyeColor.values()) { + def name = color.getName() + def meta = color.getMetadata() + def oreIng = dyeHelperMap.get(name) + crafting.remove('darkutils:dyed_slime_block_' + name) + crafting.shapedBuilder() + .output(item('darkutils:slime_dyed', meta) * 8) + .matrix('SSS', + 'SDS', + 'SSS') + .key('S', ore('blockSlime')) + .key('D', oreIng) + .register() +} + +// Fix Satchel Redeying +addOreDictToOreDict(ore('dye'), dyeHelperMap.values()) + +// Re-Generate Chemical Dye Reactor Recipes (Breaks when OreDict Changes for Some Reason) +// Copied with some Groovy Changes from +// https://github.com/GregTechCEu/GregTech/blob/master/src/main/java/gregtech/loaders/recipe/chemistry/ReactorRecipes.java#L619-L626 +// Update when they update. +for (int i = 0; i < Materials.CHEMICAL_DYES.length; i++) { + // Technically the amount being 288 doesn't matter, but calling without amount returns Fluid, and we need FluidStack + mods.gregtech.chemical_reactor.removeByOutput(null, [Materials.CHEMICAL_DYES[i].getFluid(288)], null, null) + mods.gregtech.chemical_reactor.recipeBuilder() + .input(OrePrefix.dye, MarkerMaterials.Color.VALUES[i]) + .inputs(metaitem('dustSalt') * 2) + .fluidInputs(fluid('sulfuric_acid') * 250) + .fluidOutputs(Materials.CHEMICAL_DYES[i].getFluid(288)) + .duration(600).EUt(VA[LV]) // Original is 24, but not in GTValues, so just increase to 30 + .buildAndRegister() +} + +void addOreDictToOreDict(OreDictIngredient addTo, Collection from) { + for (def ing in from) { + for (def stack in ing) { + addTo.add(stack) + } + } +} + +void addShapedConversionRecipe(ItemStack outputStack, ItemStack inputStack) { + crafting.shapedBuilder() + .output(outputStack) + .matrix([[inputStack]]) + .recipeClassFunction((output, width, height, ingredients) -> new ShapedConversionRecipe(output, ingredients, width, height)) + .register() +} \ No newline at end of file diff --git a/overrides/scripts/undyeing.zs b/overrides/scripts/undyeing.zs deleted file mode 100644 index 1d81805..0000000 --- a/overrides/scripts/undyeing.zs +++ /dev/null @@ -1,120 +0,0 @@ -//backport 1.14 dye mechanics -.remove(); -.remove(); -recipes.addShapeless(, []); - -.remove(); -.remove(); -recipes.addShapeless(, []); -.remove(); -recipes.addShapeless(, []); -recipes.addShapeless(, []); //NC cocoa solids and vanilla cocoa stop being a dye when turned into GT cocoa dust -.remove(); -recipes.addShapeless(, []); - -.remove(); -.remove(); -recipes.addShapeless(, []); -.remove(); -recipes.addShapeless(, []); -.remove(); -recipes.addShapeless(, []); -.remove(); -recipes.addShapeless(, []); -.remove(); -recipes.addShapeless(, []); -.remove(); -recipes.addShapeless(, []); - -.remove(); -recipes.addShapeless(, []); - -.remove(); -.remove(); -recipes.addShapeless(, []); - -//fix elevator redyeing recipes -recipes.removeByRecipeName("elevatorid:redye_white"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_orange"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_magenta"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_light_blue"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_yellow"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_lime"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_pink"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_gray"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_silver"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_cyan"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_purple"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_blue"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_brown"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_green"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_red"); -recipes.addShapeless(, [,]); -recipes.removeByRecipeName("elevatorid:redye_black"); -recipes.addShapeless(, [,]); - -//fix slime block redyeing recipes -recipes.removeByRecipeName("darkutils:dyed_slime_block_white"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_orange"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_magenta"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_light_blue"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_yellow"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_lime"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_pink"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_gray"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_silver"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_cyan"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_purple"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_blue"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_brown"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_green"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_red"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); -recipes.removeByRecipeName("darkutils:dyed_slime_block_black"); -recipes.addShaped( * 8, [[,,], [,,], [,,]]); - -//fix satchel redyeing -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll(); -.addAll();