Replace crafting reqs for TAR plates
- Now a consume requirement instead of crafting requirement - Removes crafting recipes for the plates
This commit is contained in:
@@ -70,9 +70,10 @@ recipes.addShaped(<thaumicaugmentation:starfield_glass:2>*4,
|
||||
|
||||
recipes.removeShaped(<thaumcraft:plate:2>);
|
||||
recipes.removeShaped(<thaumcraft:plate:3>);
|
||||
// recipes.removeShaped(<thaumadditions:mithrillium_plate>);
|
||||
// recipes.removeShaped(<thaumadditions:adaminite_plate>);
|
||||
// recipes.removeShaped(<thaumadditions:mithminite_plate>);
|
||||
// See thaumcraft/research/LateResearch.zs for related research adjustments
|
||||
recipes.removeShaped(<thaumadditions:mithrillium_plate>);
|
||||
recipes.removeShaped(<thaumadditions:adaminite_plate>);
|
||||
recipes.removeShaped(<thaumadditions:mithminite_plate>);
|
||||
|
||||
mods.thaumcraft.Infusion.removeRecipe(<thaumicenergistics:arcane_assembler>);
|
||||
|
||||
|
||||
@@ -1192,10 +1192,6 @@
|
||||
<contenttweaker:fourth_recursive_lock>.addTooltip(format.red("Use inside the Recursion Prison Key Dungeon"));
|
||||
<contenttweaker:fifth_recursive_lock>.addTooltip(format.red("Use inside the Recursion Prison Key Dungeon"));
|
||||
|
||||
<ore:plateMithrillium>.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"));
|
||||
<ore:plateAdaminite>.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"));
|
||||
<ore:plateMithminite>.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"));
|
||||
|
||||
<contenttweaker:rftools_syringe>.addTooltip(format.red("The actual item has been hidden from JEI for lag reasons, ignore the structure voids"));
|
||||
|
||||
|
||||
|
||||
@@ -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 = <thaumadditions:mithrillium_plate>;
|
||||
var t1JarStage = findCraftingStage("TAR_MITHRILLIUM_JAR", mithrilliumPlate);
|
||||
convertCraftToConsume(t1JarStage, mithrilliumPlate);
|
||||
|
||||
var t1SmelterStage = findCraftingStage("TAR_MITHRILLIUM_SMELTER", mithrilliumPlate);
|
||||
convertCraftToConsume(t1SmelterStage, mithrilliumPlate);
|
||||
|
||||
# Adaminite plates
|
||||
var adaminitePlate = <thaumadditions:adaminite_plate>;
|
||||
var t2JarStage = findCraftingStage("TAR_ADAMINITE_JAR", adaminitePlate);
|
||||
convertCraftToConsume(t2JarStage, adaminitePlate);
|
||||
|
||||
var t2SmelterStage = findCraftingStage("TAR_ADAMINITE_SMELTER", adaminitePlate);
|
||||
convertCraftToConsume(t2SmelterStage, adaminitePlate);
|
||||
|
||||
# Mithminite plates
|
||||
var mithminitePlate = <thaumadditions:mithminite_plate>;
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user