fix commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#modloaded thaumcraft
|
||||
#loader lateAddTC
|
||||
#priority 10
|
||||
|
||||
import native.net.minecraft.item.ItemStack;
|
||||
|
||||
import crafttweaker.item.IItemStack;
|
||||
|
||||
static unifiedPlates as IItemStack[IItemStack] = {
|
||||
<thaumcraft:plate:0>: <techreborn:plates:18>, // brass
|
||||
<thaumcraft:plate:1>: <thermalfoundation:material:32>, // iron
|
||||
<bewitchment:silver_plate>: <thermalfoundation:material:322>, // silver
|
||||
};
|
||||
|
||||
function unifyStack(stackIn as ItemStack, unifiedDict as IItemStack[IItemStack]) as ItemStack {
|
||||
var stack as IItemStack = stackIn.wrapper;
|
||||
for original, unified in unifiedDict {
|
||||
if (stack.anyAmount().matches(original)) {
|
||||
return (unified * stack.amount).native;
|
||||
}
|
||||
}
|
||||
return stackIn;
|
||||
}
|
||||
|
||||
function unifyPlates(stackIn as ItemStack) as ItemStack {
|
||||
return unifyStack(stackIn, unifiedPlates);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#modloaded thaumcraft
|
||||
#loader lateAddTC
|
||||
import native.net.minecraft.item.ItemStack;
|
||||
import native.thaumcraft.api.golems.parts.GolemMaterial;
|
||||
import native.thaumcraft.api.golems.parts.GolemHead;
|
||||
import native.thaumcraft.api.golems.parts.GolemLeg;
|
||||
|
||||
import crafttweaker.item.IItemStack;
|
||||
|
||||
import scripts.thaumcraft.Unifier;
|
||||
/*
|
||||
Unify plates visually shown in the golem press.
|
||||
*/
|
||||
# Materials
|
||||
for material in GolemMaterial.getMaterials() {
|
||||
if (isStackValid(material.componentBase)) {
|
||||
var baseComponent as IItemStack = material.componentBase.wrapper;
|
||||
material.componentBase = Unifier.unifyPlates(baseComponent);
|
||||
}
|
||||
}
|
||||
# Head
|
||||
for head in GolemHead.getHeads() {
|
||||
var components = head.components;
|
||||
for i in 0 to components.length {
|
||||
var component = components[i];
|
||||
if (component instanceof ItemStack && isStackValid(component as ItemStack)) {
|
||||
var stack as IItemStack = (component as ItemStack).wrapper;
|
||||
components[i] = Unifier.unifyPlates(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
# Leg
|
||||
for leg in GolemLeg.getLegs() {
|
||||
var components = leg.components;
|
||||
for i in 0 to components.length {
|
||||
var component = components[i];
|
||||
if (component instanceof ItemStack && isStackValid(component as ItemStack)) {
|
||||
var stack as IItemStack = (component as ItemStack).wrapper;
|
||||
components[i] = Unifier.unifyPlates(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isStackValid(stack as ItemStack) as bool {
|
||||
return !(isNull(stack) || stack.isEmpty());
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
#modloaded thaumcraft modtweaker
|
||||
#loader lateAddTC
|
||||
import native.com.blamejared.compat.thaumcraft.handlers.ThaumCraft;
|
||||
import native.com.blamejared.mtlib.helpers.InputHelper;
|
||||
import native.net.minecraft.util.ResourceLocation;
|
||||
import native.thaumcraft.api.ThaumcraftApi;
|
||||
import native.thaumcraft.api.ThaumcraftApiHelper;
|
||||
import native.thaumcraft.api.crafting.InfusionRecipe;
|
||||
|
||||
import crafttweaker.item.IIngredient;
|
||||
import crafttweaker.item.IItemStack;
|
||||
import thaumcraft.aspect.CTAspectStack;
|
||||
|
||||
/*
|
||||
Infusion recipes that REPLACE existing recipes tied to research. Removal is unnecssary, the recipes will be overwritten.
|
||||
This is to keep the recipe available in the research page.
|
||||
*/
|
||||
var tcAdditions = "thaumadditions";
|
||||
var tcTinkerer = "thaumictinkerer";
|
||||
var tcGado = "gadothaumy";
|
||||
|
||||
|
||||
# Fix crystal crusher in JEI
|
||||
registerInfusionRecipeFromAddon(`${tcAdditions}:crystal_crusher`, "TAR_CRYSTAL_CRUSHER",
|
||||
<thaumadditions:crystal_crusher>, 3,
|
||||
[
|
||||
<aspect:fabrico> * 20, <aspect:exitium> * 20, <aspect:instrumentum> * 20
|
||||
],
|
||||
<thaumcraft:mechanism_complex>,
|
||||
[
|
||||
makeCrystal(<aspect:aer>), makeCrystal(<aspect:terra>), makeCrystal(<aspect:ignis>),
|
||||
makeCrystal(<aspect:aqua>), makeCrystal(<aspect:ordo>), makeCrystal(<aspect:perditio>),
|
||||
<thaumcraft:plate:2>, <thaumcraft:plate:2>, <thaumcraft:plate:2>,
|
||||
<thaumcraft:slab_arcane_stone>, <thaumcraft:slab_arcane_stone>, <thaumcraft:slab_arcane_stone>,
|
||||
<thaumadditions:salt_essence>.withTag({Aspects: [{amount: 1, key: "praemunio"}]}), <thaumadditions:salt_essence>.withTag({Aspects: [{amount: 1, key: "praemunio"}]})
|
||||
]
|
||||
);
|
||||
|
||||
# Unify brass plates
|
||||
registerInfusionRecipeFromAddon(`${tcAdditions}:crystal_bore`, "TAR_CRYSTAL_BORE",
|
||||
<thaumadditions:crystal_bore>, 5,
|
||||
[
|
||||
<aspect:exitium> * 20, <aspect:terra> * 10, <aspect:perditio> * 30
|
||||
],
|
||||
<thaumcraft:morphic_resonator>,
|
||||
[
|
||||
<thaumcraft:stone_arcane>, <techreborn:plates:18>, <thaumcraft:stone_arcane>,
|
||||
<techreborn:plates:18>, <thaumcraft:stone_arcane>, <thaumcraft:mechanism_complex>
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# infusion claw
|
||||
registerInfusionRecipeFromAddon(`${tcGado}:infusion_claw`, "INFUSION_CLAW",
|
||||
<gadothaumy:infusion_claw>, 32,
|
||||
[
|
||||
<aspect:alienis> * 120, <aspect:machina> * 70, <aspect:ordo> * 70,
|
||||
<aspect:praecantatio> * 60, <aspect:tenebrae> * 40
|
||||
],
|
||||
<thaumcraft:stabilizer>,
|
||||
[
|
||||
<thaumcraft:brain>, <thaumcraft:stone_arcane>,
|
||||
<thaumadditions:adaminite_ingot>, <thaumcraft:stone_arcane>,
|
||||
<thaumcraft:caster_basic>, <thaumcraft:stone_arcane>,
|
||||
<thaumadditions:adaminite_ingot>, <thaumcraft:stone_arcane>
|
||||
]
|
||||
);
|
||||
# KAMI armor
|
||||
registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_helm`, "TT_KAMIHELM",
|
||||
<thaumictinkerer:kami_helm>, 32,
|
||||
[
|
||||
<aspect:aqua> * 150, <aspect:auram> * 125, <aspect:cognitio> * 125,
|
||||
<aspect:victus> * 60, <aspect:lux> * 250, <aspect:praemunio> * 125
|
||||
],
|
||||
<thaumictinkerer:ichor_helm>,
|
||||
[
|
||||
<thaumadditions:mithrillium_ingot>, <thaumadditions:mithrillium_ingot>, <thaumictinkerer:kamiresource:2>,
|
||||
<thaumictinkerer:kamiresource:2>, <minecraft:chorus_fruit_popped>, <minecraft:golden_helmet>,
|
||||
<minecraft:potion>.withTag({Potion: "minecraft:night_vision"}), <thaumcraft:goggles>, <minecraft:ghast_tear>,
|
||||
<minecraft:fish>, <minecraft:cake>, <minecraft:ender_eye>
|
||||
]
|
||||
);
|
||||
registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_chest`, "TT_KAMICHEST",
|
||||
<thaumictinkerer:kami_chest>, 32,
|
||||
[
|
||||
<aspect:aer> * 150, <aspect:praemunio> * 125, <aspect:volatus> * 125,
|
||||
<aspect:ordo> * 125, <aspect:lux> * 250, <aspect:alienis> * 60
|
||||
],
|
||||
<thaumictinkerer:ichor_chest>,
|
||||
[
|
||||
<thaumadditions:mithrillium_ingot>, <thaumadditions:mithrillium_ingot>, <thaumictinkerer:kamiresource:2>,
|
||||
<thaumictinkerer:kamiresource:2>, <minecraft:chorus_fruit_popped>, <minecraft:golden_chestplate>,
|
||||
<thaumcraft:cloud_ring>, <minecraft:elytra>, <minecraft:shield>,
|
||||
<minecraft:feather>, <minecraft:ghast_tear>, <minecraft:arrow>
|
||||
]
|
||||
);
|
||||
registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_legs`, "TT_KAMILEGS",
|
||||
<thaumictinkerer:kami_legs>, 32,
|
||||
[
|
||||
<aspect:aer> * 150, <aspect:praemunio> * 125, <aspect:volatus> * 125,
|
||||
<aspect:ordo> * 125, <aspect:lux> * 250, <aspect:alienis> * 60
|
||||
],
|
||||
<thaumictinkerer:ichor_legs>,
|
||||
[
|
||||
<thaumadditions:mithrillium_ingot>, <thaumadditions:mithrillium_ingot>, <thaumictinkerer:kamiresource:2>,
|
||||
<thaumictinkerer:kamiresource:2>, <minecraft:chorus_fruit_popped>, <minecraft:golden_leggings>,
|
||||
<minecraft:potion>.withTag({Potion: "minecraft:fire_resistance"}), <thaumictinkerer:energetic_nitor>, <thaumcraft:lamp_arcane>,
|
||||
<minecraft:lava_bucket>, <minecraft:fire_charge>, <minecraft:blaze_rod>
|
||||
]
|
||||
);
|
||||
registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_boots`, "TT_KAMIBOOTS",
|
||||
<thaumictinkerer:kami_boots>, 32,
|
||||
[
|
||||
<aspect:terra> * 150, <aspect:praemunio> * 125, <aspect:instrumentum> * 125,
|
||||
<aspect:motus> * 125, <aspect:lux> * 250, <aspect:herba> * 60,
|
||||
<aspect:volatus> * 60
|
||||
],
|
||||
<thaumictinkerer:ichor_boots>,
|
||||
[
|
||||
<thaumadditions:mithrillium_ingot>, <thaumadditions:mithrillium_ingot>, <thaumictinkerer:kamiresource:2>,
|
||||
<thaumictinkerer:kamiresource:2>, <minecraft:chorus_fruit_popped>, <minecraft:golden_boots>,
|
||||
<minecraft:grass>, <minecraft:wheat_seeds>, <thaumcraft:lamp_growth>,
|
||||
<thaumcraft:turret:2>, <minecraft:wool:0>, <minecraft:lead>
|
||||
]
|
||||
);
|
||||
|
||||
/*
|
||||
The same as Infusion.registerRecipe(), but allows a namespace in the resource location.
|
||||
ModTweaker only allows infusion recipes with the "thaumcraft" namespace, this allows any namespace.
|
||||
*/
|
||||
function registerInfusionRecipeFromAddon(resourceLocation as string, research as string, output as IItemStack, instability as int,
|
||||
aspects as CTAspectStack[], centralItem as IIngredient, recipe as IIngredient[]) {
|
||||
var infusionRecipe = InfusionRecipe(
|
||||
research, output.native, instability,
|
||||
ThaumCraft.getAspects(aspects), centralItem.native, InputHelper.toObjects(recipe)
|
||||
);
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(ResourceLocation(resourceLocation), infusionRecipe);
|
||||
}
|
||||
|
||||
function makeCrystal(aspect as CTAspectStack) as IItemStack {
|
||||
return ThaumcraftApiHelper.makeCrystal(ThaumCraft.getAspect(aspect)).wrapper;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
#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;
|
||||
|
||||
import scripts.thaumcraft.Unifier;
|
||||
|
||||
/*
|
||||
Hard-coded, non-JSON, research pages to edit.
|
||||
- Replaces crafting requirements for consume requirements.
|
||||
This is so we can make these ingredients obtainable through non-crafting recipes,
|
||||
but still make associated research completable.
|
||||
- Unifies plates from rewards.
|
||||
|
||||
See config/thaumcraftfix/patches for research page changes that are JSON-based.
|
||||
*/
|
||||
|
||||
# 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);
|
||||
|
||||
# TC plate unification
|
||||
convertRewardItems("TAR_CRYSTAL_CRUSHER", Unifier.unifiedPlates);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
function convertRewardItems(researchName as string, itemsToReplace as IItemStack[IItemStack]) {
|
||||
var rewards = ResearchCategories.getResearch(researchName).getRewardItem();
|
||||
for i in 0 to rewards.length {
|
||||
var reward = rewards[i];
|
||||
rewards[i] = Unifier.unifyStack(reward, itemsToReplace);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user