Crafttweaker Recipe Change Applies to Recipes it Shouldn't Be.
puncrafter opened this issue ยท 3 comments
General Information
Describe the bug:
I have a crafttweaker script that changes the recipe of the fancy gold blocks to use a different ingredient instead of gold. For some reason, it is also replacing gold in the alloyer recipes for electrum and angmallen to use the new ingredient as well! In this case, it's with an ore dictionary entry, but I imagine it would work with anything.
To Reproduce:
I have put the important slice of crafttweaker script down below. When I comment out this part of the script, it also removes the alloyer recipes, so I know it's this script causing it.
Expected behavior:
It shouldn't change recipes that I didn't tell it to.
Environment Versions
Versions:
- Metallurgy: Metallurgy-4-Reforged-1.2.5
- Conflicting mod (if regarding mod integration): CraftTweaker2-1.12-4.1.20.618
- Forge: 14.23.5.2854
- Minecraft: 1.12.2
Logging Information
Please Use gist, paste.ee, pastebin or some other log sharing service
Crash Report (if available):
N/A
Latest Log (if necessary):
I don't think this is necessary.
Additional Information
Screenshots (if available):
N/A
Additional context (optional):
I hope this is a metallurgy issue and not a crafttweaker one!
import crafttweaker.item.IItemStack;
import crafttweaker.recipes.ICraftingRecipe;
var goldStuff = [
metallurgy:gold_reinforced_glass,
metallurgy:gold_large_bricks,
metallurgy:gold_hazard_block,
metallurgy:gold_engraved_block,
metallurgy:gold_crystals,
metallurgy:gold_bricks
] as IItemStack[];
for item in goldStuff {
recipes.replaceAllOccurences(minecraft:gold_ingot, ore:imitationGold, item);
recipes.replaceAllOccurences(minecraft:gold_nugget, ore:imitationGoldNugget, item);
}
Well, that's strange... the bug stopped occuring once I removed gold ingots from the imitationGold
oredict entry. As soon as I re-add gold ingots to the oredict entry, the problem returns. Try adding gold ingots to the entry and see if that lets you reproduce the issue.
except I had to add crafttweaker angular brackets to every item <>
for the script to work, but it's doing its job correctly, with regular items
import mods.metallurgyreforged.Crusher;
import crafttweaker.item.IItemStack;
import crafttweaker.recipes.ICraftingRecipe;
var goldStuff = [
<metallurgy:gold_reinforced_glass>,
<metallurgy:gold_large_bricks>,
<metallurgy:gold_hazard_block>,
<metallurgy:gold_engraved_block>,
<metallurgy:gold_crystals>,
<metallurgy:gold_bricks>
] as IItemStack[];
for item in goldStuff {
recipes.replaceAllOccurences(<minecraft:gold_ingot>, <minecraft:brown_mushroom>, item);
recipes.replaceAllOccurences(<minecraft:gold_nugget>, <minecraft:egg>, item);
}
As a second test I've setup some fictional Oredictionary Entries to be able to test in the exact same condition as yours:
import mods.metallurgyreforged.Crusher;
import crafttweaker.item.IItemStack;
import crafttweaker.recipes.ICraftingRecipe;
//Setup Oredictionary entries
val imitationGold = <ore:imitationGold>;
val imitationGoldNugget = <ore:imitationGoldNugget>;
imitationGold.add(<minecraft:tallgrass>);
imitationGoldNugget.add(<minecraft:dirt>);
var goldStuff = [
<metallurgy:gold_reinforced_glass>,
<metallurgy:gold_large_bricks>,
<metallurgy:gold_hazard_block>,
<metallurgy:gold_engraved_block>,
<metallurgy:gold_crystals>,
<metallurgy:gold_bricks>
] as IItemStack[];
for item in goldStuff {
recipes.replaceAllOccurences(<minecraft:gold_ingot>, <ore:imitationGold>, item);
recipes.replaceAllOccurences(<minecraft:gold_nugget>, <ore:imitationGoldNugget>, item);
}
Even in this case recipes seem to be working correctly
and they're not conflicting with other things like electrum
if I lookup all the recipes that contain bushes only the correct ones appear