diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..85e7c1df --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea/ diff --git a/config/ZenUtils.cfg b/config/ZenUtils.cfg index f5393897..2416aa02 100644 --- a/config/ZenUtils.cfg +++ b/config/ZenUtils.cfg @@ -1,8 +1,27 @@ # Configuration file general { + # Allow insertion of zs execution during mod loading stage + # Format: scriptLoaderName;modid;stageMarker;before|after + # Valid stage marker: C (Construction) H (Preinit) I (Init) J (Postinit) A (Available) + # Example: custom;mekanism;J;before -> runs `#loader custom` scripts before mekanism runs its code on post-initialization stage + # Note: + # 1. On construction stage and preinit stage before crafttweaker, only native methods are available + # 2. Many recipe modifications are staged. For example, scripts are loaded on init, but recipe modifications for crafting table and furnace are staged on postinit + # It means recipe modifications MAY NOT be executed after their loading stage + # ZenUtils will re-execute crafttweaker recipe modifications after all custom script load entrypoint on POSTINIT, but other crafttweaker addons not + S:customScriptEntrypoint < + lateAddTC;modtweaker;A;after + > + + # Enable mixinzs. Default: false B:enableMixin=true + + # Enable RandomTickEvent. It patches hotspot random tick code, which may produce performance loss. Do not enable it if you don't need it. Default: false B:enableRandomTickEvent=false + + # Enable fast script loading. Note: If enabled, ONLY PREPROCESSORS AT SCRIPT HEADER ARE EFFECTIVE. (except mixin scripts) Default: false + B:fastScriptLoading=false } diff --git a/scripts/ThaumcraftGating.zs b/scripts/ThaumcraftGating.zs index 7f627614..78ad8c5c 100644 --- a/scripts/ThaumcraftGating.zs +++ b/scripts/ThaumcraftGating.zs @@ -108,53 +108,6 @@ mods.thaumcraft.Infusion.registerRecipe("infuseshimmerleaf", "", , [, , , ]); - -mods.thaumcraft.Infusion.removeRecipe(); - -mods.thaumcraft.Infusion.registerRecipe("infkamichest", "", -, 10, -[*250,*150,*125,*125,*125,*60], -, -[, , - , , - , , - , , - , , - , ]); - -mods.thaumcraft.Infusion.registerRecipe("infkamiboots", "", -, 10, -[*250,*150,*125,*125,*125,*60], -, -[, , - , , - , , - , , - , , - , ]); - - mods.thaumcraft.Infusion.registerRecipe("infkamilegs", "", -, 10, -[*250,*150,*125,*125,*125,*60], -, -[, , - , , - , , - .withTag({Potion: "minecraft:fire_resistance"}), , - , , - , ]); - - mods.thaumcraft.Infusion.registerRecipe("infkamihelm", "", -, 10, -[*250,*150,*125,*125,*125,*60], -, -[, , - , , - , , - .withTag({Potion: "minecraft:night_vision"}), , - , , - , ]); - recipes.addShaped(, [[null, , null], [, , ], diff --git a/scripts/thaumcraft/infusion/LateInfusionRecipes.zs b/scripts/thaumcraft/infusion/LateInfusionRecipes.zs new file mode 100644 index 00000000..bc69273f --- /dev/null +++ b/scripts/thaumcraft/infusion/LateInfusionRecipes.zs @@ -0,0 +1,110 @@ +#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"; +# KAMI armor +registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_helm`, "TT_KAMIHELM", + , 32, + [ + * 150, * 125, * 125, + * 60, * 250, * 125 + ], + , + [ + , , , + , , , + .withTag({Potion: "minecraft:night_vision"}), , , + , , + ] +); +registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_chest`, "TT_KAMICHEST", + , 32, + [ + * 150, * 125, * 125, + * 125, * 250, * 60 + ], + , + [ + , , , + , , , + , , , + , , + ] +); +registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_legs`, "TT_KAMILEGS", + , 32, + [ + * 150, * 125, * 125, + * 125, * 250, * 60 + ], + , + [ + , , , + , , , + .withTag({Potion: "minecraft:fire_resistance"}), , , + , , + ] +); +registerInfusionRecipeFromAddon(`${tcTinkerer}:kami_boots`, "TT_KAMIBOOTS", + , 32, + [ + * 150, * 125, * 125, + * 125, * 250, * 60, + * 60 + ], + , + [ + , , , + , , , + , , , + , , + ] +); + +# Fix crystal crusher in JEI +registerInfusionRecipeFromAddon(`${tcAdditions}:crystal_crusher`, "TAR_CRYSTAL_CRUSHER", + , 3, + [ + * 20, * 20, * 20 + ], + , + [ + makeCrystal(), makeCrystal(), makeCrystal(), + makeCrystal(), makeCrystal(), makeCrystal(), + , , , + , , , + .withTag({Aspects: [{amount: 1, key: "praemunio"}]}), .withTag({Aspects: [{amount: 1, key: "praemunio"}]}) + ] +); + +/* + 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; +} \ No newline at end of file