diff --git a/scripts/ThaumcraftGating.zs b/scripts/ThaumcraftGating.zs index 78ad8c5c..bcbc41aa 100644 --- a/scripts/ThaumcraftGating.zs +++ b/scripts/ThaumcraftGating.zs @@ -70,9 +70,10 @@ recipes.addShaped(*4, recipes.removeShaped(); recipes.removeShaped(); -// recipes.removeShaped(); -// recipes.removeShaped(); -// recipes.removeShaped(); +// See thaumcraft/research/LateResearch.zs for related research adjustments +recipes.removeShaped(); +recipes.removeShaped(); +recipes.removeShaped(); mods.thaumcraft.Infusion.removeRecipe(); diff --git a/scripts/ToolTips.zs b/scripts/ToolTips.zs index ce97a298..13526270 100644 --- a/scripts/ToolTips.zs +++ b/scripts/ToolTips.zs @@ -1192,10 +1192,6 @@ .addTooltip(format.red("Use inside the Recursion Prison Key Dungeon")); .addTooltip(format.red("Use inside the Recursion Prison Key Dungeon")); -.addTooltip(format.red("If you want to complete the Thaumonomicon entries that require plates, make sure you craft them, making them in a compactor won't work")); -.addTooltip(format.red("If you want to complete the Thaumonomicon entries that require plates, make sure you craft them, making them in a compactor won't work")); -.addTooltip(format.red("If you want to complete the Thaumonomicon entries that require plates, make sure you craft them, making them in a compactor won't work")); - .addTooltip(format.red("The actual item has been hidden from JEI for lag reasons, ignore the structure voids")); diff --git a/scripts/thaumcraft/research/LateResearch.zs b/scripts/thaumcraft/research/LateResearch.zs new file mode 100644 index 00000000..be470afb --- /dev/null +++ b/scripts/thaumcraft/research/LateResearch.zs @@ -0,0 +1,80 @@ +#modloaded thaumcraft +#loader lateAddTC +import native.net.minecraft.item.ItemStack; +import native.thaumcraft.api.research.ResearchCategories; +import native.thaumcraft.api.research.ResearchStage; + +import crafttweaker.item.IItemStack; + +/* +Hard-coded, non-JSON, research pages to replace crafting requirements for consume requirements. +This is so we can make these ingredients obtainable through non-crafting recipes, +but still make associated research completable. +*/ + +# Mithrillium plates +var mithrilliumPlate = ; +var t1JarStage = findCraftingStage("TAR_MITHRILLIUM_JAR", mithrilliumPlate); +convertCraftToConsume(t1JarStage, mithrilliumPlate); + +var t1SmelterStage = findCraftingStage("TAR_MITHRILLIUM_SMELTER", mithrilliumPlate); +convertCraftToConsume(t1SmelterStage, mithrilliumPlate); + +# Adaminite plates +var adaminitePlate = ; +var t2JarStage = findCraftingStage("TAR_ADAMINITE_JAR", adaminitePlate); +convertCraftToConsume(t2JarStage, adaminitePlate); + +var t2SmelterStage = findCraftingStage("TAR_ADAMINITE_SMELTER", adaminitePlate); +convertCraftToConsume(t2SmelterStage, adaminitePlate); + +# Mithminite plates +var mithminitePlate = ; +var t3JarStage = findCraftingStage("TAR_MITHMINITE_JAR", mithminitePlate); +convertCraftToConsume(t3JarStage, mithminitePlate); + +var t3SmelterStage = findCraftingStage("TAR_MITHMINITE_SMELTER", mithminitePlate); +convertCraftToConsume(t3SmelterStage, mithminitePlate); + +var scytheStage = findCraftingStage("TAR_MITHMINITE_SCYTHE", mithminitePlate); +convertCraftToConsume(scytheStage, mithminitePlate); + +function findCraftingStage(researchName as string, targetItem as IItemStack) as ResearchStage { + var stages = ResearchCategories.getResearch(researchName).getStages(); + for stage in stages { + var crafts = stage.getCraft(); + // Check this stage has the target crafting requirement + if (!isNull(crafts)) { + var craftsAsItems = crafts as ItemStack[]; + for stack in craftsAsItems { + if (ItemStack.areItemStacksEqual(stack, targetItem.native)) { + return stage; + } + } + } + } + return null; +} + +function convertCraftToConsume(stage as ResearchStage, itemToConvert as IItemStack) { + var newCrafts = [] as [ItemStack]; + var oldCrafts = stage.getCraft() as ItemStack[]; + for stack in oldCrafts { + if (!ItemStack.areItemStacksEqual(stack, itemToConvert.native)) { + newCrafts += stack; + } + } + // Remove item from crafting requirement + if (newCrafts.length == 0) { + stage.setCraft(null); + } else { + stage.setCraft(newCrafts); + } + // Add item to consume requirement + var consumed = stage.getObtain(); + if (isNull(consumed) || consumed.length == 0) { + stage.setObtain([itemToConvert.native] as ItemStack[]); + } else { + stage.setObtain((consumed as ItemStack[]) + itemToConvert.native); + } +}