├── .github └── FUNDING.yml ├── .gitignore ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.MD ├── Jenkinsfile ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libs ├── Thaumcraft-1.12.2-6.1.BETA26-deobf.jar ├── extrautils2-1.12-1.9.2.jar └── immersivetech-1.12-1.3.10.jar ├── src └── main │ ├── java │ └── com │ │ └── blamejared │ │ ├── ModTweaker.java │ │ ├── api │ │ └── annotations │ │ │ └── Handler.java │ │ ├── compat │ │ ├── actuallyaddition │ │ │ ├── AtomicReconstructor.java │ │ │ ├── BallOfFur.java │ │ │ ├── Compost.java │ │ │ ├── Crusher.java │ │ │ ├── Empowerer.java │ │ │ ├── MiningLens.java │ │ │ ├── OilGen.java │ │ │ └── TreasureChest.java │ │ ├── betterwithmods │ │ │ ├── Anvil.java │ │ │ ├── Bellows.java │ │ │ ├── Buoyancy.java │ │ │ ├── Cauldron.java │ │ │ ├── Crucible.java │ │ │ ├── HeatRegistry.java │ │ │ ├── Hopper.java │ │ │ ├── Kiln.java │ │ │ ├── Mill.java │ │ │ ├── MiniBlocks.java │ │ │ ├── Misc.java │ │ │ ├── Movement.java │ │ │ ├── PulleyManager.java │ │ │ ├── Saw.java │ │ │ ├── StokedCauldron.java │ │ │ ├── StokedCrucible.java │ │ │ ├── Turntable.java │ │ │ └── base │ │ │ │ ├── RemoveAll.java │ │ │ │ ├── blockrecipes │ │ │ │ ├── BlockRecipeAdd.java │ │ │ │ ├── BlockRecipeBuilder.java │ │ │ │ ├── BlockRecipeRemove.java │ │ │ │ ├── BlockRecipeRemoveInput.java │ │ │ │ ├── KilnBuilder.java │ │ │ │ ├── SawBuilder.java │ │ │ │ └── TurntableBuilder.java │ │ │ │ └── bulkrecipes │ │ │ │ ├── BulkRecipeAdd.java │ │ │ │ ├── BulkRecipeBuilder.java │ │ │ │ ├── BulkRecipeRemove.java │ │ │ │ ├── CookingPotBuilder.java │ │ │ │ └── MillBuilder.java │ │ ├── bloodmagic │ │ │ ├── AlchemyArray.java │ │ │ ├── AlchemyTable.java │ │ │ ├── BloodAltar.java │ │ │ └── TartaricForge.java │ │ ├── botania │ │ │ ├── Botania.java │ │ │ ├── BotaniaHelper.java │ │ │ ├── LocalizationHelper.java │ │ │ ├── commands │ │ │ │ ├── BotaniaBrewLogger.java │ │ │ │ ├── BotaniaLogger.java │ │ │ │ └── BotaniaOrechidLogger.java │ │ │ ├── handlers │ │ │ │ ├── Apothecary.java │ │ │ │ ├── Brew.java │ │ │ │ ├── ElvenTrade.java │ │ │ │ ├── Knowledge.java │ │ │ │ ├── Lexicon.java │ │ │ │ ├── ManaInfusion.java │ │ │ │ ├── Orechid.java │ │ │ │ ├── OrechidIgnem.java │ │ │ │ ├── PureDaisy.java │ │ │ │ └── RuneAltar.java │ │ │ └── lexicon │ │ │ │ ├── AddCategory.java │ │ │ │ ├── AddEntry.java │ │ │ │ ├── AddRecipeMapping.java │ │ │ │ ├── RemoveCategory.java │ │ │ │ ├── RemoveEntry.java │ │ │ │ ├── RemovePage.java │ │ │ │ ├── RemoveRecipeMapping.java │ │ │ │ ├── SetCategoryIcon.java │ │ │ │ ├── SetCategoryPriority.java │ │ │ │ ├── SetEntryKnowledgeType.java │ │ │ │ ├── UsefulEntry.java │ │ │ │ ├── commands │ │ │ │ ├── LexiconCategoryLogger.java │ │ │ │ ├── LexiconEntryLogger.java │ │ │ │ ├── LexiconKnowledgeTypesLogger.java │ │ │ │ └── LexiconPageLogger.java │ │ │ │ └── pages │ │ │ │ ├── AddPageAlchemy.java │ │ │ │ ├── AddPageBrew.java │ │ │ │ ├── AddPageConjuration.java │ │ │ │ ├── AddPageCrafting.java │ │ │ │ ├── AddPageElven.java │ │ │ │ ├── AddPageEntity.java │ │ │ │ ├── AddPageImage.java │ │ │ │ ├── AddPageInfusion.java │ │ │ │ ├── AddPageLore.java │ │ │ │ ├── AddPagePetal.java │ │ │ │ ├── AddPageRune.java │ │ │ │ └── AddPageText.java │ │ ├── chisel │ │ │ ├── Carving.java │ │ │ └── Chisel.java │ │ ├── extrautils2 │ │ │ ├── Crusher.java │ │ │ └── Resonator.java │ │ ├── forestry │ │ │ ├── Carpenter.java │ │ │ ├── Centrifuge.java │ │ │ ├── CharcoalPile.java │ │ │ ├── Fermenter.java │ │ │ ├── Moistener.java │ │ │ ├── Squeezer.java │ │ │ ├── Still.java │ │ │ └── ThermionicFabricator.java │ │ ├── immersivetech │ │ │ ├── Boiler.java │ │ │ ├── Distiller.java │ │ │ ├── SolarTower.java │ │ │ └── SteamTurbine.java │ │ ├── inspirations │ │ │ ├── Cauldron.java │ │ │ └── Inspirations.java │ │ ├── mantle │ │ │ └── RecipeMatchIIngredient.java │ │ ├── refinedstorage │ │ │ └── Solderer.java │ │ ├── tcomplement │ │ │ ├── Blacklist.java │ │ │ ├── Overrides.java │ │ │ └── highoven │ │ │ │ ├── HighOven.java │ │ │ │ ├── MixRecipeBuilder.java │ │ │ │ ├── MixRecipeManager.java │ │ │ │ └── recipes │ │ │ │ ├── HeatRecipeTweaker.java │ │ │ │ ├── HighOvenFuelTweaker.java │ │ │ │ └── MixRecipeTweaker.java │ │ ├── tconstruct │ │ │ ├── Alloy.java │ │ │ ├── Casting.java │ │ │ ├── Drying.java │ │ │ ├── Fuel.java │ │ │ ├── Melting.java │ │ │ ├── TConstruct.java │ │ │ ├── actions │ │ │ │ ├── SetAttackAction.java │ │ │ │ ├── SetBowBonusDamageAction.java │ │ │ │ ├── SetBowRangeAction.java │ │ │ │ ├── SetDrawSpeedAction.java │ │ │ │ ├── SetDurabilityAction.java │ │ │ │ ├── SetHarvestLevelAction.java │ │ │ │ ├── SetMiningSpeedAction.java │ │ │ │ └── SetModifierAction.java │ │ │ ├── brackets │ │ │ │ └── MaterialBracketHandler.java │ │ │ ├── materials │ │ │ │ ├── ITICMaterial.java │ │ │ │ ├── ITICMaterialDefinition.java │ │ │ │ ├── TICMaterial.java │ │ │ │ └── TICMaterialDefinition.java │ │ │ └── recipes │ │ │ │ ├── AlloyRecipeTweaker.java │ │ │ │ ├── CastingRecipeTweaker.java │ │ │ │ ├── DryingRecipeTweaker.java │ │ │ │ └── MeltingRecipeTweaker.java │ │ ├── thaumcraft │ │ │ └── handlers │ │ │ │ ├── ThaumCraft.java │ │ │ │ ├── aspects │ │ │ │ ├── CTAspect.java │ │ │ │ └── CTAspectStack.java │ │ │ │ ├── brackets │ │ │ │ └── BracketHandlerAspect.java │ │ │ │ ├── expand │ │ │ │ ├── IEntityAspectExpansion.java │ │ │ │ └── IItemAspectExpansion.java │ │ │ │ └── handlers │ │ │ │ ├── ArcaneWorkbench.java │ │ │ │ ├── Crucible.java │ │ │ │ ├── DustTrigger.java │ │ │ │ ├── Infusion.java │ │ │ │ ├── LootBag.java │ │ │ │ ├── SmeltingBonus.java │ │ │ │ └── Warp.java │ │ └── thermalexpansion │ │ │ ├── Centrifuge.java │ │ │ ├── Compactor.java │ │ │ ├── Crucible.java │ │ │ ├── Enchanter.java │ │ │ ├── Imbuer.java │ │ │ ├── InductionSmelter.java │ │ │ ├── Infuser.java │ │ │ ├── Insolator.java │ │ │ ├── Pulverizer.java │ │ │ ├── RedstoneFurnace.java │ │ │ ├── Refinery.java │ │ │ ├── SawMill.java │ │ │ ├── Transposer.java │ │ │ ├── devicemanagers │ │ │ ├── Coolant.java │ │ │ └── Factorizer.java │ │ │ └── dynamos │ │ │ ├── CompressionDynamo.java │ │ │ ├── EnervationDynamo.java │ │ │ ├── MagmaticDynamo.java │ │ │ ├── NumisticDynamo.java │ │ │ ├── ReactantDynamo.java │ │ │ └── SteamDynamo.java │ │ └── reference │ │ └── Reference.java │ └── resources │ ├── mcmod.info │ └── pack.mcmeta └── test_scripts ├── README.md ├── botania.zs ├── bwm.zs ├── high_oven.zs ├── immersivetech.zs ├── inspirations.zs └── thaumcraft.zs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: Jaredlll08 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | custom: # Replace with a single custom sponsorship URL 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /.vscode 3 | # Forge 4 | /LICENSE-fml.txt 5 | /MinecraftForge-Credits.txt 6 | /MinecraftForge-License.txt 7 | /README.txt 8 | /CREDITS-fml.txt 9 | /forge-1.7.2* 10 | /logs/* 11 | /config/* 12 | /configs/* 13 | /asm/* 14 | /saves/* 15 | /usernamecache.json 16 | /options.txt 17 | /minetweaker.log 18 | /BotaniaVars.dat 19 | /.analytics/* 20 | /crash-reports/ 21 | /scripts/* 22 | 23 | /bin/* 24 | 25 | # Modproject 26 | /src/api/resources/* 27 | /mods/* 28 | 29 | # Gradle 30 | /.gradle 31 | /build 32 | /classes/ 33 | # Eclipse 34 | /.classpath 35 | /.project 36 | /.settings 37 | /bin 38 | /eclipse/* 39 | /.metadata 40 | 41 | # IntelliJ IDEA 42 | /*.iml 43 | /*.ipr 44 | /*.iws 45 | /.idea 46 | /out 47 | 48 | # Debugging 49 | /run 50 | 51 | # OS X 52 | .DS_Store 53 | 54 | # other 55 | /.nb-gradle/private/ 56 | /common 57 | 58 | *.launch 59 | 60 | libs/Thaumcraft-1.12.2-6.1.BETA26-api.zip 61 | 62 | secrets.json 63 | 64 | changelog.md 65 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.MD: -------------------------------------------------------------------------------- 1 | #### Issue Description: 2 | Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If you are using an unnofficial version of Minetweaker or Crafttweaker or ModTweaker please report it to the person who gave you the version. Also please look at the other issues to make sure that you are not creating a duplicate. 3 | 4 | 5 | #### What happens: 6 | 7 | 8 | 9 | #### What you expected to happen: 10 | 11 | 12 | 13 | #### Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue): 14 | 15 | 16 | 17 | #### Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue): 18 | 19 | 20 | ____ 21 | #### Affected Versions (Do *not* use "latest"): 22 | 23 | - Minecraft: 24 | - Forge: 25 | - Crafttweaker: 26 | - ModTweaker: 27 | - MTLib: 28 | 29 | #### Your most recent log file where the issue was present: 30 | 31 | [pastebin/gist/etc link here] 32 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy 2 | 3 | pipeline { 4 | agent any 5 | tools { 6 | jdk "jdk8u292-b10" 7 | } 8 | stages { 9 | stage('Clean') { 10 | steps { 11 | withCredentials([file(credentialsId: 'mod_build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')]) { 12 | echo 'Cleaning Project' 13 | sh 'chmod +x gradlew' 14 | sh './gradlew clean --stacktrace --debug' 15 | } 16 | } 17 | } 18 | stage('Setup') { 19 | steps { 20 | withCredentials([file(credentialsId: 'mod_build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')]) { 21 | echo 'Setting up Workspace' 22 | sh './gradlew setupDecompWorkspace' 23 | } 24 | } 25 | } 26 | stage('Build') { 27 | steps { 28 | withCredentials([file(credentialsId: 'mod_build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')]) { 29 | echo 'Building' 30 | sh './gradlew build' 31 | } 32 | } 33 | } 34 | stage('Git Changelog') { 35 | steps { 36 | withCredentials([file(credentialsId: 'mod_build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')]) { 37 | sh './gradlew genGitChangelog' 38 | } 39 | } 40 | } 41 | stage('Publish') { 42 | steps { 43 | withCredentials([file(credentialsId: 'mod_build_secrets', variable: 'ORG_GRADLE_PROJECT_secretFile')]) { 44 | echo 'Deploying to CurseForge' 45 | sh './gradlew curseforge' 46 | } 47 | } 48 | } 49 | } 50 | post { 51 | always { 52 | archive 'build/libs/**.jar' 53 | archive 'changelog.md' 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jaredlll08 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ModTweaker2 2 | ========== 3 | ModTweaker is an addon for MineTweaker 3. Minetweaker lets you adjust recipes, remove them entirely, or add new recipes. While it has decent mod support, there are many mods that use custom crafting handlers that are not supported natively. ModTweaker plans to provide additional support for as many of these mods over time as possible. 4 | 5 | 6 | Stable Releases on Curse 7 | ---------- 8 | https://minecraft.curseforge.com/projects/modtweaker 9 | 10 | Development build on jenkins 11 | ---------- 12 | http://ci.blamejared.com/job/Modtweaker/ 13 | 14 | 15 | Guidelines for Bugreporting 16 | ---------- 17 | https://github.com/jaredlll08/ModTweaker2/wiki/Bug-Reporting-Guidelines 18 | 19 | 20 | Supported Mods 21 | ---------- 22 | - Actually Additions 23 | - Applied Energistics 2 24 | - Auracascade 25 | - Blood Magic 26 | - Botania 27 | - Chisel 28 | - ExNihilo 29 | - ExtendedWorkbench 30 | - Factorization (0.8.95+) 31 | - Forestry (3.6.0+) 32 | - Flaxbeard's Steam Power 33 | - Mariculture 34 | - Mekanism 8 35 | - Metallurgy 36 | - PneumaticCraft 37 | - Railcraft 38 | - Tinkers Construct 39 | - Terrafirmacraft 40 | - Thaumcraft 41 | - Thermal Expansion 42 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredlll08/ModTweaker/8ba1b84d2b977718f626d785dc4cf5883f646b40/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 19 20:45:41 CDT 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /libs/Thaumcraft-1.12.2-6.1.BETA26-deobf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredlll08/ModTweaker/8ba1b84d2b977718f626d785dc4cf5883f646b40/libs/Thaumcraft-1.12.2-6.1.BETA26-deobf.jar -------------------------------------------------------------------------------- /libs/extrautils2-1.12-1.9.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredlll08/ModTweaker/8ba1b84d2b977718f626d785dc4cf5883f646b40/libs/extrautils2-1.12-1.9.2.jar -------------------------------------------------------------------------------- /libs/immersivetech-1.12-1.3.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jaredlll08/ModTweaker/8ba1b84d2b977718f626d785dc4cf5883f646b40/libs/immersivetech-1.12-1.3.10.jar -------------------------------------------------------------------------------- /src/main/java/com/blamejared/ModTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared; 2 | 3 | import com.blamejared.compat.botania.Botania; 4 | import com.blamejared.compat.chisel.Chisel; 5 | import com.blamejared.compat.inspirations.Inspirations; 6 | import com.blamejared.compat.tconstruct.TConstruct; 7 | import com.blamejared.compat.thaumcraft.handlers.ThaumCraft; 8 | import crafttweaker.*; 9 | import net.minecraftforge.fml.common.*; 10 | import net.minecraftforge.fml.common.event.*; 11 | 12 | import java.util.*; 13 | 14 | import static com.blamejared.reference.Reference.*; 15 | 16 | @Mod(modid = MODID, name = NAME, version = VERSION, dependencies = DEPENDENCIES) 17 | public class ModTweaker { 18 | 19 | public static final List LATE_REMOVALS = new LinkedList<>(); 20 | public static final List LATE_ADDITIONS = new LinkedList<>(); 21 | 22 | 23 | @Mod.EventHandler 24 | public void preInit(FMLPreInitializationEvent e) { 25 | if(Loader.isModLoaded("thaumcraft")) { 26 | ThaumCraft.preInit(); 27 | } 28 | } 29 | 30 | @Mod.EventHandler 31 | public void init(FMLInitializationEvent e) { 32 | } 33 | 34 | @Mod.EventHandler 35 | public void postInit(FMLPostInitializationEvent e) { 36 | } 37 | 38 | @Mod.EventHandler 39 | public void loadComplete(FMLLoadCompleteEvent event) { 40 | try { 41 | LATE_REMOVALS.forEach(CraftTweakerAPI::apply); 42 | LATE_ADDITIONS.forEach(CraftTweakerAPI::apply); 43 | } catch(Exception e) { 44 | e.printStackTrace(); 45 | CraftTweakerAPI.logError("Error while applying actions", e); 46 | } 47 | LATE_REMOVALS.clear(); 48 | LATE_ADDITIONS.clear(); 49 | } 50 | 51 | @Mod.EventHandler 52 | public void onFMLServerStarting(FMLServerStartingEvent event) { 53 | if(Loader.isModLoaded("tconstruct")) { 54 | TConstruct.registerCommands(); 55 | } 56 | if(Loader.isModLoaded("botania")) { 57 | Botania.registerCommands(); 58 | } 59 | if(Loader.isModLoaded("chisel")) { 60 | Chisel.registerCommands(); 61 | } 62 | if(Loader.isModLoaded("inspirations")) { 63 | Inspirations.registerCommands(); 64 | } 65 | 66 | if(Loader.isModLoaded("thaumcraft")) { 67 | ThaumCraft.registerCommands(); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/api/annotations/Handler.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.api.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.TYPE) 10 | public @interface Handler { 11 | String value(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/actuallyaddition/AtomicReconstructor.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.actuallyaddition; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.*; 5 | import com.blamejared.mtlib.utils.*; 6 | import crafttweaker.annotations.*; 7 | import crafttweaker.api.item.IIngredient; 8 | import crafttweaker.api.item.IItemStack; 9 | import crafttweaker.api.minecraft.CraftTweakerMC; 10 | import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; 11 | import de.ellpeck.actuallyadditions.api.recipe.LensConversionRecipe; 12 | import stanhebben.zenscript.annotations.*; 13 | 14 | import java.util.*; 15 | 16 | @ZenClass("mods.actuallyadditions.AtomicReconstructor") 17 | @ModOnly("actuallyadditions") 18 | @ZenRegister 19 | public class AtomicReconstructor { 20 | 21 | @ZenMethod 22 | public static void addRecipe(IItemStack output, IIngredient input, int energyUsed) { 23 | ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new LensConversionRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), energyUsed, ActuallyAdditionsAPI.lensDefaultConversion)))); 24 | } 25 | 26 | @ZenMethod 27 | public static void removeRecipe(IItemStack output) { 28 | ModTweaker.LATE_ADDITIONS.add(new Remove(output)); 29 | } 30 | 31 | private static class Add extends BaseListAddition { 32 | 33 | protected Add(List recipies) { 34 | super("Atomic Reconstructor", ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES, recipies); 35 | } 36 | 37 | @Override 38 | protected String getRecipeInfo(LensConversionRecipe recipe) { 39 | return LogHelper.getStackDescription(recipe.getOutput()); 40 | } 41 | 42 | } 43 | 44 | private static class Remove extends BaseListRemoval { 45 | 46 | private IItemStack output; 47 | 48 | protected Remove(IItemStack output) { 49 | super("Atomic Reconstructor", ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES); 50 | this.output = output; 51 | } 52 | 53 | @Override 54 | public void apply() { 55 | ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES.stream().filter(recipe -> output.matches(InputHelper.toIItemStack(recipe.getOutput()))).forEach(recipes::add); 56 | super.apply(); 57 | } 58 | 59 | @Override 60 | protected String getRecipeInfo(LensConversionRecipe recipe) { 61 | return LogHelper.getStackDescription(recipe.getOutput()); 62 | } 63 | 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/actuallyaddition/BallOfFur.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.actuallyaddition; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.InputHelper; 5 | import com.blamejared.mtlib.helpers.LogHelper; 6 | import com.blamejared.mtlib.utils.BaseListAddition; 7 | import com.blamejared.mtlib.utils.BaseListRemoval; 8 | import crafttweaker.annotations.ModOnly; 9 | import crafttweaker.annotations.ZenRegister; 10 | import crafttweaker.api.item.IItemStack; 11 | import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; 12 | import de.ellpeck.actuallyadditions.api.recipe.BallOfFurReturn; 13 | import stanhebben.zenscript.annotations.ZenClass; 14 | import stanhebben.zenscript.annotations.ZenMethod; 15 | 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | @ZenClass("mods.actuallyadditions.BallOfFur") 20 | @ModOnly("actuallyadditions") 21 | @ZenRegister 22 | public class BallOfFur { 23 | 24 | @ZenMethod 25 | public static void addReturn(IItemStack output, int chance) { 26 | ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new BallOfFurReturn(InputHelper.toStack(output), chance)))); 27 | } 28 | 29 | @ZenMethod 30 | public static void removeReturn(IItemStack output) { 31 | ModTweaker.LATE_ADDITIONS.add(new Remove(output)); 32 | } 33 | 34 | private static class Add extends BaseListAddition { 35 | 36 | protected Add(List recipes) { 37 | super("BallOfFur", ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS, recipes); 38 | } 39 | 40 | @Override 41 | protected String getRecipeInfo(BallOfFurReturn recipe) { 42 | return LogHelper.getStackDescription(recipe.returnItem); 43 | } 44 | } 45 | 46 | private static class Remove extends BaseListRemoval { 47 | 48 | private IItemStack output; 49 | 50 | public Remove(IItemStack output) { 51 | super("BallOfFur", ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS); 52 | this.output = output; 53 | } 54 | 55 | @Override 56 | public void apply() { 57 | for(BallOfFurReturn recipe : ActuallyAdditionsAPI.BALL_OF_FUR_RETURN_ITEMS) { 58 | if(output.matches(InputHelper.toIItemStack(recipe.returnItem))) { 59 | recipes.add(recipe); 60 | } 61 | } 62 | super.apply(); 63 | } 64 | 65 | @Override 66 | protected String getRecipeInfo(BallOfFurReturn recipe) { 67 | return LogHelper.getStackDescription(recipe.returnItem); 68 | } 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/actuallyaddition/Crusher.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.actuallyaddition; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.*; 5 | import com.blamejared.mtlib.utils.*; 6 | import crafttweaker.annotations.*; 7 | import crafttweaker.api.item.IIngredient; 8 | import crafttweaker.api.item.IItemStack; 9 | import crafttweaker.api.minecraft.CraftTweakerMC; 10 | import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; 11 | import de.ellpeck.actuallyadditions.api.recipe.CrusherRecipe; 12 | import stanhebben.zenscript.annotations.Optional; 13 | import stanhebben.zenscript.annotations.*; 14 | 15 | import java.util.*; 16 | 17 | @ZenClass("mods.actuallyadditions.Crusher") 18 | @ModOnly("actuallyadditions") 19 | @ZenRegister 20 | public class Crusher { 21 | 22 | @ZenMethod 23 | public static void addRecipe(IItemStack output, IIngredient input, @Optional IItemStack outputSecondary, @Optional int outputSecondaryChance) { 24 | ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new CrusherRecipe(CraftTweakerMC.getIngredient(input), InputHelper.toStack(output), InputHelper.toStack(outputSecondary), outputSecondaryChance)))); 25 | } 26 | 27 | @ZenMethod 28 | public static void removeRecipe(IItemStack output) { 29 | ModTweaker.LATE_REMOVALS.add(new Remove(output)); 30 | } 31 | 32 | private static class Add extends BaseListAddition { 33 | 34 | protected Add(List recipes) { 35 | super("Crusher", ActuallyAdditionsAPI.CRUSHER_RECIPES, recipes); 36 | } 37 | 38 | @Override 39 | public String getRecipeInfo(CrusherRecipe recipe) { 40 | return LogHelper.getStackDescription(recipe.getInput()); 41 | } 42 | 43 | } 44 | 45 | private static class Remove extends BaseListRemoval { 46 | 47 | private IItemStack output; 48 | 49 | protected Remove(IItemStack output) { 50 | super("Crusher", ActuallyAdditionsAPI.CRUSHER_RECIPES); 51 | this.output = output; 52 | } 53 | 54 | @Override 55 | public void apply() { 56 | ActuallyAdditionsAPI.CRUSHER_RECIPES.forEach(recipe -> { 57 | if(output.matches(InputHelper.toIItemStack(recipe.getOutputOne()))) { 58 | recipes.add(recipe); 59 | } 60 | }); 61 | super.apply(); 62 | } 63 | 64 | @Override 65 | public String getRecipeInfo(CrusherRecipe recipe) { 66 | return LogHelper.getStackDescription(recipe.getOutputOne()); 67 | } 68 | 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/actuallyaddition/MiningLens.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.actuallyaddition; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.utils.*; 5 | import crafttweaker.annotations.*; 6 | import crafttweaker.api.oredict.IOreDictEntry; 7 | import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; 8 | import de.ellpeck.actuallyadditions.api.recipe.*; 9 | import stanhebben.zenscript.annotations.*; 10 | 11 | import java.util.*; 12 | 13 | @ZenClass("mods.actuallyadditions.MiningLens") 14 | @ModOnly("actuallyadditions") 15 | @ZenRegister 16 | public class MiningLens { 17 | 18 | @ZenMethod 19 | public static void addStoneOre(IOreDictEntry ore, int weight) { 20 | ModTweaker.LATE_ADDITIONS.add(new Add(ActuallyAdditionsAPI.STONE_ORES, Collections.singletonList(new WeightedOre(ore.getName(), weight)))); 21 | } 22 | 23 | @ZenMethod 24 | public static void addNetherOre(IOreDictEntry ore, int weight) { 25 | ModTweaker.LATE_ADDITIONS.add(new Add(ActuallyAdditionsAPI.NETHERRACK_ORES, Collections.singletonList(new WeightedOre(ore.getName(), weight)))); 26 | } 27 | 28 | @ZenMethod 29 | public static void removeStoneOre(IOreDictEntry ore) { 30 | ModTweaker.LATE_REMOVALS.add(new Remove(ActuallyAdditionsAPI.STONE_ORES, ore.getName())); 31 | } 32 | 33 | @ZenMethod 34 | public static void removeNetherOre(IOreDictEntry ore) { 35 | ModTweaker.LATE_REMOVALS.add(new Remove(ActuallyAdditionsAPI.NETHERRACK_ORES, ore.getName())); 36 | } 37 | 38 | private static class Add extends BaseListAddition { 39 | 40 | protected Add(List recipes, List newRecipes) { 41 | super("MiningLens", recipes, newRecipes); 42 | } 43 | 44 | @Override 45 | protected String getRecipeInfo(WeightedOre recipe) { 46 | return recipe.name; 47 | } 48 | } 49 | 50 | public static class Remove extends BaseListRemoval { 51 | 52 | private String output; 53 | 54 | protected Remove(List recipes, String output) { 55 | super("MiningLens", recipes); 56 | this.output = output; 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | for(WeightedOre recipe : this.list) { 62 | if(recipe.name.equals(output)) { 63 | recipes.add(recipe); 64 | } 65 | } 66 | super.apply(); 67 | } 68 | 69 | @Override 70 | protected String getRecipeInfo(WeightedOre recipe) { 71 | return recipe.name; 72 | } 73 | 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/actuallyaddition/OilGen.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.actuallyaddition; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.utils.*; 5 | import crafttweaker.annotations.*; 6 | import crafttweaker.api.liquid.ILiquidStack; 7 | import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; 8 | import de.ellpeck.actuallyadditions.api.recipe.*; 9 | import stanhebben.zenscript.annotations.Optional; 10 | import stanhebben.zenscript.annotations.*; 11 | 12 | import java.util.*; 13 | 14 | @ZenClass("mods.actuallyadditions.OilGen") 15 | @ModOnly("actuallyadditions") 16 | @ZenRegister 17 | public class OilGen { 18 | 19 | @ZenMethod 20 | public static void addRecipe(ILiquidStack fluid, int genAmount, @Optional int genTime) { 21 | if(genTime == 0) { 22 | genTime = 100; 23 | } 24 | ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new OilGenRecipe(fluid.getName(), genAmount, genTime)))); 25 | } 26 | 27 | @ZenMethod 28 | public static void removeRecipe(ILiquidStack output) { 29 | ModTweaker.LATE_REMOVALS.add(new Remove(output.getName())); 30 | } 31 | 32 | private static class Add extends BaseListAddition { 33 | 34 | protected Add(List recipes) { 35 | super("OilGen", ActuallyAdditionsAPI.OIL_GENERATOR_RECIPES, recipes); 36 | } 37 | 38 | @Override 39 | public String getRecipeInfo(OilGenRecipe recipe) { 40 | return recipe.fluidName; 41 | } 42 | 43 | } 44 | 45 | private static class Remove extends BaseListRemoval { 46 | 47 | private String output; 48 | 49 | protected Remove(String output) { 50 | super("OilGen", ActuallyAdditionsAPI.OIL_GENERATOR_RECIPES); 51 | this.output = output; 52 | } 53 | 54 | @Override 55 | public void apply() { 56 | ActuallyAdditionsAPI.OIL_GENERATOR_RECIPES.forEach(recipe -> { 57 | if(recipe.fluidName.equals(output)) { 58 | recipes.add(recipe); 59 | } 60 | }); 61 | super.apply(); 62 | } 63 | 64 | @Override 65 | public String getRecipeInfo(OilGenRecipe recipe) { 66 | return recipe.fluidName; 67 | } 68 | 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/actuallyaddition/TreasureChest.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.actuallyaddition; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.InputHelper; 5 | import com.blamejared.mtlib.helpers.LogHelper; 6 | import com.blamejared.mtlib.utils.BaseListAddition; 7 | import com.blamejared.mtlib.utils.BaseListRemoval; 8 | import crafttweaker.annotations.ModOnly; 9 | import crafttweaker.annotations.ZenRegister; 10 | import crafttweaker.api.item.IItemStack; 11 | import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; 12 | import de.ellpeck.actuallyadditions.api.recipe.TreasureChestLoot; 13 | import stanhebben.zenscript.annotations.ZenClass; 14 | import stanhebben.zenscript.annotations.ZenMethod; 15 | 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | @ZenClass("mods.actuallyadditions.TreasureChest") 20 | @ModOnly("actuallyadditions") 21 | @ZenRegister 22 | public class TreasureChest { 23 | 24 | @ZenMethod 25 | public static void addLoot(IItemStack returnItem, int chance, int minAmount, int maxAmount) { 26 | ModTweaker.LATE_ADDITIONS.add(new Add(Collections.singletonList(new TreasureChestLoot(InputHelper.toStack(returnItem), chance, minAmount, maxAmount)))); 27 | } 28 | 29 | @ZenMethod 30 | public static void removeLoot(IItemStack returnItem) { 31 | ModTweaker.LATE_REMOVALS.add(new Remove(returnItem)); 32 | } 33 | 34 | private static class Add extends BaseListAddition { 35 | 36 | protected Add(List recipes) { 37 | super("Treasure Chest", ActuallyAdditionsAPI.TREASURE_CHEST_LOOT, recipes); 38 | } 39 | 40 | @Override 41 | protected String getRecipeInfo(TreasureChestLoot recipe) { 42 | return LogHelper.getStackDescription(recipe.returnItem); 43 | } 44 | } 45 | 46 | private static class Remove extends BaseListRemoval { 47 | 48 | private IItemStack output; 49 | 50 | protected Remove(IItemStack output) { 51 | super("Treasure Chest", ActuallyAdditionsAPI.TREASURE_CHEST_LOOT); 52 | this.output = output; 53 | } 54 | 55 | @Override 56 | public void apply() { 57 | ActuallyAdditionsAPI.TREASURE_CHEST_LOOT.forEach(recipe -> { 58 | if(output.matches(InputHelper.toIItemStack(recipe.returnItem))) { 59 | recipes.add(recipe); 60 | } 61 | }); 62 | super.apply(); 63 | } 64 | 65 | @Override 66 | protected String getRecipeInfo(TreasureChestLoot recipe) { 67 | return LogHelper.getStackDescription(recipe.returnItem); 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Bellows.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.common.registry.BellowsManager; 4 | import betterwithmods.util.item.Stack; 5 | import betterwithmods.util.item.StackMap; 6 | import com.blamejared.ModTweaker; 7 | import com.blamejared.mtlib.helpers.InputHelper; 8 | import com.blamejared.mtlib.utils.BaseMapAddition; 9 | import crafttweaker.annotations.ModOnly; 10 | import crafttweaker.annotations.ZenRegister; 11 | import crafttweaker.api.item.IItemStack; 12 | import stanhebben.zenscript.annotations.ZenClass; 13 | import stanhebben.zenscript.annotations.ZenMethod; 14 | 15 | import java.util.Map; 16 | 17 | @ZenClass("mods.betterwithmods.Bellows") 18 | @ModOnly("betterwithmods") 19 | @ZenRegister 20 | public class Bellows { 21 | 22 | @ZenMethod 23 | public static void set(IItemStack stack, float value) { 24 | StackMap map = new StackMap<>(1.0f); 25 | map.put(new Stack(InputHelper.toStack(stack)), value); 26 | ModTweaker.LATE_ADDITIONS.add(new Set(map)); 27 | } 28 | 29 | public static class Set extends BaseMapAddition { 30 | 31 | protected Set(StackMap map) { 32 | super("Set Bellows Item Weight", BellowsManager.bellowing, map); 33 | } 34 | 35 | @Override 36 | protected String getRecipeInfo(Map.Entry recipe) { 37 | return recipe.getKey().toString() + " -> " + recipe.getValue(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Buoyancy.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.module.hardcore.world.HCBuoy; 4 | import betterwithmods.util.item.Stack; 5 | import betterwithmods.util.item.StackMap; 6 | import com.blamejared.ModTweaker; 7 | import com.blamejared.mtlib.helpers.InputHelper; 8 | import com.blamejared.mtlib.utils.BaseMapAddition; 9 | import crafttweaker.annotations.ModOnly; 10 | import crafttweaker.annotations.ZenRegister; 11 | import crafttweaker.api.item.IItemStack; 12 | import stanhebben.zenscript.annotations.ZenClass; 13 | import stanhebben.zenscript.annotations.ZenMethod; 14 | 15 | import java.util.Map; 16 | 17 | @ZenClass("mods.betterwithmods.Buoyancy") 18 | @ModOnly("betterwithmods") 19 | @ZenRegister 20 | public class Buoyancy { 21 | 22 | @ZenMethod 23 | public static void set(IItemStack stack, float value) { 24 | StackMap map = new StackMap<>(1.0f); 25 | map.put(new Stack(InputHelper.toStack(stack)), value); 26 | ModTweaker.LATE_ADDITIONS.add(new Set(map)); 27 | } 28 | 29 | public static class Set extends BaseMapAddition { 30 | 31 | protected Set(StackMap map) { 32 | super("Set Item Buoyancy", HCBuoy.buoyancy, map); 33 | } 34 | 35 | @Override 36 | protected String getRecipeInfo(Map.Entry recipe) { 37 | return recipe.getKey().toString() + " -> " + recipe.getValue(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Cauldron.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | 4 | import betterwithmods.common.BWRegistry; 5 | import com.blamejared.compat.betterwithmods.base.bulkrecipes.CookingPotBuilder; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.item.IIngredient; 9 | import crafttweaker.api.item.IItemStack; 10 | import stanhebben.zenscript.annotations.NotNull; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | @ZenClass("mods.betterwithmods.Cauldron") 15 | @ModOnly("betterwithmods") 16 | @ZenRegister 17 | public class Cauldron { 18 | 19 | public static CookingPotBuilder INSTANCE = new CookingPotBuilder(() -> BWRegistry.CAULDRON, "Cauldron"); 20 | 21 | @ZenMethod 22 | public static CookingPotBuilder builder() { 23 | return INSTANCE; 24 | } 25 | 26 | @ZenMethod 27 | public static void addStoked(IIngredient[] inputs, IItemStack[] outputs) { 28 | INSTANCE.buildRecipe(inputs, outputs).setHeat(CookingPotBuilder.STOKED).build(); 29 | } 30 | 31 | @ZenMethod 32 | public static void addUnstoked(IIngredient[] inputs, IItemStack[] outputs) { 33 | INSTANCE.buildRecipe(inputs, outputs).setHeat(CookingPotBuilder.UNSTOKED).build(); 34 | } 35 | 36 | @Deprecated 37 | @ZenMethod 38 | public static void add(IItemStack output, IItemStack secondaryOutput, @NotNull IIngredient[] inputs) { 39 | addUnstoked(inputs, new IItemStack[]{output, secondaryOutput}); 40 | } 41 | 42 | @Deprecated 43 | @ZenMethod 44 | public static void add(IItemStack output, @NotNull IIngredient[] inputs) { 45 | addUnstoked(inputs, new IItemStack[]{output}); 46 | } 47 | 48 | @ZenMethod 49 | public static void remove(IItemStack[] output) { 50 | INSTANCE.removeRecipe(output); 51 | } 52 | 53 | @ZenMethod 54 | public static void removeAll() { 55 | builder().removeAll(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Crucible.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | 4 | import betterwithmods.common.BWRegistry; 5 | import com.blamejared.compat.betterwithmods.base.bulkrecipes.CookingPotBuilder; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.item.IIngredient; 9 | import crafttweaker.api.item.IItemStack; 10 | import stanhebben.zenscript.annotations.NotNull; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | @ZenClass("mods.betterwithmods.Crucible") 15 | @ModOnly("betterwithmods") 16 | @ZenRegister 17 | public class Crucible { 18 | public static CookingPotBuilder INSTANCE = new CookingPotBuilder(() -> BWRegistry.CRUCIBLE, "Crucible"); 19 | 20 | @ZenMethod 21 | public static CookingPotBuilder builder() { 22 | return INSTANCE; 23 | } 24 | 25 | @ZenMethod 26 | public static void addStoked(IIngredient[] inputs, IItemStack[] outputs) { 27 | INSTANCE.buildRecipe(inputs, outputs).setHeat(CookingPotBuilder.STOKED).build(); 28 | } 29 | 30 | @ZenMethod 31 | public static void addUnstoked(IIngredient[] inputs, IItemStack[] outputs) { 32 | INSTANCE.buildRecipe(inputs, outputs).setHeat(CookingPotBuilder.UNSTOKED).build(); 33 | } 34 | 35 | @Deprecated 36 | @ZenMethod 37 | public static void add(IItemStack output, IItemStack secondaryOutput, @NotNull IIngredient[] inputs) { 38 | addUnstoked(inputs, new IItemStack[]{output, secondaryOutput}); 39 | } 40 | 41 | @Deprecated 42 | @ZenMethod 43 | public static void add(IItemStack output, @NotNull IIngredient[] inputs) { 44 | addUnstoked(inputs, new IItemStack[]{output}); 45 | } 46 | 47 | @ZenMethod 48 | public static void remove(IItemStack[] output) { 49 | INSTANCE.removeRecipe(output); 50 | } 51 | 52 | @ZenMethod 53 | public static void removeAll() { 54 | builder().removeAll(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Kiln.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.common.BWMRecipes; 4 | import betterwithmods.common.BWRegistry; 5 | import betterwithmods.common.registry.KilnStructureManager; 6 | import com.blamejared.ModTweaker; 7 | import com.blamejared.compat.betterwithmods.base.blockrecipes.KilnBuilder; 8 | import com.blamejared.mtlib.helpers.InputHelper; 9 | import com.blamejared.mtlib.utils.BaseAction; 10 | import crafttweaker.annotations.ModOnly; 11 | import crafttweaker.annotations.ZenRegister; 12 | import crafttweaker.api.item.IIngredient; 13 | import crafttweaker.api.item.IItemStack; 14 | import net.minecraft.block.state.IBlockState; 15 | import stanhebben.zenscript.annotations.NotNull; 16 | import stanhebben.zenscript.annotations.ZenClass; 17 | import stanhebben.zenscript.annotations.ZenMethod; 18 | 19 | import javax.annotation.Nonnull; 20 | 21 | @ZenClass("mods.betterwithmods.Kiln") 22 | @ModOnly("betterwithmods") 23 | @ZenRegister 24 | public class Kiln { 25 | 26 | public static KilnBuilder INSTANCE = new KilnBuilder(() -> BWRegistry.KILN, "Kiln"); 27 | 28 | @ZenMethod 29 | public static KilnBuilder builder() { 30 | return INSTANCE; 31 | } 32 | 33 | @ZenMethod 34 | public static void add(@Nonnull IIngredient input, IItemStack[] output) { 35 | builder().buildRecipe(input, output).build(); 36 | } 37 | 38 | @ZenMethod 39 | public static void add(IItemStack[] output, @NotNull IIngredient input) { 40 | add(input, output); 41 | } 42 | 43 | @ZenMethod 44 | public static void remove(IItemStack input) { 45 | INSTANCE.removeRecipe(input); 46 | } 47 | 48 | @ZenMethod 49 | public static void remove(IItemStack[] outputs) { 50 | INSTANCE.removeRecipe(outputs); 51 | } 52 | 53 | @ZenMethod 54 | public static void removeAll() { 55 | builder().removeAll(); 56 | } 57 | 58 | @ZenMethod 59 | public static void registerBlock(IItemStack block) { 60 | ModTweaker.LATE_ADDITIONS.add(new KilnBlock(BWMRecipes.getStateFromStack(InputHelper.toStack(block)))); 61 | } 62 | 63 | public static class KilnBlock extends BaseAction { 64 | 65 | private IBlockState state; 66 | 67 | KilnBlock(IBlockState state) { 68 | super("Set Kiln Structure Block"); 69 | this.state = state; 70 | } 71 | 72 | @Override 73 | public void apply() { 74 | KilnStructureManager.registerKilnBlock(state); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Mill.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | 4 | import betterwithmods.common.BWRegistry; 5 | import com.blamejared.compat.betterwithmods.base.bulkrecipes.MillBuilder; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.item.IIngredient; 9 | import crafttweaker.api.item.IItemStack; 10 | import stanhebben.zenscript.annotations.NotNull; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | @ZenClass("mods.betterwithmods.Mill") 15 | @ModOnly("betterwithmods") 16 | @ZenRegister 17 | public class Mill { 18 | 19 | public static MillBuilder INSTANCE = new MillBuilder(() -> BWRegistry.MILLSTONE, "Mill"); 20 | 21 | @ZenMethod 22 | public static MillBuilder builder() { 23 | return new MillBuilder(() -> BWRegistry.MILLSTONE, "Mill"); 24 | } 25 | 26 | @ZenMethod 27 | public static void addRecipe(IIngredient[] inputs, IItemStack[] outputs) { 28 | INSTANCE.buildRecipe(inputs, outputs).build(); 29 | } 30 | 31 | @Deprecated 32 | @ZenMethod 33 | public static void add(IItemStack output, IItemStack secondaryOutput, @NotNull IIngredient[] inputs) { 34 | addRecipe(inputs, new IItemStack[]{output, secondaryOutput}); 35 | } 36 | 37 | @Deprecated 38 | @ZenMethod 39 | public static void add(IItemStack output, @NotNull IIngredient[] inputs) { 40 | addRecipe(inputs, new IItemStack[]{output}); 41 | } 42 | 43 | @ZenMethod 44 | public static void remove(IItemStack[] output) { 45 | INSTANCE.removeRecipe(output); 46 | } 47 | 48 | @ZenMethod 49 | public static void removeAll() { 50 | builder().removeAll(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Misc.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.module.hardcore.crafting.HCFurnace; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.utils.BaseMapAddition; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.item.IIngredient; 9 | import crafttweaker.api.minecraft.CraftTweakerMC; 10 | import net.minecraft.item.crafting.Ingredient; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | import java.util.Arrays; 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | @ZenClass("mods.betterwithmods.Misc") 19 | @ModOnly("betterwithmods") 20 | @ZenRegister 21 | public class Misc { 22 | @ZenMethod 23 | public static void setFurnaceSmeltingTime(IIngredient ingredient, int time) { 24 | HashMap map = new HashMap<>(); 25 | map.put(CraftTweakerMC.getIngredient(ingredient),time); 26 | ModTweaker.LATE_ADDITIONS.add(new SetSmeltingTime(map)); 27 | } 28 | 29 | public static class SetSmeltingTime extends BaseMapAddition { 30 | 31 | protected SetSmeltingTime(Map map) { 32 | super("Set HCFurnace Smelting Time", HCFurnace.FURNACE_TIMINGS, map); 33 | } 34 | 35 | @Override 36 | protected String getRecipeInfo(Map.Entry recipe) { 37 | return Arrays.toString(recipe.getKey().getMatchingStacks()) + " -> " + recipe.getValue(); //Fortunately mojang is adding a toString method to Ingredient 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Movement.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.module.hardcore.needs.HCMovement; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.InputHelper; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.ModOnly; 8 | import crafttweaker.annotations.ZenRegister; 9 | import crafttweaker.api.item.IItemStack; 10 | import net.minecraft.block.Block; 11 | import net.minecraft.block.state.IBlockState; 12 | import net.minecraft.item.ItemBlock; 13 | import net.minecraft.item.ItemStack; 14 | import stanhebben.zenscript.annotations.ZenClass; 15 | import stanhebben.zenscript.annotations.ZenMethod; 16 | 17 | @ZenClass("mods.betterwithmods.Movement") 18 | @ModOnly("betterwithmods") 19 | @ZenRegister 20 | public class Movement { 21 | 22 | @SuppressWarnings("deprecation") 23 | @ZenMethod 24 | public static void set(IItemStack input, float speed) { 25 | ItemStack stack = InputHelper.toStack(input); 26 | if(InputHelper.isABlock(stack)) { 27 | Block block = ((ItemBlock) stack.getItem()).getBlock(); 28 | IBlockState state = block.getStateFromMeta(stack.getMetadata()); 29 | ModTweaker.LATE_ADDITIONS.add(new Set(state, speed)); 30 | } 31 | } 32 | 33 | public static class Set extends BaseAction { 34 | 35 | private IBlockState state; 36 | private float speed; 37 | 38 | protected Set(IBlockState state, float speed) { 39 | super("Set Block HCMovement"); 40 | this.state = state; 41 | this.speed = speed; 42 | } 43 | 44 | @Override 45 | protected String getRecipeInfo() { 46 | return state.toString() + "->" + speed; 47 | } 48 | 49 | @Override 50 | public void apply() { 51 | HCMovement.BLOCK_OVERRIDE_MOVEMENT.put(state, speed); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/PulleyManager.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.common.registry.PulleyStructureManager; 4 | import com.blamejared.mtlib.utils.BaseAction; 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.minecraft.CraftTweakerMC; 9 | import net.minecraft.block.state.IBlockState; 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | 13 | @ZenClass("mods.betterwithmods.PulleyManager") 14 | @ModOnly("betterwithmods") 15 | @ZenRegister 16 | public class PulleyManager { 17 | 18 | @ZenMethod 19 | public static void addPulleyBlock(crafttweaker.api.block.IBlockState state) { 20 | CraftTweakerAPI.apply(new AddPulleyBlock(CraftTweakerMC.getBlockState(state))); 21 | } 22 | 23 | public static class AddPulleyBlock extends BaseAction { 24 | 25 | private IBlockState state; 26 | 27 | AddPulleyBlock(IBlockState state) { 28 | super("Add Pulley Block"); 29 | this.state = state; 30 | } 31 | 32 | @Override 33 | public void apply() { 34 | PulleyStructureManager.registerPulleyBlock(state); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Saw.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | 4 | import betterwithmods.common.BWRegistry; 5 | import com.blamejared.compat.betterwithmods.base.blockrecipes.SawBuilder; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.item.IIngredient; 9 | import crafttweaker.api.item.IItemStack; 10 | import stanhebben.zenscript.annotations.NotNull; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | import javax.annotation.Nonnull; 15 | 16 | 17 | @ZenClass("mods.betterwithmods.Saw") 18 | @ModOnly("betterwithmods") 19 | @ZenRegister 20 | public class Saw { 21 | 22 | public static SawBuilder INSTANCE = new SawBuilder(() -> BWRegistry.WOOD_SAW, "Saw"); 23 | 24 | @ZenMethod 25 | public static SawBuilder builder() { 26 | return INSTANCE; 27 | } 28 | 29 | @ZenMethod 30 | public static void add(@Nonnull IIngredient input, IItemStack[] output) { 31 | builder().buildRecipe(input, output).build(); 32 | } 33 | 34 | @Deprecated 35 | @ZenMethod 36 | public static void add(IItemStack[] output, @NotNull IIngredient input) { 37 | add(input, output); 38 | } 39 | 40 | @ZenMethod 41 | public static void remove(IItemStack input) { 42 | INSTANCE.removeRecipe(input); 43 | } 44 | 45 | @ZenMethod 46 | public static void remove(IItemStack[] outputs) { 47 | INSTANCE.removeRecipe(outputs); 48 | } 49 | 50 | @ZenMethod 51 | public static void removeAll() { 52 | builder().removeAll(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/StokedCauldron.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | 4 | import com.blamejared.compat.betterwithmods.base.bulkrecipes.CookingPotBuilder; 5 | import crafttweaker.annotations.ModOnly; 6 | import crafttweaker.annotations.ZenRegister; 7 | import crafttweaker.api.item.IIngredient; 8 | import crafttweaker.api.item.IItemStack; 9 | import stanhebben.zenscript.annotations.NotNull; 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | 13 | @Deprecated 14 | @ZenClass("mods.betterwithmods.StokedCauldron") 15 | @ModOnly("betterwithmods") 16 | @ZenRegister 17 | public class StokedCauldron { 18 | 19 | @Deprecated 20 | @ZenMethod 21 | public static void add(IItemStack output, IItemStack secondaryOutput, @NotNull IIngredient[] inputs) { 22 | Cauldron.INSTANCE.buildRecipe(inputs,new IItemStack[]{output,secondaryOutput}).setHeat(CookingPotBuilder.STOKED).build(); 23 | } 24 | 25 | @Deprecated 26 | @ZenMethod 27 | public static void add(IItemStack output, @NotNull IIngredient[] inputs) { 28 | Cauldron.INSTANCE.buildRecipe(inputs,new IItemStack[]{output}).setHeat(CookingPotBuilder.STOKED).build(); 29 | } 30 | 31 | @Deprecated 32 | @ZenMethod 33 | public static void remove(IItemStack[] output) { 34 | Cauldron.remove(output); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/StokedCrucible.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | 4 | import com.blamejared.compat.betterwithmods.base.bulkrecipes.CookingPotBuilder; 5 | import crafttweaker.annotations.ModOnly; 6 | import crafttweaker.annotations.ZenRegister; 7 | import crafttweaker.api.item.IIngredient; 8 | import crafttweaker.api.item.IItemStack; 9 | import stanhebben.zenscript.annotations.NotNull; 10 | import stanhebben.zenscript.annotations.ZenClass; 11 | import stanhebben.zenscript.annotations.ZenMethod; 12 | 13 | @Deprecated 14 | @ZenClass("mods.betterwithmods.StokedCrucible") 15 | @ModOnly("betterwithmods") 16 | @ZenRegister 17 | public class StokedCrucible { 18 | 19 | @Deprecated 20 | @ZenMethod 21 | public static void add(IItemStack output, IItemStack secondaryOutput, @NotNull IIngredient[] inputs) { 22 | Crucible.INSTANCE.buildRecipe(inputs,new IItemStack[]{output,secondaryOutput}).setHeat(CookingPotBuilder.STOKED).build(); 23 | } 24 | 25 | @Deprecated 26 | @ZenMethod 27 | public static void add(IItemStack output, @NotNull IIngredient[] inputs) { 28 | Crucible.INSTANCE.buildRecipe(inputs,new IItemStack[]{output}).setHeat(CookingPotBuilder.STOKED).build(); 29 | } 30 | 31 | @Deprecated 32 | @ZenMethod 33 | public static void remove(IItemStack[] output) { 34 | Crucible.remove(output); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/Turntable.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods; 2 | 3 | import betterwithmods.common.BWMRecipes; 4 | import betterwithmods.common.BWRegistry; 5 | import com.blamejared.compat.betterwithmods.base.blockrecipes.TurntableBuilder; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.item.IIngredient; 9 | import crafttweaker.api.item.IItemStack; 10 | import crafttweaker.api.minecraft.CraftTweakerMC; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | 15 | @ZenClass("mods.betterwithmods.Turntable") 16 | @ModOnly("betterwithmods") 17 | @ZenRegister 18 | public class Turntable { 19 | 20 | public static TurntableBuilder INSTANCE = new TurntableBuilder(() -> BWRegistry.TURNTABLE, "Turntable"); 21 | 22 | @ZenMethod 23 | public static TurntableBuilder builder() { 24 | return INSTANCE; 25 | } 26 | 27 | @ZenMethod 28 | public static void add(IIngredient inputBlock, IItemStack[] additionalOutput) { 29 | builder().buildRecipe(inputBlock, additionalOutput).build(); 30 | } 31 | 32 | @ZenMethod 33 | public static void add(IIngredient inputBlock, IItemStack productState, IItemStack[] additionalOutput) { 34 | builder().buildRecipe(inputBlock, additionalOutput).setProductState(productState).build(); 35 | } 36 | 37 | @ZenMethod 38 | public static void remove(IItemStack input) { 39 | INSTANCE.removeRecipe(input); 40 | } 41 | 42 | @ZenMethod 43 | public static void removeByProductState(IItemStack output) { 44 | INSTANCE.removeRecipe(BWMRecipes.getStateFromStack(CraftTweakerMC.getItemStack(output))); 45 | } 46 | 47 | @ZenMethod 48 | public static void removeAll() { 49 | builder().removeAll(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/RemoveAll.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base; 2 | 3 | import com.blamejared.mtlib.utils.BaseAction; 4 | 5 | import java.util.List; 6 | 7 | public class RemoveAll extends BaseAction { 8 | private List list; 9 | 10 | public RemoveAll(String name, List list) { 11 | super(name); 12 | this.list = list; 13 | } 14 | 15 | @Override 16 | public void apply() { 17 | list.clear(); 18 | } 19 | 20 | @Override 21 | protected String getRecipeInfo() { 22 | return String.format("Removing all recipes for %s", name); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/blockrecipes/BlockRecipeAdd.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.blockrecipes; 2 | 3 | import betterwithmods.common.registry.block.managers.CraftingManagerBlock; 4 | import betterwithmods.common.registry.block.recipe.BlockRecipe; 5 | import com.blamejared.mtlib.utils.BaseListAddition; 6 | import com.google.common.collect.Lists; 7 | import net.minecraft.item.ItemStack; 8 | 9 | import java.util.stream.Collectors; 10 | 11 | public class BlockRecipeAdd extends BaseListAddition { 12 | 13 | public BlockRecipeAdd(String name, CraftingManagerBlock recipes, T recipe) { 14 | super(name, recipes.getRecipes(), Lists.newArrayList(recipe)); 15 | } 16 | 17 | @Override 18 | protected String getRecipeInfo(T recipe) { 19 | return recipe.getOutputs().stream().map(ItemStack::getDisplayName).collect(Collectors.joining(",")); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/blockrecipes/BlockRecipeBuilder.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.blockrecipes; 2 | 3 | import betterwithmods.common.registry.block.managers.CraftingManagerBlock; 4 | import betterwithmods.common.registry.block.recipe.BlockDropIngredient; 5 | import betterwithmods.common.registry.block.recipe.BlockIngredient; 6 | import betterwithmods.common.registry.block.recipe.BlockRecipe; 7 | import com.blamejared.ModTweaker; 8 | import com.blamejared.compat.betterwithmods.base.RemoveAll; 9 | import com.blamejared.mtlib.helpers.InputHelper; 10 | import crafttweaker.api.item.IIngredient; 11 | import crafttweaker.api.item.IItemStack; 12 | import crafttweaker.api.minecraft.CraftTweakerMC; 13 | import net.minecraft.item.ItemStack; 14 | import stanhebben.zenscript.annotations.ZenMethod; 15 | 16 | import java.util.List; 17 | import java.util.function.Supplier; 18 | 19 | public abstract class BlockRecipeBuilder { 20 | protected BlockIngredient input; 21 | protected List outputs; 22 | private Supplier> registry; 23 | protected String name; 24 | 25 | public BlockRecipeBuilder(Supplier> registry, String name) { 26 | this.registry = registry; 27 | this.name = name; 28 | } 29 | 30 | protected void addRecipe(T recipe) { 31 | ModTweaker.LATE_ADDITIONS.add(new BlockRecipeAdd<>(name, registry.get(), recipe)); 32 | } 33 | 34 | @ZenMethod 35 | public abstract void build(); 36 | 37 | public void removeRecipe(IItemStack[] output) { 38 | ModTweaker.LATE_REMOVALS.add(new BlockRecipeRemove<>(name, registry.get(), output)); 39 | } 40 | 41 | public void removeRecipe(IItemStack input) { 42 | ModTweaker.LATE_REMOVALS.add(new BlockRecipeRemoveInput<>(name, registry.get(), input)); 43 | } 44 | 45 | public void _buildRecipe(IIngredient input, IItemStack[] outputs) { 46 | this.input = new BlockIngredient(CraftTweakerMC.getIngredient(input)); 47 | this.outputs = InputHelper.toNonNullList(CraftTweakerMC.getItemStacks(outputs)); 48 | } 49 | 50 | @ZenMethod 51 | public BlockRecipeBuilder setInputBlockDrop(IItemStack input) { 52 | this.input = new BlockDropIngredient(CraftTweakerMC.getItemStack(input)); 53 | return this; 54 | } 55 | 56 | @ZenMethod 57 | public BlockRecipeBuilder setInputBlockDrop(IItemStack[] inputs) { 58 | this.input = new BlockDropIngredient(CraftTweakerMC.getItemStacks(inputs)); 59 | return this; 60 | } 61 | 62 | @ZenMethod 63 | public void removeAll() { 64 | ModTweaker.LATE_REMOVALS.add(new RemoveAll<>(name, registry.get().getRecipes())); 65 | } 66 | 67 | public String getName() { 68 | return name; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/blockrecipes/BlockRecipeRemove.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.blockrecipes; 2 | 3 | import betterwithmods.common.registry.block.managers.CraftingManagerBlock; 4 | import betterwithmods.common.registry.block.recipe.BlockRecipe; 5 | import com.blamejared.mtlib.helpers.InputHelper; 6 | import com.blamejared.mtlib.helpers.LogHelper; 7 | import com.blamejared.mtlib.utils.BaseAction; 8 | import com.google.common.collect.Lists; 9 | import crafttweaker.api.item.IItemStack; 10 | import net.minecraft.item.ItemStack; 11 | 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | public class BlockRecipeRemove extends BaseAction { 16 | 17 | private final List outputs; 18 | private CraftingManagerBlock manager; 19 | 20 | public BlockRecipeRemove(String name, CraftingManagerBlock manager, IItemStack[] outputs) { 21 | this(name, manager, Lists.newArrayList(InputHelper.toStacks(outputs))); 22 | } 23 | 24 | private BlockRecipeRemove(String name, CraftingManagerBlock manager, List outputs) { 25 | super(name); 26 | this.manager = manager; 27 | this.outputs = outputs; 28 | } 29 | 30 | @Override 31 | public void apply() { 32 | if (!manager.remove(outputs)) { 33 | LogHelper.logWarning(String.format("No recipes were removed for output %s", getRecipeInfo())); 34 | } else { 35 | LogHelper.logInfo(String.format("Successfully removed all recipes for %s", getRecipeInfo())); 36 | } 37 | } 38 | 39 | @Override 40 | protected String getRecipeInfo() { 41 | return String.format("%s - %s", name, outputs.stream().map(ItemStack::getDisplayName).collect(Collectors.joining(","))); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/blockrecipes/BlockRecipeRemoveInput.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.blockrecipes; 2 | 3 | import betterwithmods.common.registry.block.managers.CraftingManagerBlock; 4 | import betterwithmods.common.registry.block.recipe.BlockRecipe; 5 | import com.blamejared.mtlib.helpers.InputHelper; 6 | import com.blamejared.mtlib.helpers.LogHelper; 7 | import com.blamejared.mtlib.utils.BaseAction; 8 | import crafttweaker.api.item.IItemStack; 9 | import net.minecraft.item.ItemStack; 10 | 11 | public class BlockRecipeRemoveInput extends BaseAction { 12 | 13 | private final ItemStack input; 14 | private CraftingManagerBlock manager; 15 | 16 | public BlockRecipeRemoveInput(String name, CraftingManagerBlock manager, IItemStack input) { 17 | this(name, manager, InputHelper.toStack(input)); 18 | } 19 | 20 | private BlockRecipeRemoveInput(String name, CraftingManagerBlock manager, ItemStack input) { 21 | super(name); 22 | this.manager = manager; 23 | this.input = input; 24 | } 25 | 26 | @Override 27 | public void apply() { 28 | if (!manager.removeByInput(input)) { 29 | LogHelper.logWarning(String.format("No recipes were removed for input %s", getRecipeInfo())); 30 | } else { 31 | LogHelper.logInfo(String.format("Successfully removed all recipes with %s as input", getRecipeInfo())); 32 | } 33 | } 34 | 35 | @Override 36 | protected String getRecipeInfo() { 37 | return String.format("%s - %s", name, input.getDisplayName()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/blockrecipes/KilnBuilder.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.blockrecipes; 2 | 3 | import betterwithmods.common.registry.block.managers.CraftingManagerBlock; 4 | import betterwithmods.common.registry.block.recipe.KilnRecipe; 5 | import crafttweaker.api.item.IIngredient; 6 | import crafttweaker.api.item.IItemStack; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | 9 | import java.util.function.Supplier; 10 | 11 | public class KilnBuilder extends BlockRecipeBuilder { 12 | private int heat = 2; 13 | private boolean ignoreHeat; 14 | 15 | public KilnBuilder(Supplier> registry, String name) { 16 | super(registry, name); 17 | } 18 | 19 | @ZenMethod 20 | public KilnBuilder setHeat(int heat) { 21 | this.heat = heat; 22 | return this; 23 | } 24 | 25 | @ZenMethod 26 | public KilnBuilder setIgnoreHeat(boolean ignoreHeat) { 27 | this.ignoreHeat = ignoreHeat; 28 | return this; 29 | } 30 | 31 | @ZenMethod 32 | public KilnBuilder buildRecipe(IIngredient input, IItemStack[] outputs) { 33 | _buildRecipe(input, outputs); 34 | return this; 35 | } 36 | 37 | @Override 38 | public void build() { 39 | addRecipe(new KilnRecipe(input, outputs, heat).setIgnoreHeat(ignoreHeat)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/blockrecipes/SawBuilder.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.blockrecipes; 2 | 3 | import betterwithmods.common.registry.block.managers.CraftingManagerBlock; 4 | import betterwithmods.common.registry.block.recipe.SawRecipe; 5 | import crafttweaker.api.item.IIngredient; 6 | import crafttweaker.api.item.IItemStack; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | 9 | import java.util.function.Supplier; 10 | 11 | public class SawBuilder extends BlockRecipeBuilder { 12 | 13 | public SawBuilder(Supplier> registry, String name) { 14 | super(registry, name); 15 | } 16 | 17 | @ZenMethod 18 | public SawBuilder buildRecipe(IIngredient input, IItemStack[] outputs) { 19 | _buildRecipe(input,outputs); 20 | return this; 21 | } 22 | 23 | @Override 24 | public void build() { 25 | addRecipe(new SawRecipe(input,outputs)); 26 | } 27 | 28 | @ZenMethod 29 | @Override 30 | public void removeAll() { 31 | super.removeAll(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/bulkrecipes/BulkRecipeAdd.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.bulkrecipes; 2 | 3 | import betterwithmods.common.registry.bulk.manager.CraftingManagerBulk; 4 | import betterwithmods.common.registry.bulk.recipes.BulkRecipe; 5 | import com.blamejared.mtlib.utils.BaseListAddition; 6 | import com.google.common.collect.Lists; 7 | import net.minecraft.item.ItemStack; 8 | 9 | import java.util.function.Supplier; 10 | import java.util.stream.Collectors; 11 | 12 | public class BulkRecipeAdd extends BaseListAddition { 13 | 14 | public BulkRecipeAdd(String name, Supplier> recipes, T recipe) { 15 | super(name, recipes.get().getRecipes(), Lists.newArrayList(recipe)); 16 | } 17 | 18 | @Override 19 | protected String getRecipeInfo(T recipe) { 20 | return recipe.getOutputs().stream().map(ItemStack::getDisplayName).collect(Collectors.joining(",")); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/bulkrecipes/BulkRecipeBuilder.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.bulkrecipes; 2 | 3 | import betterwithmods.common.registry.bulk.manager.CraftingManagerBulk; 4 | import betterwithmods.common.registry.bulk.recipes.BulkRecipe; 5 | import betterwithmods.util.StackIngredient; 6 | import com.blamejared.ModTweaker; 7 | import com.blamejared.compat.betterwithmods.base.RemoveAll; 8 | import com.blamejared.mtlib.helpers.InputHelper; 9 | import crafttweaker.api.item.IIngredient; 10 | import crafttweaker.api.item.IItemStack; 11 | import crafttweaker.api.minecraft.CraftTweakerMC; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.item.crafting.Ingredient; 14 | import stanhebben.zenscript.annotations.ZenMethod; 15 | 16 | import java.util.Arrays; 17 | import java.util.List; 18 | import java.util.function.Supplier; 19 | import java.util.stream.Collectors; 20 | 21 | public abstract class BulkRecipeBuilder { 22 | 23 | protected List inputs; 24 | protected List outputs; 25 | protected int priority; 26 | private Supplier> registry; 27 | private String name; 28 | 29 | public BulkRecipeBuilder(Supplier> registry, String name) { 30 | this.registry = registry; 31 | this.name = name; 32 | } 33 | 34 | public static Ingredient getIngredient(IIngredient ingredient) { 35 | Ingredient i = CraftTweakerMC.getIngredient(ingredient); 36 | if (ingredient.getAmount() > 1) { 37 | return StackIngredient.fromIngredient(ingredient.getAmount(), i); 38 | } 39 | return i; 40 | } 41 | 42 | protected void addRecipe(T recipe) { 43 | ModTweaker.LATE_ADDITIONS.add(new BulkRecipeAdd<>(name, registry, recipe)); 44 | } 45 | 46 | public abstract void build(); 47 | 48 | public void _buildRecipe(IIngredient[] inputs, IItemStack[] outputs) { 49 | this.inputs = Arrays.stream(inputs).map(BulkRecipeBuilder::getIngredient).collect(Collectors.toList()); 50 | this.outputs = InputHelper.toNonNullList(CraftTweakerMC.getItemStacks(outputs)); 51 | } 52 | 53 | public void removeRecipe(IItemStack[] output) { 54 | ModTweaker.LATE_REMOVALS.add(new BulkRecipeRemove<>(name, registry, output)); 55 | } 56 | 57 | @ZenMethod 58 | public void removeAll() { 59 | ModTweaker.LATE_REMOVALS.add(new RemoveAll<>(name, registry.get().getRecipes())); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/bulkrecipes/BulkRecipeRemove.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.bulkrecipes; 2 | 3 | 4 | import betterwithmods.common.registry.bulk.manager.CraftingManagerBulk; 5 | import betterwithmods.common.registry.bulk.recipes.BulkRecipe; 6 | import com.blamejared.mtlib.helpers.InputHelper; 7 | import com.blamejared.mtlib.helpers.LogHelper; 8 | import com.blamejared.mtlib.utils.BaseAction; 9 | import com.google.common.collect.Lists; 10 | import crafttweaker.api.item.IItemStack; 11 | import net.minecraft.item.ItemStack; 12 | 13 | import java.util.List; 14 | import java.util.function.Supplier; 15 | import java.util.stream.Collectors; 16 | 17 | 18 | public class BulkRecipeRemove extends BaseAction { 19 | 20 | private final List outputs; 21 | private CraftingManagerBulk manager; 22 | 23 | public BulkRecipeRemove(String name, Supplier> manager, IItemStack[] outputs) { 24 | this(name, manager.get(), Lists.newArrayList(InputHelper.toStacks(outputs))); 25 | } 26 | 27 | private BulkRecipeRemove(String name, CraftingManagerBulk manager, List outputs) { 28 | super(name); 29 | this.manager = manager; 30 | this.outputs = outputs; 31 | } 32 | 33 | @Override 34 | public void apply() { 35 | if (!manager.remove(outputs)) { 36 | LogHelper.logWarning(String.format("No recipes were removed for output %s", getRecipeInfo())); 37 | } else { 38 | LogHelper.logInfo(String.format("Successfully removed all recipes for %s", getRecipeInfo())); 39 | } 40 | } 41 | 42 | @Override 43 | protected String getRecipeInfo() { 44 | return String.format("%s - %s", name, outputs.stream().map(ItemStack::getDisplayName).collect(Collectors.joining(","))); 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/bulkrecipes/CookingPotBuilder.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.bulkrecipes; 2 | 3 | import betterwithmods.common.registry.bulk.manager.CraftingManagerBulk; 4 | import betterwithmods.common.registry.bulk.recipes.CookingPotRecipe; 5 | import crafttweaker.api.item.IIngredient; 6 | import crafttweaker.api.item.IItemStack; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | 9 | import java.util.function.Supplier; 10 | 11 | public class CookingPotBuilder extends BulkRecipeBuilder { 12 | public static final int UNSTOKED = 1; 13 | public static final int STOKED = 2; 14 | 15 | private int heat = 1; 16 | private boolean ignoreHeat = false; 17 | 18 | public CookingPotBuilder(Supplier> registry, String name) { 19 | super(registry, name); 20 | } 21 | 22 | @ZenMethod 23 | public void build() { 24 | addRecipe(new CookingPotRecipe(inputs, outputs, heat).setPriority(priority).setIgnoreHeat(ignoreHeat)); 25 | } 26 | 27 | @ZenMethod 28 | public CookingPotBuilder setHeat(int heat) { 29 | this.heat = heat; 30 | return this; 31 | } 32 | 33 | @ZenMethod 34 | public CookingPotBuilder setIgnoreHeat(boolean ignoreHeat) { 35 | this.ignoreHeat = ignoreHeat; 36 | return this; 37 | } 38 | 39 | @ZenMethod 40 | public CookingPotBuilder setPriority(int priority) { 41 | this.priority = priority; 42 | return this; 43 | } 44 | 45 | @ZenMethod 46 | public CookingPotBuilder buildRecipe(IIngredient[] inputs, IItemStack[] outputs) { 47 | _buildRecipe(inputs, outputs); 48 | return this; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/betterwithmods/base/bulkrecipes/MillBuilder.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.betterwithmods.base.bulkrecipes; 2 | 3 | import betterwithmods.common.registry.bulk.manager.CraftingManagerBulk; 4 | import betterwithmods.common.registry.bulk.recipes.MillRecipe; 5 | import crafttweaker.api.item.IIngredient; 6 | import crafttweaker.api.item.IItemStack; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | 9 | import java.util.function.Supplier; 10 | 11 | public class MillBuilder extends BulkRecipeBuilder { 12 | 13 | private String sound; 14 | private int ticks; 15 | 16 | public MillBuilder(Supplier> registry, String name) { 17 | super(registry, name); 18 | } 19 | 20 | @ZenMethod 21 | @Override 22 | public void build() { 23 | addRecipe(new MillRecipe(inputs, outputs).setSound(sound).setPriority(priority).setTicks(ticks)); 24 | } 25 | 26 | @ZenMethod 27 | public MillBuilder setPriority(int priority) { 28 | this.priority = priority; 29 | return this; 30 | } 31 | 32 | @ZenMethod 33 | public MillBuilder setGrindType(String sound) { 34 | this.sound = sound; 35 | return this; 36 | } 37 | 38 | @ZenMethod 39 | public MillBuilder setTicks(int ticks) { 40 | this.ticks = ticks; 41 | return this; 42 | } 43 | 44 | @ZenMethod 45 | public MillBuilder buildRecipe(IIngredient[] inputs, IItemStack[] outputs) { 46 | _buildRecipe(inputs,outputs); 47 | return this; 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/bloodmagic/AlchemyArray.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.bloodmagic; 2 | 3 | import WayofTime.bloodmagic.api.impl.BloodMagicAPI; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.InputHelper; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.*; 8 | import crafttweaker.api.item.IItemStack; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.util.ResourceLocation; 11 | import stanhebben.zenscript.annotations.*; 12 | 13 | @ZenClass("mods.bloodmagic.AlchemyArray") 14 | @ZenRegister 15 | @ModOnly("bloodmagic") 16 | public class AlchemyArray { 17 | 18 | @ZenMethod 19 | public static void addRecipe(IItemStack output, IItemStack input, IItemStack catalyst, @Optional String textureLocation) { 20 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(input), InputHelper.toStack(catalyst), InputHelper.toStack(output), textureLocation !=null ? new ResourceLocation(textureLocation) : null)); 21 | } 22 | 23 | @ZenMethod 24 | public static void removeRecipe(IItemStack input, IItemStack catalyst) { 25 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input), InputHelper.toStack(catalyst))); 26 | } 27 | 28 | 29 | private static class Add extends BaseAction { 30 | 31 | private ItemStack input, catalyst, output; 32 | private ResourceLocation location; 33 | 34 | public Add(ItemStack input, ItemStack catalyst, ItemStack output, ResourceLocation location) { 35 | super("AlchemyArray"); 36 | this.input = input; 37 | this.catalyst = catalyst; 38 | this.output = output; 39 | this.location = location; 40 | } 41 | 42 | @Override 43 | public void apply() { 44 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().addAlchemyArray(input, catalyst, output, location); 45 | } 46 | 47 | @Override 48 | public String describe() { 49 | return "Adding AlchemyArray Recipe input=" + input + ", catalyst=" + catalyst + ", output=" + output + ", location=" + location; 50 | } 51 | } 52 | 53 | private static class Remove extends BaseAction { 54 | 55 | private ItemStack input, catalyst; 56 | 57 | public Remove(ItemStack input, ItemStack catalyst) { 58 | super("AlchemyArray"); 59 | this.input = input; 60 | this.catalyst = catalyst; 61 | } 62 | 63 | @Override 64 | public void apply() { 65 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().removeAlchemyArray(input, catalyst); 66 | } 67 | 68 | @Override 69 | public String describe() { 70 | return "Removing AlchemyArray recipe for: " + input + " and " + catalyst; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/bloodmagic/BloodAltar.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.bloodmagic; 2 | 3 | import WayofTime.bloodmagic.api.impl.BloodMagicAPI; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.InputHelper; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.*; 8 | import crafttweaker.api.item.IItemStack; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.item.crafting.Ingredient; 11 | import stanhebben.zenscript.annotations.*; 12 | 13 | @ZenClass("mods.bloodmagic.BloodAltar") 14 | @ZenRegister 15 | @ModOnly("bloodmagic") 16 | public class BloodAltar { 17 | 18 | @ZenMethod 19 | public static void addRecipe(IItemStack output, IItemStack input, int minimumTier, int syphon, int consumeRate, int drainRate) { 20 | ModTweaker.LATE_ADDITIONS.add(new Add(Ingredient.fromStacks(InputHelper.toStack(input)), InputHelper.toStack(output), minimumTier, syphon, consumeRate, drainRate)); 21 | } 22 | 23 | @ZenMethod 24 | public static void removeRecipe(IItemStack input) { 25 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input))); 26 | } 27 | 28 | 29 | private static class Add extends BaseAction { 30 | 31 | private Ingredient input; 32 | private ItemStack output; 33 | private int minTier, syphon, consumeRate, drainRate; 34 | 35 | public Add(Ingredient input, ItemStack output, int minTier, int syphon, int consumeRate, int drainRate) { 36 | super("BloodAltar"); 37 | this.input = input; 38 | this.output = output; 39 | this.minTier = minTier; 40 | this.syphon = syphon; 41 | this.consumeRate = consumeRate; 42 | this.drainRate = drainRate; 43 | } 44 | 45 | @Override 46 | public void apply() { 47 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().addBloodAltar(input, output, minTier, syphon, consumeRate, drainRate); 48 | } 49 | 50 | @Override 51 | public String describe() { 52 | return "Adding Blood Altar recipe for: " + output + " from: " + input + " minTier: " + minTier + ", syphon: " + syphon + ", consumeRate: " + consumeRate + ", drainRate: " + drainRate; 53 | } 54 | } 55 | 56 | private static class Remove extends BaseAction { 57 | 58 | private ItemStack input; 59 | 60 | public Remove(ItemStack input) { 61 | super("BloodAltar"); 62 | this.input = input; 63 | } 64 | 65 | @Override 66 | public void apply() { 67 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().removeBloodAltar(input); 68 | } 69 | 70 | @Override 71 | public String describe() { 72 | return "Removing Blood Altar recipe for: " + input; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/Botania.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania; 2 | 3 | import com.blamejared.compat.botania.commands.BotaniaBrewLogger; 4 | import com.blamejared.compat.botania.commands.BotaniaLogger; 5 | import com.blamejared.compat.botania.commands.BotaniaOrechidLogger; 6 | import com.blamejared.compat.botania.lexicon.commands.LexiconCategoryLogger; 7 | import com.blamejared.compat.botania.lexicon.commands.LexiconEntryLogger; 8 | import com.blamejared.compat.botania.lexicon.commands.LexiconKnowledgeTypesLogger; 9 | import com.blamejared.compat.botania.lexicon.commands.LexiconPageLogger; 10 | 11 | import crafttweaker.mc1120.commands.CTChatCommand; 12 | import net.minecraft.item.ItemStack; 13 | import vazkii.botania.common.item.block.ItemBlockSpecialFlower; 14 | 15 | public class Botania { 16 | 17 | public static boolean isSubtile(ItemStack stack) { 18 | return stack.getItem() instanceof ItemBlockSpecialFlower; 19 | } 20 | 21 | public static boolean subtileMatches(ItemStack stack, ItemStack stack2) { 22 | return (ItemBlockSpecialFlower.getType(stack2).equals(ItemBlockSpecialFlower.getType(stack))); 23 | } 24 | 25 | public static void registerCommands() { 26 | CTChatCommand.registerCommand(new BotaniaBrewLogger()); 27 | CTChatCommand.registerCommand(new BotaniaLogger()); 28 | CTChatCommand.registerCommand(new BotaniaOrechidLogger()); 29 | CTChatCommand.registerCommand(new LexiconCategoryLogger()); 30 | CTChatCommand.registerCommand(new LexiconEntryLogger()); 31 | CTChatCommand.registerCommand(new LexiconKnowledgeTypesLogger()); 32 | CTChatCommand.registerCommand(new LexiconPageLogger()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/BotaniaHelper.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania; 2 | 3 | import java.util.List; 4 | 5 | import vazkii.botania.api.BotaniaAPI; 6 | import vazkii.botania.api.lexicon.KnowledgeType; 7 | import vazkii.botania.api.lexicon.LexiconCategory; 8 | import vazkii.botania.api.lexicon.LexiconEntry; 9 | 10 | public class BotaniaHelper { 11 | 12 | public static LexiconCategory findCatagory(String name) { 13 | List catagories = BotaniaAPI.getAllCategories(); 14 | for(LexiconCategory catagory : catagories) { 15 | if(catagory.getUnlocalizedName().equalsIgnoreCase(name)) 16 | return catagory; 17 | } 18 | return null; 19 | } 20 | 21 | public static LexiconEntry findEntry(String name) { 22 | List entries = BotaniaAPI.getAllEntries(); 23 | for(LexiconEntry entry : entries) { 24 | if(entry.getUnlocalizedName().equalsIgnoreCase(name)) 25 | return entry; 26 | } 27 | return null; 28 | } 29 | 30 | public static KnowledgeType findKnowledgeType(String name) { 31 | if(BotaniaAPI.knowledgeTypes.containsKey(name)) 32 | return BotaniaAPI.knowledgeTypes.get(name); 33 | return null; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/LocalizationHelper.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania; 2 | 3 | import net.minecraft.client.resources.*; 4 | 5 | import java.lang.reflect.Field; 6 | import java.util.Map; 7 | 8 | public class LocalizationHelper { 9 | 10 | @SuppressWarnings("unchecked") 11 | public static void setLocale(String unlocalized, String localized) { 12 | try { 13 | Field locale = I18n.class.getDeclaredField("i18nLocale"); 14 | locale.setAccessible(true); 15 | Locale loc = (Locale) locale.get(null); 16 | Field propMap = loc.getClass().getDeclaredField("properties"); 17 | propMap.setAccessible(true); 18 | Map map = (Map) propMap.get(loc); 19 | map.put(unlocalized, localized); 20 | } catch(Exception e) { 21 | //NO-OP people will complain if it stops translating, and this will get rid of errors on the server 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/commands/BotaniaBrewLogger.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.commands; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 5 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.server.MinecraftServer; 8 | import vazkii.botania.api.BotaniaAPI; 9 | 10 | public class BotaniaBrewLogger extends CraftTweakerCommand { 11 | 12 | public BotaniaBrewLogger() { 13 | super("botbrews"); 14 | } 15 | 16 | @Override 17 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 18 | for(String key : BotaniaAPI.brewMap.keySet()) { 19 | CraftTweakerAPI.logCommand(key); 20 | } 21 | 22 | if(sender != null) { 23 | sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); 24 | } 25 | } 26 | 27 | @Override 28 | protected void init() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/commands/BotaniaOrechidLogger.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.commands; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 5 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.server.MinecraftServer; 8 | import vazkii.botania.api.BotaniaAPI; 9 | 10 | public class BotaniaOrechidLogger extends CraftTweakerCommand { 11 | 12 | public BotaniaOrechidLogger() { 13 | super("botorechid"); 14 | } 15 | 16 | @Override 17 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 18 | 19 | for(String str : BotaniaAPI.oreWeights.keySet()) { 20 | CraftTweakerAPI.logCommand(str + ": " + BotaniaAPI.oreWeights.get(str)); 21 | } 22 | if(sender != null) { 23 | sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); 24 | } 25 | } 26 | 27 | @Override 28 | protected void init() { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/handlers/Knowledge.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.handlers; 2 | 3 | import com.blamejared.compat.botania.LocalizationHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.annotations.*; 6 | import net.minecraft.util.text.TextFormatting; 7 | import stanhebben.zenscript.annotations.*; 8 | import vazkii.botania.api.BotaniaAPI; 9 | 10 | @ZenClass("mods.botania.Knowledge") 11 | @ModOnly("botania") 12 | @ZenRegister 13 | public class Knowledge { 14 | 15 | private static final String typeName = "Botania Knowledge Variable:"; 16 | 17 | @ZenMethod 18 | public static void registerKnowledgeType(String unlocalized, String localized, String color, boolean autoUnlock) { 19 | if(unlocalized == null || unlocalized.isEmpty()) { 20 | CraftTweakerAPI.logError("Found null String in " + typeName + " name"); 21 | } else if(color == null || color.isEmpty()) { 22 | CraftTweakerAPI.logError("Found null String in " + typeName + " color"); 23 | } else { 24 | LocalizationHelper.setLocale("botania.knowledge." + unlocalized, localized); 25 | CraftTweakerAPI.apply(new Add(unlocalized, color, autoUnlock)); 26 | } 27 | } 28 | 29 | private static class Add implements IAction { 30 | 31 | String unlocalized; 32 | String color; 33 | boolean autoUnlock; 34 | 35 | public Add(String name, String color, boolean autoUnlock) { 36 | this.unlocalized = name; 37 | this.color = color; 38 | this.autoUnlock = autoUnlock; 39 | } 40 | 41 | @Override 42 | public void apply() { 43 | BotaniaAPI.registerKnowledgeType(unlocalized, TextFormatting.getValueByName(color.toUpperCase()), autoUnlock); 44 | } 45 | 46 | @Override 47 | public String describe() { 48 | String Output; 49 | if(autoUnlock) { 50 | Output = "Enabled"; 51 | } else { 52 | Output = "Disabled"; 53 | } 54 | return "Adding Knowledge Type: " + unlocalized + " With Auto-Unlock: " + Output; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/handlers/Orechid.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.handlers; 2 | 3 | import com.blamejared.ModTweaker; 4 | import crafttweaker.IAction; 5 | import crafttweaker.annotations.ModOnly; 6 | import crafttweaker.annotations.ZenRegister; 7 | import crafttweaker.api.oredict.IOreDictEntry; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | import vazkii.botania.api.BotaniaAPI; 11 | 12 | @ZenClass("mods.botania.Orechid") 13 | @ModOnly("botania") 14 | @ZenRegister 15 | public class Orechid { 16 | 17 | @ZenMethod 18 | public static void addOre(IOreDictEntry oreDict, int weight) { 19 | ModTweaker.LATE_ADDITIONS.add(new Add(oreDict.getName(), weight)); 20 | } 21 | 22 | @ZenMethod 23 | public static void addOre(String oreDict, int weight) { 24 | ModTweaker.LATE_ADDITIONS.add(new Add(oreDict, weight)); 25 | } 26 | 27 | @ZenMethod 28 | public static void removeOre(IOreDictEntry oreDict) { 29 | ModTweaker.LATE_REMOVALS.add(new Remove(oreDict.getName())); 30 | } 31 | 32 | @ZenMethod 33 | public static void removeOre(String oreDict) { 34 | ModTweaker.LATE_REMOVALS.add(new Remove(oreDict)); 35 | } 36 | 37 | 38 | private static class Add implements IAction { 39 | 40 | String oreDict; 41 | int weight; 42 | 43 | public Add(String ore, int prop) { 44 | oreDict = ore; 45 | weight = prop; 46 | } 47 | 48 | @Override 49 | public void apply() { 50 | BotaniaAPI.addOreWeight(oreDict, weight); 51 | } 52 | 53 | @Override 54 | public String describe() { 55 | return "Adding Orechid Ore Weight: " + oreDict + ":" + weight; 56 | } 57 | 58 | } 59 | 60 | private static class Remove implements IAction { 61 | 62 | String oreDict; 63 | 64 | public Remove(String ore) { 65 | oreDict = ore; 66 | } 67 | 68 | @Override 69 | public void apply() { 70 | BotaniaAPI.oreWeights.remove(oreDict); 71 | } 72 | 73 | @Override 74 | public String describe() { 75 | return "Removing Orechid Ore: " + oreDict; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/handlers/OrechidIgnem.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.handlers; 2 | 3 | import com.blamejared.ModTweaker; 4 | import crafttweaker.*; 5 | import crafttweaker.annotations.*; 6 | import crafttweaker.api.oredict.IOreDictEntry; 7 | import stanhebben.zenscript.annotations.*; 8 | import vazkii.botania.api.BotaniaAPI; 9 | 10 | @ZenClass("mods.botania.OrechidIgnem") 11 | @ModOnly("botania") 12 | @ZenRegister 13 | public class OrechidIgnem { 14 | 15 | @ZenMethod 16 | public static void addOre(IOreDictEntry oreDict, int weight) { 17 | ModTweaker.LATE_ADDITIONS.add(new Add(oreDict.getName(), weight)); 18 | } 19 | 20 | @ZenMethod 21 | public static void addOre(String oreDict, int weight) { 22 | ModTweaker.LATE_ADDITIONS.add(new Add(oreDict, weight)); 23 | } 24 | 25 | @ZenMethod 26 | public static void removeOre(IOreDictEntry oreDict) { 27 | ModTweaker.LATE_REMOVALS.add(new Remove(oreDict.getName())); 28 | } 29 | 30 | @ZenMethod 31 | public static void removeOre(String oreDict) { 32 | ModTweaker.LATE_REMOVALS.add(new Remove(oreDict)); 33 | } 34 | 35 | 36 | private static class Add implements IAction { 37 | 38 | String oreDict; 39 | int weight; 40 | 41 | public Add(String ore, int prop) { 42 | oreDict = ore; 43 | weight = prop; 44 | } 45 | 46 | @Override 47 | public void apply() { 48 | BotaniaAPI.addOreWeightNether(oreDict, weight); 49 | } 50 | 51 | @Override 52 | public String describe() { 53 | return "Adding OrechidIgnem Ore Weight: " + oreDict + ":" + weight; 54 | } 55 | 56 | } 57 | 58 | private static class Remove implements IAction { 59 | 60 | String oreDict; 61 | 62 | public Remove(String ore) { 63 | oreDict = ore; 64 | } 65 | 66 | @Override 67 | public void apply() { 68 | BotaniaAPI.oreWeightsNether.remove(oreDict); 69 | } 70 | 71 | @Override 72 | public String describe() { 73 | return "Removing Orechid Ore: " + oreDict; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/AddCategory.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import crafttweaker.IAction; 4 | import vazkii.botania.api.BotaniaAPI; 5 | import vazkii.botania.api.lexicon.LexiconCategory; 6 | 7 | public class AddCategory implements IAction { 8 | 9 | private LexiconCategory category; 10 | 11 | public AddCategory(String category) { 12 | this.category = new LexiconCategory(category); 13 | } 14 | 15 | @Override 16 | public void apply() { 17 | BotaniaAPI.addCategory(category); 18 | } 19 | 20 | @Override 21 | public String describe() { 22 | return "Adding Lexicon Category: " + category.getUnlocalizedName(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/AddEntry.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import com.blamejared.mtlib.helpers.LogHelper; 5 | import crafttweaker.*; 6 | import crafttweaker.api.item.IItemStack; 7 | import vazkii.botania.api.BotaniaAPI; 8 | import vazkii.botania.api.lexicon.*; 9 | 10 | import static com.blamejared.mtlib.helpers.InputHelper.toStack; 11 | 12 | public class AddEntry implements IAction { 13 | 14 | private String entry; 15 | private String catagory; 16 | private IItemStack stack; 17 | 18 | public AddEntry(String entry, String catagory, IItemStack stack) { 19 | this.entry = entry; 20 | this.catagory = catagory; 21 | this.stack = stack; 22 | } 23 | 24 | @Override 25 | public void apply() { 26 | LexiconCategory lexiconCategory = BotaniaHelper.findCatagory(catagory); 27 | if(lexiconCategory == null) { 28 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon category " + catagory); 29 | return; 30 | } 31 | LexiconEntry lexiconEntry = new UsefulEntry(entry, lexiconCategory); 32 | lexiconEntry.setIcon(toStack(stack)); 33 | BotaniaAPI.addEntry(lexiconEntry, lexiconEntry.category); 34 | } 35 | 36 | @Override 37 | public String describe() { 38 | return "Adding Lexicon entry: " + LogHelper.getStackDescription(entry); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/AddRecipeMapping.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import com.blamejared.mtlib.helpers.*; 5 | import crafttweaker.*; 6 | import crafttweaker.api.item.IItemStack; 7 | import vazkii.botania.api.lexicon.*; 8 | 9 | import static com.blamejared.mtlib.helpers.InputHelper.toStack; 10 | 11 | public class AddRecipeMapping implements IAction { 12 | 13 | private IItemStack stack; 14 | private String entry; 15 | private int page; 16 | 17 | public AddRecipeMapping(IItemStack stack, String entry, int page) { 18 | this.stack = stack; 19 | this.entry = entry; 20 | this.page = page; 21 | } 22 | 23 | @Override 24 | public void apply() { 25 | 26 | LexiconEntry lexiconentry = BotaniaHelper.findEntry(entry); 27 | if(LexiconRecipeMappings.getDataForStack(toStack(stack)) != null) { 28 | CraftTweakerAPI.getLogger().logError("There is already a recipe mapping for " + stack); 29 | return; 30 | } 31 | if(lexiconentry == null) { 32 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 33 | return; 34 | } 35 | if(lexiconentry.pages.size() < page) { 36 | CraftTweakerAPI.getLogger().logError("Not enough pages in " + entry); 37 | return; 38 | } 39 | 40 | LexiconRecipeMappings.map(InputHelper.toStack(stack), lexiconentry, page); 41 | } 42 | 43 | @Override 44 | public String describe() { 45 | return "Adding Lexicon Recipe Lookup: " + LogHelper.getStackDescription(stack); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/RemoveCategory.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import vazkii.botania.api.BotaniaAPI; 8 | import vazkii.botania.api.lexicon.LexiconCategory; 9 | 10 | public class RemoveCategory implements IAction { 11 | 12 | private final String name; 13 | private LexiconCategory category; 14 | 15 | public RemoveCategory(String name) { 16 | this.name = name; 17 | } 18 | 19 | @Override 20 | public void apply() { 21 | category = BotaniaHelper.findCatagory(name); 22 | if(category == null) { 23 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon category " + name); 24 | return; 25 | } 26 | BotaniaAPI.getAllCategories().remove(category); 27 | CraftTweakerAPI.getLogger().logInfo("Removing Lexicon Category: " + category.getUnlocalizedName()); 28 | } 29 | 30 | @Override 31 | public String describe() { 32 | return "Attempting to remove Lexicon Category " + name; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/RemoveEntry.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import vazkii.botania.api.BotaniaAPI; 8 | import vazkii.botania.api.lexicon.LexiconEntry; 9 | 10 | public class RemoveEntry implements IAction { 11 | 12 | private LexiconEntry lexEntry; 13 | private final String entry; 14 | 15 | public RemoveEntry(String entry) { 16 | this.entry = entry; 17 | } 18 | 19 | @Override 20 | public void apply() { 21 | lexEntry = BotaniaHelper.findEntry(entry); 22 | if(lexEntry == null) { 23 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 24 | return; 25 | } 26 | lexEntry.category.entries.remove(lexEntry); 27 | BotaniaAPI.getAllEntries().remove(lexEntry); 28 | CraftTweakerAPI.getLogger().logInfo("Removing Lexicon entry: " + lexEntry.getUnlocalizedName()); 29 | } 30 | 31 | @Override 32 | public String describe() { 33 | return "Attempting to remove Lexicon entry " + entry; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/RemovePage.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import vazkii.botania.api.lexicon.LexiconEntry; 8 | import vazkii.botania.api.lexicon.LexiconPage; 9 | 10 | public class RemovePage implements IAction { 11 | 12 | private int page_number; 13 | private LexiconEntry lexEntry; 14 | private LexiconPage page; 15 | private final String entry; 16 | 17 | public RemovePage(String entry, int page_number) { 18 | this.entry = entry; 19 | this.page_number = page_number; 20 | } 21 | 22 | @Override 23 | public void apply() { 24 | this.lexEntry = BotaniaHelper.findEntry(entry); 25 | if(lexEntry == null) { 26 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 27 | return; 28 | } 29 | if(page_number >= lexEntry.pages.size()) { 30 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 31 | return; 32 | } 33 | 34 | this.page = lexEntry.pages.get(page_number); 35 | lexEntry.pages.remove(page); 36 | CraftTweakerAPI.getLogger().logInfo("Removed Lexicon Page: " + page.getUnlocalizedName()); 37 | } 38 | 39 | @Override 40 | public String describe() { 41 | return "Attempting to remove Lexicon Page " + page_number + " from entry " + entry; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/RemoveRecipeMapping.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import static com.blamejared.mtlib.helpers.InputHelper.toStack; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import crafttweaker.api.item.IItemStack; 8 | import net.minecraft.item.ItemStack; 9 | import vazkii.botania.api.lexicon.LexiconRecipeMappings; 10 | 11 | public class RemoveRecipeMapping implements IAction { 12 | 13 | private ItemStack stack; 14 | private IItemStack iStack; 15 | 16 | public RemoveRecipeMapping(IItemStack stack) { 17 | this.iStack = stack; 18 | } 19 | 20 | @Override 21 | public void apply() { 22 | if(LexiconRecipeMappings.getDataForStack(stack = toStack(iStack)) == null) { 23 | CraftTweakerAPI.getLogger().logError("There isn't a recipe mapping for " + iStack); 24 | return; 25 | } 26 | LexiconRecipeMappings.remove(stack); 27 | CraftTweakerAPI.getLogger().logInfo("Removing Lexicon Recipe Lookup: " + stack.getUnlocalizedName()); 28 | } 29 | 30 | @Override 31 | public String describe() { 32 | return "Attempting to remove recipe mapping for " + toStack(iStack); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/SetCategoryIcon.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import net.minecraft.util.ResourceLocation; 8 | import vazkii.botania.api.lexicon.LexiconCategory; 9 | 10 | public class SetCategoryIcon implements IAction { 11 | 12 | private LexiconCategory category; 13 | private ResourceLocation newIcon; 14 | private final String name; 15 | 16 | public SetCategoryIcon(String name, String icon) { 17 | this.name = name; 18 | this.newIcon = new ResourceLocation(icon); 19 | } 20 | 21 | @Override 22 | public void apply() { 23 | category = BotaniaHelper.findCatagory(name); 24 | if(category == null) { 25 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon category " + name); 26 | return; 27 | } 28 | category.setIcon(newIcon); 29 | CraftTweakerAPI.getLogger().logInfo("Setting Lexicon Category icon: " + category.getUnlocalizedName()); 30 | } 31 | 32 | @Override 33 | public String describe() { 34 | return "Attempting to set the icon for Lexicon Category " + name + " to " + newIcon; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/SetCategoryPriority.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import vazkii.botania.api.lexicon.LexiconCategory; 8 | 9 | public class SetCategoryPriority implements IAction { 10 | 11 | private LexiconCategory category; 12 | private int oldPriority; 13 | private int newPriority; 14 | private final String name; 15 | 16 | public SetCategoryPriority(String name, int priority) { 17 | this.name = name; 18 | this.newPriority = priority; 19 | } 20 | 21 | @Override 22 | public void apply() { 23 | category = BotaniaHelper.findCatagory(name); 24 | if(category == null) { 25 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon category " + name); 26 | return; 27 | } 28 | oldPriority = category.getSortingPriority(); 29 | category.setPriority(newPriority); 30 | CraftTweakerAPI.getLogger().logInfo("Setting Lexicon Category priority from " + oldPriority + " to: " + category.getUnlocalizedName()); 31 | } 32 | 33 | @Override 34 | public String describe() { 35 | return "Attempting to set the priority for Lexicon Category " + name + " from " + oldPriority + "to " + newPriority; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/SetEntryKnowledgeType.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | import vazkii.botania.api.lexicon.KnowledgeType; 8 | import vazkii.botania.api.lexicon.LexiconEntry; 9 | 10 | public class SetEntryKnowledgeType implements IAction { 11 | 12 | LexiconEntry lexEntry; 13 | KnowledgeType newType; 14 | KnowledgeType oldType; 15 | final String entry; 16 | final String knowledgeType; 17 | 18 | public SetEntryKnowledgeType(String entry, String knowledgeType) { 19 | this.entry = entry; 20 | this.knowledgeType = knowledgeType; 21 | } 22 | 23 | @Override 24 | public void apply() { 25 | lexEntry = BotaniaHelper.findEntry(entry); 26 | newType = BotaniaHelper.findKnowledgeType(knowledgeType); 27 | if(lexEntry == null) { 28 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 29 | return; 30 | } 31 | if(newType == null) { 32 | CraftTweakerAPI.getLogger().logError("Cannot find knowledge type " + knowledgeType); 33 | return; 34 | } 35 | oldType = lexEntry.getKnowledgeType(); 36 | lexEntry.setKnowledgeType(newType); 37 | CraftTweakerAPI.getLogger().logInfo("Setting Knowledge type for: " + lexEntry.getUnlocalizedName()); 38 | } 39 | 40 | @Override 41 | public String describe() { 42 | return "Attempting to set the knowledge type for Lexicon entry " + entry + " to " + knowledgeType; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/UsefulEntry.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon; 2 | 3 | import vazkii.botania.api.lexicon.*; 4 | 5 | public class UsefulEntry extends LexiconEntry { 6 | 7 | public UsefulEntry(String unlocalizedName, LexiconCategory category) { 8 | super(unlocalizedName, category); 9 | } 10 | 11 | @Override 12 | public String getTagline() { 13 | return "botania.tagline." + super.getUnlocalizedName(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/commands/LexiconCategoryLogger.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.commands; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 5 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.server.MinecraftServer; 8 | import vazkii.botania.api.BotaniaAPI; 9 | import vazkii.botania.api.lexicon.LexiconCategory; 10 | 11 | public class LexiconCategoryLogger extends CraftTweakerCommand { 12 | 13 | public LexiconCategoryLogger() { 14 | super("botlexcats"); 15 | } 16 | 17 | @Override 18 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 19 | CraftTweakerAPI.logCommand("Botania Lexicon Categories"); 20 | for(LexiconCategory category : BotaniaAPI.getAllCategories()) { 21 | CraftTweakerAPI.logCommand(category.getUnlocalizedName()); 22 | } 23 | 24 | if(sender != null) { 25 | sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); 26 | } 27 | } 28 | 29 | @Override 30 | protected void init() { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/commands/LexiconEntryLogger.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.commands; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 7 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 8 | import net.minecraft.command.ICommandSender; 9 | import net.minecraft.server.MinecraftServer; 10 | import vazkii.botania.api.BotaniaAPI; 11 | import vazkii.botania.api.lexicon.LexiconCategory; 12 | import vazkii.botania.api.lexicon.LexiconEntry; 13 | 14 | public class LexiconEntryLogger extends CraftTweakerCommand { 15 | 16 | public LexiconEntryLogger() { 17 | super("botlexentries"); 18 | } 19 | 20 | @Override 21 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 22 | LexiconCategory category = null; 23 | if(arguments.length > 0) { 24 | category = BotaniaHelper.findCatagory(arguments[0]); 25 | if(category == null) { 26 | CraftTweakerAPI.getLogger().logError("Category not found (" + arguments[0] + ")"); 27 | return; 28 | } 29 | } 30 | CraftTweakerAPI.logCommand("Botania Lexicon Entries"); 31 | for(LexiconEntry entry : BotaniaAPI.getAllEntries()) { 32 | if(category == null || entry.category == category) { 33 | CraftTweakerAPI.logCommand(entry.getUnlocalizedName()); 34 | } 35 | } 36 | 37 | if(sender != null) { 38 | sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); 39 | } 40 | } 41 | 42 | @Override 43 | protected void init() { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/commands/LexiconKnowledgeTypesLogger.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.commands; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 5 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.server.MinecraftServer; 8 | import vazkii.botania.api.BotaniaAPI; 9 | 10 | public class LexiconKnowledgeTypesLogger extends CraftTweakerCommand { 11 | 12 | public LexiconKnowledgeTypesLogger() { 13 | super("botlextypes"); 14 | } 15 | 16 | @Override 17 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 18 | CraftTweakerAPI.logCommand("Botania Lexicon Knowledge Types"); 19 | for(String key : BotaniaAPI.knowledgeTypes.keySet()) { 20 | CraftTweakerAPI.logCommand(key); 21 | } 22 | 23 | if(sender != null) { 24 | sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); 25 | } 26 | } 27 | 28 | @Override 29 | protected void init() { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/commands/LexiconPageLogger.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.commands; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import com.blamejared.compat.botania.BotaniaHelper; 7 | 8 | import crafttweaker.CraftTweakerAPI; 9 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 10 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 11 | import net.minecraft.command.ICommandSender; 12 | import net.minecraft.server.MinecraftServer; 13 | import vazkii.botania.api.BotaniaAPI; 14 | import vazkii.botania.api.lexicon.LexiconEntry; 15 | import vazkii.botania.api.lexicon.LexiconPage; 16 | 17 | public class LexiconPageLogger extends CraftTweakerCommand { 18 | 19 | public LexiconPageLogger() { 20 | super("botlexpages"); 21 | } 22 | 23 | @Override 24 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 25 | LexiconEntry entry = null; 26 | if(arguments.length > 0) { 27 | entry = BotaniaHelper.findEntry(arguments[0]); 28 | if(entry == null) { 29 | CraftTweakerAPI.getLogger().logError("Entry not found (" + arguments[0] + ")"); 30 | return; 31 | } 32 | } 33 | List pages = new ArrayList<>(); 34 | if(entry != null) 35 | pages.addAll(entry.pages); 36 | else 37 | for(LexiconEntry current_Entry : BotaniaAPI.getAllEntries()) 38 | pages.addAll(current_Entry.pages); 39 | 40 | CraftTweakerAPI.logCommand("Botania Lexicon Pages"); 41 | for(LexiconPage page : pages) { 42 | CraftTweakerAPI.logCommand(page.getUnlocalizedName() + " (" + page.getClass() + ")"); 43 | } 44 | 45 | if(sender != null) { 46 | sender.sendMessage(SpecialMessagesChat.getLinkToCraftTweakerLog("List generated;", sender)); 47 | } 48 | } 49 | 50 | @Override 51 | protected void init() { 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageAlchemy.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.*; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.api.recipe.RecipeManaInfusion; 8 | import vazkii.botania.common.lexicon.page.PageManaInfusionRecipe; 9 | 10 | import java.util.*; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.*; 13 | 14 | public class AddPageAlchemy implements IAction { 15 | 16 | private String name; 17 | private String entry; 18 | private int page_number; 19 | private IItemStack[] outputs; 20 | private IIngredient[] inputs; 21 | private int[] mana; 22 | 23 | 24 | public AddPageAlchemy(String name, String entry, int page_number, IItemStack[] outputs, IIngredient[] inputs, int[] mana) { 25 | this.name = name; 26 | this.entry = entry; 27 | this.page_number = page_number; 28 | this.outputs = outputs; 29 | this.inputs = inputs; 30 | this.mana = mana; 31 | } 32 | 33 | @Override 34 | public void apply() { 35 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 36 | if(lexiconEntry == null) { 37 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 38 | return; 39 | } 40 | if(page_number > lexiconEntry.pages.size()) { 41 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 42 | return; 43 | } 44 | if(outputs.length != inputs.length || outputs.length != mana.length) { 45 | CraftTweakerAPI.getLogger().logError("Length of input and output must match"); 46 | return; 47 | } 48 | List recipes = new ArrayList<>(); 49 | for(int i = 0; i < outputs.length; i++) { 50 | RecipeManaInfusion current_recipe = new RecipeManaInfusion(toStack(outputs[i]), toObject(inputs[i]), mana[i]); 51 | current_recipe.setCatalyst(RecipeManaInfusion.alchemyState); 52 | recipes.add(current_recipe); 53 | } 54 | LexiconPage page = new PageManaInfusionRecipe(name, recipes); 55 | lexiconEntry.pages.add(page_number, page); 56 | } 57 | 58 | @Override 59 | public String describe() { 60 | return "Adding Lexicon Page: " + name; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageBrew.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.IIngredient; 6 | import vazkii.botania.api.BotaniaAPI; 7 | import vazkii.botania.api.lexicon.LexiconEntry; 8 | import vazkii.botania.api.lexicon.LexiconPage; 9 | import vazkii.botania.api.recipe.RecipeBrew; 10 | import vazkii.botania.common.lexicon.page.PageBrew; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.toObjects; 13 | 14 | public class AddPageBrew implements IAction { 15 | 16 | private String name; 17 | private String entry; 18 | private int page_number; 19 | private String brew; 20 | private IIngredient[] recipe; 21 | private String bottomText; 22 | 23 | public AddPageBrew(String name, String entry, int page_number, String brew, IIngredient[] recipe, String bottomText) { 24 | this.name = name; 25 | this.entry = entry; 26 | this.page_number = page_number; 27 | this.brew = brew; 28 | this.recipe = recipe; 29 | this.bottomText = bottomText; 30 | } 31 | 32 | @Override 33 | public void apply() { 34 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 35 | if(lexiconEntry == null) { 36 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 37 | return; 38 | } 39 | if(page_number > lexiconEntry.pages.size()) { 40 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 41 | return; 42 | } 43 | if(BotaniaAPI.getBrewFromKey(brew) == null) { 44 | CraftTweakerAPI.getLogger().logError("Cannot find brew " + brew); 45 | return; 46 | } 47 | RecipeBrew page_recipe = new RecipeBrew(BotaniaAPI.getBrewFromKey(brew), toObjects(recipe)); 48 | LexiconPage page = new PageBrew(page_recipe, name, bottomText); 49 | lexiconEntry.pages.add(page_number, page); 50 | } 51 | 52 | @Override 53 | public String describe() { 54 | return "Adding Lexicon Page: " + name; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageConjuration.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.*; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.api.recipe.RecipeManaInfusion; 8 | import vazkii.botania.common.lexicon.page.PageManaInfusionRecipe; 9 | 10 | import java.util.*; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.*; 13 | 14 | public class AddPageConjuration implements IAction { 15 | 16 | private String name; 17 | private String entry; 18 | private int page_number; 19 | private IItemStack[] outputs; 20 | private IIngredient[] inputs; 21 | private int[] mana; 22 | 23 | 24 | public AddPageConjuration(String name, String entry, int page_number, IItemStack[] outputs, IIngredient[] inputs, int[] mana) { 25 | this.name = name; 26 | this.entry = entry; 27 | this.page_number = page_number; 28 | this.outputs = outputs; 29 | this.inputs = inputs; 30 | this.mana = mana; 31 | } 32 | 33 | @Override 34 | public void apply() { 35 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 36 | if(lexiconEntry == null) { 37 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 38 | return; 39 | } 40 | if(page_number > lexiconEntry.pages.size()) { 41 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 42 | return; 43 | } 44 | if(outputs.length != inputs.length || outputs.length != mana.length) { 45 | CraftTweakerAPI.getLogger().logError("Length of input and output must match"); 46 | return; 47 | } 48 | List recipes = new ArrayList<>(); 49 | for(int i = 0; i < outputs.length; i++) { 50 | RecipeManaInfusion current_recipe = new RecipeManaInfusion(toStack(outputs[i]), toObject(inputs[i]), mana[i]); 51 | current_recipe.setCatalyst(RecipeManaInfusion.conjurationState); 52 | recipes.add(current_recipe); 53 | } 54 | LexiconPage page = new PageManaInfusionRecipe(name, recipes); 55 | lexiconEntry.pages.add(page_number, page); 56 | } 57 | 58 | @Override 59 | public String describe() { 60 | return "Adding Lexicon Page: " + name; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageCrafting.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import net.minecraft.util.ResourceLocation; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.common.lexicon.page.*; 8 | 9 | import java.util.*; 10 | 11 | public class AddPageCrafting implements IAction { 12 | 13 | private String name; 14 | private String entry; 15 | private int page_number; 16 | private String[] recipeNames; 17 | 18 | 19 | public AddPageCrafting(String name, String entry, int page_number, String[] recipeNames) { 20 | this.name = name; 21 | this.entry = entry; 22 | this.page_number = page_number; 23 | this.recipeNames = recipeNames; 24 | } 25 | 26 | @Override 27 | public void apply() { 28 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 29 | if(lexiconEntry == null) { 30 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 31 | return; 32 | } 33 | if(page_number > lexiconEntry.pages.size()) { 34 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 35 | return; 36 | } 37 | List recipes = new ArrayList<>(); 38 | for(String s : recipeNames) { 39 | recipes.add(new ResourceLocation(s)); 40 | } 41 | LexiconPage page = new PageCraftingRecipe(name, recipes); 42 | lexiconEntry.pages.add(page_number, page); 43 | } 44 | 45 | @Override 46 | public String describe() { 47 | return "Adding Lexicon Page: " + name; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageElven.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.*; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.api.recipe.*; 8 | import vazkii.botania.common.lexicon.page.*; 9 | 10 | import java.util.*; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.toObjects; 13 | import static com.blamejared.mtlib.helpers.InputHelper.toStacks; 14 | 15 | public class AddPageElven implements IAction { 16 | 17 | private String name; 18 | private String entry; 19 | private int page_number; 20 | private IItemStack[] outputs; 21 | private IIngredient[][] inputs; 22 | 23 | public AddPageElven(String name, String entry, int page_number, IItemStack[] outputs, IIngredient[][] inputs) { 24 | this.name = name; 25 | this.entry = entry; 26 | this.page_number = page_number; 27 | this.outputs = outputs; 28 | this.inputs = inputs; 29 | } 30 | 31 | @Override 32 | public void apply() { 33 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 34 | if(lexiconEntry == null) { 35 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 36 | return; 37 | } 38 | if(page_number > lexiconEntry.pages.size()) { 39 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 40 | return; 41 | } 42 | if(outputs.length != inputs.length) { 43 | CraftTweakerAPI.getLogger().logError("Length of input and output must match"); 44 | return; 45 | } 46 | List recipes = new ArrayList<>(); 47 | for(int i = 0; i < outputs.length; i++) { 48 | //TODO test 49 | recipes.add(new RecipeElvenTrade(toStacks(outputs), toObjects(inputs[i]))); 50 | } 51 | 52 | LexiconPage page = new PageElvenRecipe(name, recipes); 53 | lexiconEntry.pages.add(page_number, page); 54 | } 55 | 56 | @Override 57 | public String describe() { 58 | return "Adding Lexicon Page: " + name; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageEntity.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import net.minecraft.entity.EntityList; 6 | import net.minecraft.util.ResourceLocation; 7 | import vazkii.botania.api.lexicon.*; 8 | import vazkii.botania.common.lexicon.page.*; 9 | 10 | public class AddPageEntity implements IAction { 11 | 12 | private String name; 13 | private String entry; 14 | private int page_number; 15 | private String entity; 16 | private int size; 17 | 18 | public AddPageEntity(String name, String entry, int page_number, String entity, int size) { 19 | this.name = name; 20 | this.entry = entry; 21 | this.page_number = page_number; 22 | this.entity = entity; 23 | this.size = size; 24 | } 25 | 26 | @Override 27 | public void apply() { 28 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 29 | if(lexiconEntry == null) { 30 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 31 | return; 32 | } 33 | if(page_number > lexiconEntry.pages.size()) { 34 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 35 | return; 36 | } 37 | if(!EntityList.isRegistered(new ResourceLocation(entity))) { 38 | CraftTweakerAPI.getLogger().logError("No such entity " + entity); 39 | return; 40 | } 41 | LexiconPage page = new PageEntity(entity, entity, size); 42 | lexiconEntry.pages.add(page_number, page); 43 | } 44 | 45 | @Override 46 | public String describe() { 47 | return "Adding Lexicon Page: " + name; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageImage.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import vazkii.botania.api.lexicon.*; 6 | import vazkii.botania.common.lexicon.page.*; 7 | 8 | public class AddPageImage implements IAction { 9 | 10 | private String name; 11 | private String entry; 12 | private int page_number; 13 | private String resource; 14 | 15 | public AddPageImage(String name, String entry, int page_number, String resource) { 16 | this.name = name; 17 | this.entry = entry; 18 | this.page_number = page_number; 19 | this.resource = resource; 20 | } 21 | 22 | @Override 23 | public void apply() { 24 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 25 | if(lexiconEntry == null) { 26 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 27 | return; 28 | } 29 | if(page_number > lexiconEntry.pages.size()) { 30 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 31 | return; 32 | } 33 | LexiconPage page = new PageImage(name, resource); 34 | lexiconEntry.pages.add(page_number, page); 35 | } 36 | 37 | @Override 38 | public String describe() { 39 | return "Adding Lexicon Page: " + name; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageInfusion.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.*; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.api.recipe.RecipeManaInfusion; 8 | import vazkii.botania.common.lexicon.page.*; 9 | 10 | import java.util.*; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.toObject; 13 | import static com.blamejared.mtlib.helpers.InputHelper.toStack; 14 | 15 | public class AddPageInfusion implements IAction { 16 | 17 | private String name; 18 | private String entry; 19 | private int page_number; 20 | private IItemStack[] outputs; 21 | private IIngredient[] inputs; 22 | private int[] mana; 23 | 24 | 25 | public AddPageInfusion(String name, String entry, int page_number, IItemStack[] outputs, IIngredient[] inputs, int[] mana) { 26 | this.name = name; 27 | this.entry = entry; 28 | this.page_number = page_number; 29 | this.outputs = outputs; 30 | this.inputs = inputs; 31 | this.mana = mana; 32 | } 33 | 34 | @Override 35 | public void apply() { 36 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 37 | if(lexiconEntry == null) { 38 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 39 | return; 40 | } 41 | if(page_number > lexiconEntry.pages.size()) { 42 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 43 | return; 44 | } 45 | if(outputs.length != inputs.length || outputs.length != mana.length) { 46 | CraftTweakerAPI.getLogger().logError("Length of input and output must match"); 47 | return; 48 | } 49 | List recipes = new ArrayList<>(); 50 | for(int i = 0; i < outputs.length; i++) { 51 | recipes.add(new RecipeManaInfusion(toStack(outputs[i]), toObject(inputs[i]), mana[i])); 52 | } 53 | LexiconPage page = new PageManaInfusionRecipe(name, recipes); 54 | lexiconEntry.pages.add(page_number, page); 55 | } 56 | 57 | @Override 58 | public String describe() { 59 | return "Adding Lexicon Page: " + name; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageLore.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import vazkii.botania.api.lexicon.*; 6 | import vazkii.botania.common.lexicon.page.*; 7 | 8 | public class AddPageLore implements IAction { 9 | 10 | private String name; 11 | private String entry; 12 | private int page_number; 13 | 14 | public AddPageLore(String name, String entry, int page_number) { 15 | this.name = name; 16 | this.entry = entry; 17 | this.page_number = page_number; 18 | } 19 | 20 | @Override 21 | public void apply() { 22 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 23 | if(lexiconEntry == null) { 24 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 25 | return; 26 | } 27 | if(page_number > lexiconEntry.pages.size()) { 28 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 29 | return; 30 | } 31 | LexiconPage page = new PageLoreText(name); 32 | lexiconEntry.pages.add(page_number, page); 33 | } 34 | 35 | @Override 36 | public String describe() { 37 | return "Adding Lexicon Page: " + name; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPagePetal.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.*; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.api.recipe.*; 8 | import vazkii.botania.common.lexicon.page.*; 9 | 10 | import java.util.*; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.*; 13 | 14 | public class AddPagePetal implements IAction { 15 | 16 | private String name; 17 | private String entry; 18 | private int page_number; 19 | private IItemStack[] outputs; 20 | private IIngredient[][] inputs; 21 | 22 | 23 | public AddPagePetal(String name, String entry, int page_number, IItemStack[] outputs, IIngredient[][] inputs) { 24 | this.name = name; 25 | this.entry = entry; 26 | this.page_number = page_number; 27 | this.outputs = outputs; 28 | this.inputs = inputs; 29 | } 30 | 31 | @Override 32 | public void apply() { 33 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 34 | if(lexiconEntry == null) { 35 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 36 | return; 37 | } 38 | if(page_number > lexiconEntry.pages.size()) { 39 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 40 | return; 41 | } 42 | if(outputs.length != inputs.length) { 43 | CraftTweakerAPI.getLogger().logError("Length of input and output must match"); 44 | return; 45 | } 46 | List recipes = new ArrayList<>(); 47 | for(int i = 0; i < outputs.length; i++) { 48 | recipes.add(new RecipePetals(toStack(outputs[i]), toObjects(inputs[i]))); 49 | } 50 | LexiconPage page = new PagePetalRecipe<>(name, recipes); 51 | lexiconEntry.pages.add(page_number, page); 52 | } 53 | 54 | @Override 55 | public String describe() { 56 | return "Adding Lexicon Page: " + name; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageRune.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import crafttweaker.api.item.*; 6 | import vazkii.botania.api.lexicon.*; 7 | import vazkii.botania.api.recipe.*; 8 | import vazkii.botania.common.lexicon.page.*; 9 | 10 | import java.util.*; 11 | 12 | import static com.blamejared.mtlib.helpers.InputHelper.*; 13 | 14 | public class AddPageRune implements IAction { 15 | 16 | private String name; 17 | private String entry; 18 | private int page_number; 19 | private IItemStack[] outputs; 20 | private IIngredient[][] inputs; 21 | private int[] mana; 22 | 23 | 24 | public AddPageRune(String name, String entry, int page_number, IItemStack[] outputs, IIngredient[][] inputs, int[] mana) { 25 | this.name = name; 26 | this.entry = entry; 27 | this.page_number = page_number; 28 | this.outputs = outputs; 29 | this.inputs = inputs; 30 | this.mana = mana; 31 | } 32 | 33 | @Override 34 | public void apply() { 35 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 36 | if(lexiconEntry == null) { 37 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 38 | return; 39 | } 40 | if(page_number > lexiconEntry.pages.size()) { 41 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 42 | return; 43 | } 44 | if(outputs.length != inputs.length || outputs.length != mana.length) { 45 | CraftTweakerAPI.getLogger().logError("Length of input and output must match"); 46 | return; 47 | } 48 | List recipes = new ArrayList<>(); 49 | for(int i = 0; i < outputs.length; i++) { 50 | recipes.add(new RecipeRuneAltar(toStack(outputs[i]), mana[i], toObjects(inputs[i]))); 51 | } 52 | LexiconPage page = new PageRuneRecipe(name, recipes); 53 | lexiconEntry.pages.add(page_number, page); 54 | } 55 | 56 | @Override 57 | public String describe() { 58 | return "Adding Lexicon Page: " + name; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/botania/lexicon/pages/AddPageText.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.botania.lexicon.pages; 2 | 3 | import com.blamejared.compat.botania.BotaniaHelper; 4 | import crafttweaker.*; 5 | import vazkii.botania.api.lexicon.*; 6 | import vazkii.botania.common.lexicon.page.*; 7 | 8 | public class AddPageText implements IAction { 9 | 10 | private String name; 11 | private String entry; 12 | private int page_number; 13 | 14 | public AddPageText(String name, String entry, int page_number) { 15 | this.name = name; 16 | this.entry = entry; 17 | this.page_number = page_number; 18 | } 19 | 20 | @Override 21 | public void apply() { 22 | LexiconEntry lexiconEntry = BotaniaHelper.findEntry(entry); 23 | if(lexiconEntry == null) { 24 | CraftTweakerAPI.getLogger().logError("Cannot find lexicon entry " + entry); 25 | return; 26 | } 27 | if(page_number > lexiconEntry.pages.size()) { 28 | CraftTweakerAPI.getLogger().logError("Page Number " + page_number + " out of bounds for " + entry); 29 | return; 30 | } 31 | LexiconPage page = new PageText(name); 32 | lexiconEntry.pages.add(page_number, page); 33 | } 34 | 35 | @Override 36 | public String describe() { 37 | return "Adding Lexicon Page: " + name; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/chisel/Chisel.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.chisel; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.mc1120.commands.*; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.server.MinecraftServer; 7 | import team.chisel.api.carving.CarvingUtils; 8 | 9 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.*; 10 | 11 | public class Chisel { 12 | 13 | 14 | public static void registerCommands(){ 15 | CTChatCommand.registerCommand(new CraftTweakerCommand("chiselGroups") { 16 | 17 | @Override 18 | protected void init() { 19 | setDescription(getClickableCommandText("\u00A72/ct chiselGroups", "/ct chiselGroups", true), getNormalMessage(" \u00A73Dumps all the Chisel group names to the crafttweaker log")); 20 | } 21 | 22 | @Override 23 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) { 24 | CraftTweakerAPI.logCommand("Chisel Group Names:"); 25 | CarvingUtils.getChiselRegistry().getSortedGroupNames().forEach(str -> CraftTweakerAPI.logCommand("- " + str)); 26 | sender.sendMessage(getLinkToCraftTweakerLog("Chisel Group Names list generated", sender)); 27 | } 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/immersivetech/Boiler.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.immersivetech; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.InputHelper; 5 | import com.blamejared.mtlib.utils.BaseAction; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.liquid.ILiquidStack; 9 | import ferro2000.immersivetech.api.craftings.BoilerRecipes; 10 | import net.minecraftforge.fluids.FluidStack; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | @ZenClass("mods.immersivetech.Boiler") 15 | @ZenRegister 16 | @ModOnly("immersivetech") 17 | public class Boiler { 18 | 19 | @ZenMethod 20 | public static void addRecipe(ILiquidStack output, ILiquidStack input, int time) { 21 | if( input.getAmount() > 1000 ) { 22 | throw new IllegalArgumentException("Cannot have a fluid input amount greater than 1000 mb, or else the Boiler won't accept the liquid!"); 23 | } 24 | 25 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(output), InputHelper.toFluid(input), time)); 26 | } 27 | 28 | @ZenMethod 29 | public static void removeRecipe(ILiquidStack input) { 30 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(input))); 31 | } 32 | 33 | private static class Add extends BaseAction { 34 | 35 | private FluidStack output; 36 | private FluidStack input; 37 | private int time; 38 | 39 | public Add(FluidStack output, FluidStack input, int time) { 40 | super("Boiler"); 41 | this.output = output; 42 | this.input = input; 43 | this.time = time; 44 | } 45 | 46 | @Override 47 | public void apply() { 48 | BoilerRecipes.addRecipe(output, input, time); 49 | } 50 | 51 | @Override 52 | public String describe() { 53 | return "Adding Boiler recipe for: " + output + " from: " + input + " time: " + time; 54 | } 55 | } 56 | 57 | private static class Remove extends BaseAction { 58 | 59 | private FluidStack input; 60 | 61 | public Remove(FluidStack input) { 62 | super("Boiler"); 63 | this.input = input.copy(); 64 | this.input.amount = Integer.MAX_VALUE; 65 | } 66 | 67 | @Override 68 | public void apply() { 69 | BoilerRecipes.recipeList.remove(BoilerRecipes.findRecipe(this.input)); 70 | } 71 | 72 | @Override 73 | public String describe() { 74 | return "Removing Boiler recipe for: " + input; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/immersivetech/SolarTower.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.immersivetech; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.InputHelper; 5 | import com.blamejared.mtlib.utils.BaseAction; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.liquid.ILiquidStack; 9 | import ferro2000.immersivetech.api.craftings.SolarTowerRecipes; 10 | import net.minecraftforge.fluids.FluidStack; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | @ZenClass("mods.immersivetech.SolarTower") 15 | @ZenRegister 16 | @ModOnly("immersivetech") 17 | public class SolarTower { 18 | 19 | @ZenMethod 20 | public static void addRecipe(ILiquidStack output, ILiquidStack input, int time) { 21 | if( input.getAmount() > 1000 ) { 22 | throw new IllegalArgumentException("Cannot have a fluid input amount greater than 1000 mb, or else the Solar Tower won't accept the liquid!"); 23 | } 24 | 25 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(output), InputHelper.toFluid(input), time)); 26 | } 27 | 28 | @ZenMethod 29 | public static void removeRecipe(ILiquidStack input) { 30 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(input))); 31 | } 32 | 33 | private static class Add extends BaseAction { 34 | 35 | private FluidStack output; 36 | private FluidStack input; 37 | private int time; 38 | 39 | public Add(FluidStack output, FluidStack input, int time) { 40 | super("SolarTower"); 41 | this.output = output; 42 | this.input = input; 43 | this.time = time; 44 | } 45 | 46 | @Override 47 | public void apply() { 48 | SolarTowerRecipes.addRecipe(output, input, time); 49 | } 50 | 51 | @Override 52 | public String describe() { 53 | return "Adding Solar Tower recipe for: " + output + " from: " + input + " time: " + time; 54 | } 55 | } 56 | 57 | private static class Remove extends BaseAction { 58 | 59 | private FluidStack input; 60 | 61 | public Remove(FluidStack input) { 62 | super("SolarTower"); 63 | this.input = input.copy(); 64 | this.input.amount = Integer.MAX_VALUE; 65 | } 66 | 67 | @Override 68 | public void apply() { 69 | SolarTowerRecipes.recipeList.remove(SolarTowerRecipes.findRecipe(this.input)); 70 | } 71 | 72 | @Override 73 | public String describe() { 74 | return "Removing Solar Tower recipe for: " + input; 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/immersivetech/SteamTurbine.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.immersivetech; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.InputHelper; 5 | import com.blamejared.mtlib.utils.BaseAction; 6 | import crafttweaker.annotations.ModOnly; 7 | import crafttweaker.annotations.ZenRegister; 8 | import crafttweaker.api.liquid.ILiquidStack; 9 | import ferro2000.immersivetech.api.energy.SteamHandler; 10 | import net.minecraftforge.fluids.FluidStack; 11 | import stanhebben.zenscript.annotations.ZenClass; 12 | import stanhebben.zenscript.annotations.ZenMethod; 13 | 14 | @ZenClass("mods.immersivetech.SteamTurbine") 15 | @ZenRegister 16 | @ModOnly("immersivetech") 17 | public class SteamTurbine { 18 | 19 | @ZenMethod 20 | public static void registerSteam(ILiquidStack input, int burnTime) { 21 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(input), burnTime)); 22 | } 23 | 24 | @ZenMethod 25 | public static void removeSteam(ILiquidStack input) { 26 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(input))); 27 | } 28 | 29 | private static class Add extends BaseAction { 30 | 31 | private FluidStack input; 32 | private int time; 33 | 34 | public Add(FluidStack input, int time) { 35 | super("SteamTurbine"); 36 | this.input = input; 37 | this.time = time; 38 | } 39 | 40 | @Override 41 | public void apply() { 42 | SteamHandler.registerSteam(input.getFluid(), time); 43 | } 44 | 45 | @Override 46 | public String describe() { 47 | return "Registering Steam Turbine steam: " + input + " burn time: " + time; 48 | } 49 | } 50 | 51 | private static class Remove extends BaseAction { 52 | 53 | private FluidStack input; 54 | 55 | public Remove(FluidStack input) { 56 | super("SteamTurbine"); 57 | this.input = input; 58 | } 59 | 60 | @Override 61 | public void apply() { 62 | SteamHandler.getSteamValues().remove(input.getFluid().getName()); 63 | } 64 | 65 | @Override 66 | public String describe() { 67 | return "Removing Steam Turbine steam: " + input; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/inspirations/Inspirations.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.inspirations; 2 | 3 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.getClickableCommandText; 4 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.getLinkToCraftTweakerLog; 5 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.getNormalMessage; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | import java.util.TreeSet; 10 | 11 | import crafttweaker.CraftTweakerAPI; 12 | import crafttweaker.mc1120.commands.CTChatCommand; 13 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 14 | import net.minecraft.command.ICommandSender; 15 | import net.minecraft.item.EnumDyeColor; 16 | import net.minecraft.potion.PotionType; 17 | import net.minecraft.server.MinecraftServer; 18 | import net.minecraft.util.ResourceLocation; 19 | import net.minecraft.util.text.TextComponentString; 20 | 21 | public class Inspirations { 22 | 23 | public static void registerCommands() { 24 | CTChatCommand.registerCommand(new CraftTweakerCommand("inspirations") { 25 | 26 | @Override 27 | protected void init() { 28 | setDescription(getClickableCommandText("\u00A72/ct inspirations {dyes|potions}", "/ct inspirations {dyes|potions}", false), 29 | getNormalMessage(" \u00A73Dumps all the dye names or potion type resource locations to the log")); 30 | } 31 | 32 | @Override 33 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] arguments) { 34 | List args = Arrays.asList(arguments); 35 | if(args.contains("dyes")) { 36 | CraftTweakerAPI.logCommand("Inspirations Dye Colors:"); 37 | for(EnumDyeColor dye : EnumDyeColor.values()) { 38 | CraftTweakerAPI.logCommand(dye.getName()); 39 | } 40 | } else if(args.contains("potions")) { 41 | CraftTweakerAPI.logCommand("Inspirations Potion Types:"); 42 | // ensure the potion names are sorted 43 | for(ResourceLocation potion : new TreeSet<>(PotionType.REGISTRY.getKeys())) { 44 | CraftTweakerAPI.logCommand(potion.toString()); 45 | } 46 | } else { 47 | if(sender != null) { 48 | sender.sendMessage(new TextComponentString("Invalid arguments for command. Valid arguments: dyes, potions")); 49 | } 50 | } 51 | 52 | if(sender != null) { 53 | sender.sendMessage(getLinkToCraftTweakerLog("List generated;", sender)); 54 | } 55 | } 56 | }); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/mantle/RecipeMatchIIngredient.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.mantle; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.Optional; 6 | import java.util.stream.Collectors; 7 | 8 | import com.google.common.collect.Lists; 9 | 10 | import crafttweaker.api.item.IIngredient; 11 | import crafttweaker.api.minecraft.CraftTweakerMC; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.util.NonNullList; 14 | import slimeknights.mantle.util.RecipeMatch; 15 | 16 | public class RecipeMatchIIngredient extends RecipeMatch { 17 | private IIngredient ingredient; 18 | private List items; 19 | public RecipeMatchIIngredient(IIngredient ingredient) { 20 | this(ingredient, 1); 21 | } 22 | 23 | public RecipeMatchIIngredient(IIngredient ingredient, int amountMatched) { 24 | super(amountMatched, ingredient.getAmount()); 25 | this.ingredient = ingredient; 26 | } 27 | 28 | @Override 29 | public List getInputs() { 30 | if(items != null) { 31 | return items; 32 | } 33 | return items = Arrays.stream(ingredient.getItemArray()).map(CraftTweakerMC::getItemStack).collect(Collectors.toList()); 34 | } 35 | 36 | @Override 37 | public Optional matches(NonNullList stacks) { 38 | List found = Lists.newLinkedList(); 39 | int stillNeeded = amountNeeded; 40 | 41 | for(ItemStack stack : stacks) { 42 | if(ingredient.matches(CraftTweakerMC.getIItemStack(stack))) { 43 | // add the amount found to the list 44 | ItemStack copy = stack.copy(); 45 | copy.setCount(Math.min(copy.getCount(), stillNeeded)); 46 | found.add(copy); 47 | stillNeeded -= copy.getCount(); 48 | 49 | // we found enough 50 | if(stillNeeded <= 0) { 51 | return Optional.of(new Match(found, amountMatched)); 52 | } 53 | } 54 | } 55 | return Optional.empty(); 56 | } 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/refinedstorage/Solderer.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.refinedstorage; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.annotations.ModOnly; 5 | import crafttweaker.annotations.ZenRegister; 6 | import crafttweaker.api.item.IItemStack; 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | import stanhebben.zenscript.annotations.ZenMethod; 9 | 10 | //TODO - remove aas the solderer doesn't exist any more 11 | 12 | @ZenClass("mods.refinedstorage.Solderer") 13 | @ModOnly("refinedstorage") 14 | @ZenRegister 15 | @Deprecated 16 | public class Solderer { 17 | 18 | 19 | @ZenMethod 20 | @Deprecated 21 | public static void addRecipe(String name, IItemStack output, int time, IItemStack[] rows) { 22 | CraftTweakerAPI.logError("The solderer has been removed from refined storage in 1.6, nothing to do"); 23 | } 24 | 25 | @ZenMethod 26 | @Deprecated 27 | public static void removeRecipe(IItemStack output) { 28 | CraftTweakerAPI.logError("The solderer has been removed from refined storage in 1.6, nothing to do"); 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tcomplement/highoven/recipes/HeatRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tcomplement.highoven.recipes; 2 | 3 | import javax.annotation.Nonnull; 4 | 5 | import knightminer.tcomplement.library.steelworks.HeatRecipe; 6 | import net.minecraftforge.fluids.FluidStack; 7 | 8 | public class HeatRecipeTweaker extends HeatRecipe { 9 | 10 | public HeatRecipeTweaker(@Nonnull FluidStack input, @Nonnull FluidStack output, int temp) { 11 | super(input, output, temp); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tcomplement/highoven/recipes/HighOvenFuelTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tcomplement.highoven.recipes; 2 | 3 | import knightminer.tcomplement.library.steelworks.HighOvenFuel; 4 | import slimeknights.mantle.util.RecipeMatch; 5 | 6 | public class HighOvenFuelTweaker extends HighOvenFuel { 7 | 8 | public HighOvenFuelTweaker(RecipeMatch fuel, int time, int rate) { 9 | super(fuel, time, rate); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tcomplement/highoven/recipes/MixRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tcomplement.highoven.recipes; 2 | 3 | import javax.annotation.Nonnull; 4 | import net.minecraftforge.fluids.FluidStack; 5 | import knightminer.tcomplement.library.steelworks.MixRecipe; 6 | 7 | public class MixRecipeTweaker extends MixRecipe { 8 | public MixRecipeTweaker(@Nonnull FluidStack input, @Nonnull FluidStack output, int temp) { 9 | super(input, output, temp); 10 | } 11 | 12 | public MixRecipeTweaker(@Nonnull FluidStack input, @Nonnull FluidStack output) { 13 | super(input, output); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/Fuel.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.*; 5 | import com.blamejared.mtlib.utils.BaseAction; 6 | import crafttweaker.annotations.*; 7 | import crafttweaker.api.liquid.ILiquidStack; 8 | import net.minecraftforge.fluids.FluidStack; 9 | import slimeknights.tconstruct.library.TinkerRegistry; 10 | import stanhebben.zenscript.annotations.*; 11 | 12 | @ZenClass("mods.tconstruct.Fuel") 13 | @ZenRegister 14 | @ModOnly("tconstruct") 15 | public class Fuel { 16 | 17 | 18 | @ZenMethod 19 | public static void registerFuel(ILiquidStack fluid, int duration) { 20 | ModTweaker.LATE_ADDITIONS.add(new Fuel.Add(InputHelper.toFluid(fluid), duration)); 21 | } 22 | 23 | private static class Add extends BaseAction { 24 | 25 | private FluidStack fuel; 26 | private int duration; 27 | 28 | public Add(FluidStack fuel, int temp) { 29 | super("Fuel"); 30 | this.fuel = fuel; 31 | this.duration = temp; 32 | } 33 | 34 | @Override 35 | public void apply() { 36 | TinkerRegistry.registerSmelteryFuel(fuel, duration); 37 | 38 | } 39 | 40 | @Override 41 | protected String getRecipeInfo() { 42 | return LogHelper.getStackDescription(fuel); 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/TConstruct.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.mc1120.commands.*; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraft.util.text.TextFormatting; 8 | import slimeknights.tconstruct.library.TinkerRegistry; 9 | import slimeknights.tconstruct.library.materials.*; 10 | 11 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.*; 12 | 13 | public class TConstruct { 14 | 15 | public static void registerCommands() { 16 | CTChatCommand.registerCommand(new CraftTweakerCommand("ticmat") { 17 | 18 | @Override 19 | protected void init() { 20 | setDescription(getClickableCommandText("\u00A72/ct ticmat", "/ct ticmat", true), getNormalMessage(" \u00A73Dumps all the Tinkers Construct material names to the crafttweaker log")); 21 | } 22 | 23 | @Override 24 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) { 25 | CraftTweakerAPI.logCommand("Tinkers Construct Materials:"); 26 | for(Material material : TinkerRegistry.getAllMaterials()) { 27 | StringBuilder builder = new StringBuilder("-").append(material.identifier).append("\n"); 28 | for(IMaterialStats stats : material.getAllStats()) { 29 | for(String s : stats.getLocalizedInfo()) { 30 | builder.append(s.replaceAll(TextFormatting.RESET.toString(), "").replaceAll("[^\\x00-\\x7F]", "")).append("\n"); 31 | } 32 | 33 | } 34 | CraftTweakerAPI.logCommand(builder.toString()); 35 | } 36 | 37 | sender.sendMessage(getLinkToCraftTweakerLog("Tinkers Construct Materials list generated", sender)); 38 | } 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetAttackAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.*; 6 | 7 | public class SetAttackAction implements IAction { 8 | 9 | private final ITICMaterial material; 10 | private final String stat; 11 | private final float newValue; 12 | 13 | public SetAttackAction(ITICMaterial material, String stat, float newValue) { 14 | this.material = material; 15 | this.stat = stat; 16 | this.newValue = newValue; 17 | } 18 | 19 | private static void set(Material material, String stat, float attack) { 20 | IMaterialStats oldStat = material.getStats(stat); 21 | if(oldStat instanceof HeadMaterialStats) { 22 | HeadMaterialStats headStat = (HeadMaterialStats) oldStat; 23 | HeadMaterialStats newHead = new HeadMaterialStats(headStat.durability, headStat.miningspeed, attack, headStat.harvestLevel); 24 | material.addStats(newHead); 25 | } else if(oldStat instanceof FletchingMaterialStats) { 26 | FletchingMaterialStats fletch = (FletchingMaterialStats) oldStat; 27 | FletchingMaterialStats newShaft = new FletchingMaterialStats(attack, fletch.modifier); 28 | material.addStats(newShaft); 29 | } 30 | 31 | } 32 | 33 | @Override 34 | public void apply() { 35 | set((Material) material.getInternal(), stat, newValue); 36 | } 37 | 38 | @Override 39 | public String describe() { 40 | return "Setting Attack of " + material.getName() + " to " + newValue + " for " + stat; 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetBowBonusDamageAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.*; 6 | 7 | public class SetBowBonusDamageAction implements IAction { 8 | 9 | private final ITICMaterial material; 10 | private final String stat; 11 | private final float newValue; 12 | 13 | public SetBowBonusDamageAction(ITICMaterial material, String stat, float newValue) { 14 | this.material = material; 15 | this.stat = stat; 16 | this.newValue = newValue; 17 | } 18 | 19 | private static void set(Material material, String stat, float bonusDamage) { 20 | IMaterialStats oldStat = material.getStats(stat); 21 | if(oldStat instanceof BowMaterialStats) { 22 | BowMaterialStats bowStat = (BowMaterialStats) oldStat; 23 | BowMaterialStats newBow = new BowMaterialStats(bowStat.drawspeed, bowStat.range, bonusDamage); 24 | material.addStats(newBow); 25 | } 26 | 27 | } 28 | 29 | @Override 30 | public void apply() { 31 | set((Material) material.getInternal(), stat, newValue); 32 | } 33 | 34 | 35 | @Override 36 | public String describe() { 37 | return "Setting BonusDamage of " + material.getName() + " to " + newValue + " for " + stat; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetBowRangeAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.*; 6 | 7 | public class SetBowRangeAction implements IAction { 8 | 9 | private final ITICMaterial material; 10 | private final String stat; 11 | private final float newValue; 12 | 13 | public SetBowRangeAction(ITICMaterial material, String stat, float newValue) { 14 | this.material = material; 15 | this.stat = stat; 16 | this.newValue = newValue; 17 | } 18 | 19 | private static void set(Material material, String stat, float range) { 20 | IMaterialStats oldStat = material.getStats(stat); 21 | if(oldStat instanceof BowMaterialStats) { 22 | BowMaterialStats bowStat = (BowMaterialStats) oldStat; 23 | BowMaterialStats newBow = new BowMaterialStats(bowStat.drawspeed, range, bowStat.bonusDamage); 24 | material.addStats(newBow); 25 | } 26 | 27 | } 28 | 29 | @Override 30 | public void apply() { 31 | set((Material) material.getInternal(), stat, newValue); 32 | } 33 | 34 | 35 | @Override 36 | public String describe() { 37 | return "Setting Range of " + material.getName() + " to " + newValue + " for " + stat; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetDrawSpeedAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.*; 6 | 7 | public class SetDrawSpeedAction implements IAction { 8 | 9 | private final ITICMaterial material; 10 | private final String stat; 11 | private final float newValue; 12 | 13 | public SetDrawSpeedAction(ITICMaterial material, String stat, float newValue) { 14 | this.material = material; 15 | this.stat = stat; 16 | this.newValue = newValue; 17 | } 18 | 19 | private static void set(Material material, String stat, float drawSpeed) { 20 | IMaterialStats oldStat = material.getStats(stat); 21 | if(oldStat instanceof BowMaterialStats) { 22 | BowMaterialStats bowStat = (BowMaterialStats) oldStat; 23 | BowMaterialStats newBow = new BowMaterialStats(drawSpeed, bowStat.range, bowStat.bonusDamage); 24 | material.addStats(newBow); 25 | } 26 | 27 | } 28 | 29 | @Override 30 | public void apply() { 31 | set((Material) material.getInternal(), stat, newValue); 32 | } 33 | 34 | 35 | @Override 36 | public String describe() { 37 | return "Setting DrawSpeed of " + material.getName() + " to " + newValue + " for " + stat; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetDurabilityAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.*; 6 | 7 | public class SetDurabilityAction implements IAction { 8 | 9 | private final ITICMaterial material; 10 | private final String stat; 11 | private final int newValue; 12 | 13 | public SetDurabilityAction(ITICMaterial material, String stat, int newValue) { 14 | this.material = material; 15 | this.stat = stat; 16 | this.newValue = newValue; 17 | } 18 | 19 | private static void set(Material material, String stat, int durability) { 20 | IMaterialStats oldStat = material.getStats(stat); 21 | if(oldStat instanceof HeadMaterialStats) { 22 | HeadMaterialStats headStat = (HeadMaterialStats) oldStat; 23 | HeadMaterialStats newHead = new HeadMaterialStats(durability, headStat.miningspeed, headStat.attack, headStat.harvestLevel); 24 | material.addStats(newHead); 25 | } else if(oldStat instanceof HandleMaterialStats) { 26 | HandleMaterialStats handleStat = (HandleMaterialStats) oldStat; 27 | HandleMaterialStats newHandle = new HandleMaterialStats(handleStat.modifier, durability); 28 | material.addStats(newHandle); 29 | } else if(oldStat instanceof ExtraMaterialStats) { 30 | ExtraMaterialStats newExtra = new ExtraMaterialStats(durability); 31 | material.addStats(newExtra); 32 | }else if(oldStat instanceof ArrowShaftMaterialStats){ 33 | ArrowShaftMaterialStats old = (ArrowShaftMaterialStats) oldStat; 34 | ArrowShaftMaterialStats newStat = new ArrowShaftMaterialStats(old.modifier, durability); 35 | material.addStats(newStat); 36 | } 37 | 38 | } 39 | 40 | @Override 41 | public void apply() { 42 | set((Material) material.getInternal(), stat, newValue); 43 | } 44 | 45 | 46 | @Override 47 | public String describe() { 48 | return "Setting durability of " + material.getName() + " to " + newValue + " for " + stat; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetHarvestLevelAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.HeadMaterialStats; 6 | import slimeknights.tconstruct.library.materials.IMaterialStats; 7 | import slimeknights.tconstruct.library.materials.Material; 8 | 9 | public class SetHarvestLevelAction implements IAction { 10 | 11 | private final ITICMaterial material; 12 | private final String stat; 13 | private final int newValue; 14 | 15 | public SetHarvestLevelAction(ITICMaterial material, String stat, int newValue) { 16 | this.material = material; 17 | this.stat = stat; 18 | this.newValue = newValue; 19 | } 20 | 21 | private static void set(Material material, String stat, int level) { 22 | IMaterialStats oldStat = material.getStats(stat); 23 | if(oldStat instanceof HeadMaterialStats) { 24 | HeadMaterialStats headStat = (HeadMaterialStats) oldStat; 25 | HeadMaterialStats newHead = new HeadMaterialStats(headStat.durability, headStat.miningspeed, headStat.attack, level); 26 | material.addStats(newHead); 27 | } 28 | 29 | } 30 | 31 | @Override 32 | public void apply() { 33 | set((Material) material.getInternal(), stat, newValue); 34 | } 35 | 36 | 37 | @Override 38 | public String describe() { 39 | return "Setting durability of " + material.getName() + " to " + newValue + " for " + stat; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetMiningSpeedAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.HeadMaterialStats; 6 | import slimeknights.tconstruct.library.materials.IMaterialStats; 7 | import slimeknights.tconstruct.library.materials.Material; 8 | 9 | public class SetMiningSpeedAction implements IAction { 10 | 11 | private final ITICMaterial material; 12 | private final String stat; 13 | private final float newValue; 14 | 15 | public SetMiningSpeedAction(ITICMaterial material, String stat, float newValue) { 16 | this.material = material; 17 | this.stat = stat; 18 | this.newValue = newValue; 19 | } 20 | 21 | private static void set(Material material, String stat, float miningSpeed) { 22 | IMaterialStats oldStat = material.getStats(stat); 23 | if(oldStat instanceof HeadMaterialStats) { 24 | HeadMaterialStats headStat = (HeadMaterialStats) oldStat; 25 | HeadMaterialStats newHead = new HeadMaterialStats(headStat.durability, miningSpeed, headStat.attack, headStat.harvestLevel); 26 | material.addStats(newHead); 27 | } 28 | 29 | } 30 | 31 | @Override 32 | public void apply() { 33 | set((Material) material.getInternal(), stat, newValue); 34 | } 35 | 36 | 37 | @Override 38 | public String describe() { 39 | return "Setting MiningSpeed of " + material.getName() + " to " + newValue + " for " + stat; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/actions/SetModifierAction.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.actions; 2 | 3 | import com.blamejared.compat.tconstruct.materials.ITICMaterial; 4 | import crafttweaker.IAction; 5 | import slimeknights.tconstruct.library.materials.*; 6 | 7 | public class SetModifierAction implements IAction { 8 | 9 | private final ITICMaterial material; 10 | private final String stat; 11 | private final float newValue; 12 | 13 | public SetModifierAction(ITICMaterial material, String stat, float newValue) { 14 | this.material = material; 15 | this.stat = stat; 16 | this.newValue = newValue; 17 | } 18 | 19 | private static void set(Material material, String stat, float modifier) { 20 | IMaterialStats oldStat = material.getStats(stat); 21 | if(oldStat instanceof HandleMaterialStats) { 22 | HandleMaterialStats handleStat = (HandleMaterialStats) oldStat; 23 | HandleMaterialStats newHandle = new HandleMaterialStats(modifier, handleStat.durability); 24 | material.addStats(newHandle); 25 | } else if(oldStat instanceof ArrowShaftMaterialStats) { 26 | ArrowShaftMaterialStats shaftStat = (ArrowShaftMaterialStats) oldStat; 27 | ArrowShaftMaterialStats newShaft = new ArrowShaftMaterialStats(modifier, shaftStat.bonusAmmo); 28 | material.addStats(newShaft); 29 | } else if(oldStat instanceof FletchingMaterialStats) { 30 | FletchingMaterialStats fletch = (FletchingMaterialStats) oldStat; 31 | FletchingMaterialStats newShaft = new FletchingMaterialStats(fletch.accuracy, modifier); 32 | material.addStats(newShaft); 33 | }else if(oldStat instanceof BowStringMaterialStats) { 34 | BowStringMaterialStats newBowString = new BowStringMaterialStats( modifier); 35 | material.addStats(newBowString); 36 | } 37 | 38 | 39 | } 40 | 41 | @Override 42 | public void apply() { 43 | set((Material) material.getInternal(), stat, newValue); 44 | } 45 | 46 | 47 | @Override 48 | public String describe() { 49 | return "Setting Modifier of " + material.getName() + " to " + newValue + " for " + stat; 50 | } 51 | 52 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/materials/ITICMaterialDefinition.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.materials; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.*; 5 | 6 | @ZenClass("modtweaker.tconstruct.ITICMaterialDefinition") 7 | @ZenRegister 8 | public interface ITICMaterialDefinition { 9 | 10 | @ZenGetter("stack") 11 | ITICMaterial asMaterial(); 12 | 13 | @ZenGetter("name") 14 | String getName(); 15 | 16 | @ZenGetter("displayName") 17 | String getDisplayName(); 18 | 19 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/materials/TICMaterialDefinition.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.materials; 2 | 3 | import slimeknights.tconstruct.library.materials.Material; 4 | 5 | public class TICMaterialDefinition implements ITICMaterialDefinition { 6 | 7 | private final Material material; 8 | 9 | public TICMaterialDefinition(Material material) { 10 | this.material = material; 11 | } 12 | 13 | @Override 14 | public ITICMaterial asMaterial() { 15 | return new TICMaterial(material); 16 | } 17 | 18 | @Override 19 | public String getName() { 20 | return material.getLocalizedName(); 21 | } 22 | 23 | @Override 24 | public String getDisplayName() { 25 | return material.getLocalizedName(); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/recipes/AlloyRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.recipes; 2 | 3 | 4 | import net.minecraftforge.fluids.FluidStack; 5 | import slimeknights.tconstruct.library.smeltery.AlloyRecipe; 6 | 7 | public class AlloyRecipeTweaker extends AlloyRecipe { 8 | 9 | public AlloyRecipeTweaker(FluidStack result, FluidStack... input) { 10 | super(result, input); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/recipes/CastingRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.recipes; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fluids.Fluid; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import slimeknights.mantle.util.RecipeMatch; 7 | import slimeknights.tconstruct.library.smeltery.CastingRecipe; 8 | 9 | public class CastingRecipeTweaker extends CastingRecipe { 10 | 11 | public CastingRecipeTweaker(ItemStack output, RecipeMatch cast, Fluid fluid, int amount) { 12 | super(output, cast, fluid, amount); 13 | } 14 | 15 | public CastingRecipeTweaker(ItemStack output, RecipeMatch cast, Fluid fluid, int amount, int time) { 16 | super(output, cast, fluid, amount, time); 17 | } 18 | 19 | public CastingRecipeTweaker(ItemStack output, Fluid fluid, int amount, int time) { 20 | super(output, fluid, amount, time); 21 | } 22 | 23 | public CastingRecipeTweaker(ItemStack output, RecipeMatch cast, Fluid fluid, int amount, boolean consumesCast, boolean switchOutputs) { 24 | super(output, cast, fluid, amount, consumesCast, switchOutputs); 25 | } 26 | 27 | public CastingRecipeTweaker(ItemStack output, RecipeMatch cast, FluidStack fluid, boolean consumesCast, boolean switchOutputs) { 28 | super(output, cast, fluid, consumesCast, switchOutputs); 29 | } 30 | 31 | public CastingRecipeTweaker(ItemStack output, RecipeMatch cast, FluidStack fluid, int time, boolean consumesCast, boolean switchOutputs) { 32 | super(output, cast, fluid, time, consumesCast, switchOutputs); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/recipes/DryingRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.recipes; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import slimeknights.mantle.util.RecipeMatch; 5 | import slimeknights.tconstruct.library.DryingRecipe; 6 | 7 | public class DryingRecipeTweaker extends DryingRecipe { 8 | 9 | public DryingRecipeTweaker(RecipeMatch input, ItemStack output, int time) { 10 | super(input, output, time); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/tconstruct/recipes/MeltingRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.tconstruct.recipes; 2 | 3 | import net.minecraftforge.fluids.*; 4 | import slimeknights.mantle.util.RecipeMatch; 5 | import slimeknights.tconstruct.library.smeltery.MeltingRecipe; 6 | 7 | public class MeltingRecipeTweaker extends MeltingRecipe { 8 | 9 | public MeltingRecipeTweaker(RecipeMatch input, Fluid output) { 10 | super(input, output); 11 | } 12 | 13 | public MeltingRecipeTweaker(RecipeMatch input, FluidStack output) { 14 | super(input, output); 15 | } 16 | 17 | public MeltingRecipeTweaker(RecipeMatch input, Fluid output, int temperature) { 18 | super(input, output, temperature); 19 | } 20 | 21 | public MeltingRecipeTweaker(RecipeMatch input, FluidStack output, int temperature) { 22 | super(input, output, temperature); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thaumcraft/handlers/aspects/CTAspect.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thaumcraft.handlers.aspects; 2 | 3 | import crafttweaker.annotations.*; 4 | import stanhebben.zenscript.annotations.*; 5 | import thaumcraft.api.aspects.Aspect; 6 | 7 | @ZenRegister 8 | @ModOnly("thaumcraft") 9 | @ZenClass("thaumcraft.aspect.CTAspect") 10 | public class CTAspect { 11 | 12 | private final Aspect internal; 13 | 14 | public CTAspect(Aspect internal) { 15 | this.internal = internal; 16 | } 17 | 18 | @ZenGetter("name") 19 | public String getName(){ 20 | return internal.getName(); 21 | } 22 | 23 | @ZenSetter("chatColour") 24 | public void setChatColour(String chatColour) { 25 | internal.setChatcolor(chatColour); 26 | } 27 | 28 | @ZenGetter("chatColour") 29 | public String getChatColour() { 30 | return internal.getChatcolor(); 31 | } 32 | 33 | 34 | public Aspect getInternal() { 35 | return internal; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thaumcraft/handlers/aspects/CTAspectStack.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thaumcraft.handlers.aspects; 2 | 3 | import crafttweaker.annotations.*; 4 | import stanhebben.zenscript.annotations.*; 5 | 6 | @ZenRegister 7 | @ModOnly("thaumcraft") 8 | @ZenClass("thaumcraft.aspect.CTAspectStack") 9 | public class CTAspectStack { 10 | 11 | private final CTAspect internal; 12 | private final int amount; 13 | 14 | public CTAspectStack(CTAspect internal, int amount) { 15 | this.internal = internal; 16 | this.amount = amount; 17 | } 18 | 19 | @ZenOperator(OperatorType.MUL) 20 | @ZenMethod 21 | public CTAspectStack setAmount(int amount) { 22 | return new CTAspectStack(internal, amount); 23 | } 24 | 25 | @ZenGetter("internal") 26 | public CTAspect getInternal() { 27 | return internal; 28 | } 29 | 30 | @ZenGetter("amount") 31 | public int getAmount() { 32 | return amount; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thaumcraft/handlers/brackets/BracketHandlerAspect.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thaumcraft.handlers.brackets; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.aspects.*; 4 | import crafttweaker.CraftTweakerAPI; 5 | import crafttweaker.annotations.*; 6 | import crafttweaker.zenscript.IBracketHandler; 7 | import stanhebben.zenscript.compiler.IEnvironmentGlobal; 8 | import stanhebben.zenscript.expression.*; 9 | import stanhebben.zenscript.parser.Token; 10 | import stanhebben.zenscript.symbols.IZenSymbol; 11 | import stanhebben.zenscript.type.natives.IJavaMethod; 12 | import thaumcraft.api.aspects.Aspect; 13 | 14 | import java.util.*; 15 | 16 | @BracketHandler(priority = 100) 17 | @ZenRegister 18 | @ModOnly("thaumcraft") 19 | public class BracketHandlerAspect implements IBracketHandler { 20 | 21 | private static final Map aspects = new HashMap<>(); 22 | 23 | private final IJavaMethod method; 24 | 25 | public BracketHandlerAspect() { 26 | method = CraftTweakerAPI.getJavaMethod(BracketHandlerAspect.class, "getAspect", String.class); 27 | } 28 | 29 | public static void rebuildRegistry() { 30 | aspects.clear(); 31 | Aspect.aspects.forEach(aspects::put); 32 | 33 | } 34 | 35 | public static CTAspectStack getAspect(String name) { 36 | return new CTAspectStack(new CTAspect(Aspect.aspects.get(name)), 1); 37 | } 38 | 39 | @Override 40 | public IZenSymbol resolve(IEnvironmentGlobal environment, List tokens) { 41 | 42 | int fromIndex = 0; 43 | int toIndex = tokens.size(); 44 | 45 | if(tokens.size() > 2) { 46 | if(tokens.get(0).getValue().equals("aspect") && tokens.get(1).getValue().equals(":")) { 47 | fromIndex = 2; 48 | } 49 | } 50 | 51 | return find(environment, tokens, fromIndex, toIndex); 52 | } 53 | 54 | private IZenSymbol find(IEnvironmentGlobal environment, List tokens, int startIndex, int endIndex) { 55 | StringBuilder valueBuilder = new StringBuilder(); 56 | for(int i = startIndex; i < endIndex; i++) { 57 | Token token = tokens.get(i); 58 | valueBuilder.append(token.getValue()); 59 | } 60 | 61 | String name = valueBuilder.toString(); 62 | if(!aspects.containsKey(name)) { 63 | rebuildRegistry(); 64 | } 65 | if(aspects.containsKey(name)) { 66 | return position -> new ExpressionCallStatic(position, environment, method, new ExpressionString(position, valueBuilder.toString())); 67 | } 68 | 69 | return null; 70 | } 71 | } -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thaumcraft/handlers/handlers/Warp.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thaumcraft.handlers.handlers; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.helpers.*; 5 | import com.blamejared.mtlib.utils.BaseAction; 6 | import crafttweaker.annotations.*; 7 | import crafttweaker.api.item.IItemStack; 8 | import net.minecraft.item.ItemStack; 9 | import stanhebben.zenscript.annotations.*; 10 | import thaumcraft.api.ThaumcraftApi; 11 | 12 | @ZenClass("mods.thaumcraft.Warp") 13 | @ZenRegister 14 | @ModOnly("thaumcraft") 15 | public class Warp { 16 | 17 | /** 18 | * Warp to gain on craft 19 | * @param stack 20 | * @param amount 21 | */ 22 | @ZenMethod 23 | public static void setWarp(IItemStack stack, int amount) { 24 | ModTweaker.LATE_ADDITIONS.add(new Set(InputHelper.toStack(stack), amount)); 25 | } 26 | 27 | 28 | private static class Set extends BaseAction { 29 | 30 | private ItemStack stack; 31 | private int amount; 32 | 33 | public Set(ItemStack stack, int amount) { 34 | super("Warp"); 35 | this.stack = stack; 36 | this.amount = amount; 37 | } 38 | 39 | @Override 40 | public void apply() { 41 | ThaumcraftApi.addWarpToItem(stack, amount); 42 | } 43 | 44 | 45 | @Override 46 | public String describe() { 47 | return "Adding " + amount + " warp to item: " + getRecipeInfo(); 48 | } 49 | 50 | 51 | @Override 52 | protected String getRecipeInfo() { 53 | return LogHelper.getStackDescription(stack); 54 | } 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/Crucible.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.CrucibleManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.CraftTweakerAPI; 8 | import crafttweaker.annotations.*; 9 | import crafttweaker.api.item.IItemStack; 10 | import crafttweaker.api.liquid.ILiquidStack; 11 | import net.minecraft.item.ItemStack; 12 | import net.minecraftforge.fluids.FluidStack; 13 | import stanhebben.zenscript.annotations.*; 14 | 15 | @ZenClass("mods.thermalexpansion.Crucible") 16 | @ModOnly("thermalexpansion") 17 | @ZenRegister 18 | public class Crucible { 19 | 20 | @ZenMethod 21 | public static void addRecipe(ILiquidStack output, IItemStack input, int energy) { 22 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(output), InputHelper.toStack(input), energy)); 23 | } 24 | 25 | @ZenMethod 26 | public static void removeRecipe(IItemStack input) { 27 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input))); 28 | } 29 | 30 | private static class Add extends BaseAction { 31 | 32 | private FluidStack output; 33 | private ItemStack input; 34 | private int energy; 35 | 36 | public Add(FluidStack output, ItemStack input, int energy) { 37 | super("Crucible"); 38 | this.output = output; 39 | this.input = input; 40 | this.energy = energy; 41 | } 42 | 43 | @Override 44 | public void apply() { 45 | CrucibleManager.addRecipe(energy, input, output); 46 | } 47 | 48 | @Override 49 | protected String getRecipeInfo() { 50 | return LogHelper.getStackDescription(output); 51 | } 52 | } 53 | 54 | private static class Remove extends BaseAction { 55 | 56 | private ItemStack input; 57 | 58 | public Remove(ItemStack input) { 59 | super("Crucible"); 60 | this.input = input; 61 | } 62 | 63 | @Override 64 | public void apply() { 65 | if(!CrucibleManager.recipeExists(input)) { 66 | CraftTweakerAPI.logError("No Crucible recipe exists for: " + input); 67 | return; 68 | } 69 | CrucibleManager.removeRecipe(input); 70 | } 71 | 72 | @Override 73 | protected String getRecipeInfo() { 74 | return LogHelper.getStackDescription(input); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/Imbuer.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.BrewerManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.CraftTweakerAPI; 8 | import crafttweaker.annotations.*; 9 | import crafttweaker.api.item.IItemStack; 10 | import crafttweaker.api.liquid.ILiquidStack; 11 | import net.minecraft.item.ItemStack; 12 | import net.minecraftforge.fluids.FluidStack; 13 | import stanhebben.zenscript.annotations.*; 14 | 15 | @ZenClass("mods.thermalexpansion.Imbuer") 16 | @ModOnly("thermalexpansion") 17 | @ZenRegister 18 | public class Imbuer { 19 | 20 | @ZenMethod 21 | public static void addRecipe(ILiquidStack output, IItemStack input, ILiquidStack inputFluid, int energy) { 22 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(output), InputHelper.toStack(input), InputHelper.toFluid(inputFluid), energy)); 23 | } 24 | 25 | @ZenMethod 26 | public static void removeRecipe(IItemStack input, ILiquidStack secondInput) { 27 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input), InputHelper.toFluid(secondInput))); 28 | } 29 | 30 | private static class Add extends BaseAction { 31 | 32 | private FluidStack output; 33 | private ItemStack input; 34 | private FluidStack inputFluid; 35 | private int energy; 36 | 37 | public Add(FluidStack output, ItemStack input, FluidStack inputFluid, int energy) { 38 | super("Imbuer"); 39 | this.output = output; 40 | this.input = input; 41 | this.inputFluid = inputFluid; 42 | this.energy = energy; 43 | } 44 | 45 | @Override 46 | public void apply() { 47 | BrewerManager.addRecipe(energy, input, inputFluid, output); 48 | } 49 | 50 | @Override 51 | protected String getRecipeInfo() { 52 | return LogHelper.getStackDescription(input) + " and " + LogHelper.getStackDescription(inputFluid); 53 | } 54 | } 55 | 56 | private static class Remove extends BaseAction { 57 | 58 | private ItemStack input; 59 | private FluidStack fluid; 60 | 61 | public Remove(ItemStack input, FluidStack fluid) { 62 | super("Imbuer"); 63 | this.input = input; 64 | this.fluid = fluid; 65 | } 66 | 67 | @Override 68 | public void apply() { 69 | if(!BrewerManager.recipeExists(input, fluid)) { 70 | CraftTweakerAPI.logError("No Imbuer recipe exists for: " + input + " and " + fluid); 71 | return; 72 | } 73 | BrewerManager.removeRecipe(input, fluid); 74 | } 75 | 76 | @Override 77 | protected String getRecipeInfo() { 78 | return LogHelper.getStackDescription(input) + " and " + LogHelper.getStackDescription(fluid); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/Infuser.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.ChargerManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.CraftTweakerAPI; 8 | import crafttweaker.annotations.*; 9 | import crafttweaker.api.item.IItemStack; 10 | import net.minecraft.item.ItemStack; 11 | import stanhebben.zenscript.annotations.*; 12 | 13 | @ZenClass("mods.thermalexpansion.Infuser") 14 | @ModOnly("thermalexpansion") 15 | @ZenRegister 16 | public class Infuser { 17 | 18 | @ZenMethod 19 | public static void addRecipe(IItemStack output, IItemStack input, int energy) { 20 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(output), InputHelper.toStack(input), energy)); 21 | } 22 | 23 | @ZenMethod 24 | public static void removeRecipe(IItemStack input) { 25 | 26 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input))); 27 | } 28 | 29 | private static class Add extends BaseAction { 30 | 31 | private ItemStack output; 32 | private ItemStack input; 33 | private int energy; 34 | 35 | public Add(ItemStack output, ItemStack input, int energy) { 36 | super("Infuser"); 37 | this.output = output; 38 | this.input = input; 39 | this.energy = energy; 40 | } 41 | 42 | @Override 43 | public void apply() { 44 | ChargerManager.addRecipe(energy, input, output); 45 | } 46 | 47 | @Override 48 | protected String getRecipeInfo() { 49 | return LogHelper.getStackDescription(output); 50 | } 51 | } 52 | 53 | private static class Remove extends BaseAction { 54 | 55 | private ItemStack input; 56 | 57 | public Remove(ItemStack input) { 58 | super("Infuser"); 59 | this.input = input; 60 | } 61 | 62 | @Override 63 | public void apply() { 64 | if(!ChargerManager.recipeExists(input)) { 65 | CraftTweakerAPI.logError("No Infuser recipe exists for: " + input); 66 | return; 67 | } 68 | ChargerManager.removeRecipe(input); 69 | } 70 | 71 | @Override 72 | protected String getRecipeInfo() { 73 | return LogHelper.getStackDescription(input); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/Pulverizer.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.PulverizerManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.CraftTweakerAPI; 8 | import crafttweaker.annotations.*; 9 | import crafttweaker.api.item.IItemStack; 10 | import net.minecraft.item.ItemStack; 11 | import stanhebben.zenscript.annotations.*; 12 | 13 | @ZenClass("mods.thermalexpansion.Pulverizer") 14 | @ModOnly("thermalexpansion") 15 | @ZenRegister 16 | public class Pulverizer { 17 | 18 | @ZenMethod 19 | public static void addRecipe(IItemStack output, IItemStack input, int energy, @Optional IItemStack secondaryOutput, @Optional int secondaryChance) { 20 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(output), InputHelper.toStack(input), energy, InputHelper.toStack(secondaryOutput), secondaryChance)); 21 | } 22 | 23 | @ZenMethod 24 | public static void removeRecipe(IItemStack input) { 25 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input))); 26 | } 27 | 28 | private static class Add extends BaseAction { 29 | 30 | private ItemStack output, input, secondaryOutput; 31 | private int energy, secondaryChance; 32 | 33 | public Add(ItemStack output, ItemStack input, int energy, ItemStack secondaryOutput, int secondaryChance) { 34 | super("Pulverizer"); 35 | this.output = output; 36 | this.input = input; 37 | this.secondaryOutput = secondaryOutput; 38 | this.energy = energy; 39 | this.secondaryChance = secondaryChance; 40 | if(!secondaryOutput.isEmpty() && secondaryChance <= 0) { 41 | this.secondaryChance = 100; 42 | } 43 | } 44 | 45 | @Override 46 | public void apply() { 47 | PulverizerManager.addRecipe(energy, input, output, secondaryOutput, secondaryChance); 48 | } 49 | 50 | @Override 51 | protected String getRecipeInfo() { 52 | return LogHelper.getStackDescription(output); 53 | } 54 | } 55 | 56 | private static class Remove extends BaseAction { 57 | 58 | private ItemStack input; 59 | 60 | public Remove(ItemStack input) { 61 | super("Pulverizer"); 62 | this.input = input; 63 | } 64 | 65 | @Override 66 | public void apply() { 67 | if(!PulverizerManager.recipeExists(input)) { 68 | CraftTweakerAPI.logError("No Pulverizer recipe exists for: " + input); 69 | return; 70 | } 71 | PulverizerManager.removeRecipe(input); 72 | } 73 | 74 | @Override 75 | protected String getRecipeInfo() { 76 | return LogHelper.getStackDescription(input); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/SawMill.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.SawmillManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.CraftTweakerAPI; 8 | import crafttweaker.annotations.*; 9 | import crafttweaker.api.item.IItemStack; 10 | import net.minecraft.item.ItemStack; 11 | import stanhebben.zenscript.annotations.*; 12 | 13 | @ZenClass("mods.thermalexpansion.Sawmill") 14 | @ModOnly("thermalexpansion") 15 | @ZenRegister 16 | public class SawMill { 17 | 18 | @ZenMethod 19 | public static void addRecipe(IItemStack output, IItemStack input, int energy, @Optional IItemStack secondaryOutput, @Optional int secondaryChance) { 20 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(output), InputHelper.toStack(input), energy, InputHelper.toStack(secondaryOutput), secondaryChance)); 21 | } 22 | 23 | @ZenMethod 24 | public static void removeRecipe(IItemStack input) { 25 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(input))); 26 | } 27 | 28 | private static class Add extends BaseAction { 29 | 30 | private ItemStack output, input, secondaryOutput; 31 | private int energy, secondaryChance; 32 | 33 | public Add(ItemStack output, ItemStack input, int energy, ItemStack secondaryOutput, int secondaryChance) { 34 | super("Sawmill"); 35 | this.output = output; 36 | this.input = input; 37 | this.secondaryOutput = secondaryOutput; 38 | this.energy = energy; 39 | this.secondaryChance = secondaryChance; 40 | if(!secondaryOutput.isEmpty() && secondaryChance <= 0) { 41 | this.secondaryChance = 100; 42 | } 43 | } 44 | 45 | @Override 46 | public void apply() { 47 | SawmillManager.addRecipe(energy, input, output, secondaryOutput, secondaryChance); 48 | } 49 | 50 | @Override 51 | protected String getRecipeInfo() { 52 | return LogHelper.getStackDescription(output); 53 | } 54 | } 55 | 56 | private static class Remove extends BaseAction { 57 | 58 | private ItemStack input; 59 | 60 | public Remove(ItemStack input) { 61 | super("Sawmill"); 62 | this.input = input; 63 | } 64 | 65 | @Override 66 | public void apply() { 67 | if(!SawmillManager.recipeExists(input)) { 68 | CraftTweakerAPI.logError("No Sawmill recipe exists for: " + input); 69 | return; 70 | } 71 | SawmillManager.removeRecipe(input); 72 | } 73 | 74 | @Override 75 | protected String getRecipeInfo() { 76 | return LogHelper.getStackDescription(input); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/dynamos/CompressionDynamo.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion.dynamos; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.CompressionManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.*; 8 | import crafttweaker.api.liquid.ILiquidStack; 9 | import net.minecraftforge.fluids.FluidStack; 10 | import stanhebben.zenscript.annotations.*; 11 | 12 | @ZenClass("mods.thermalexpansion.CompressionDynamo") 13 | @ModOnly("thermalexpansion") 14 | @ZenRegister 15 | public class CompressionDynamo { 16 | 17 | @ZenMethod 18 | public static void addFuel(ILiquidStack stack, int energy) { 19 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(stack), energy)); 20 | } 21 | 22 | @ZenMethod 23 | public static void removeFuel(ILiquidStack stack) { 24 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(stack))); 25 | } 26 | 27 | 28 | private static class Add extends BaseAction { 29 | 30 | private FluidStack stack; 31 | private int energy; 32 | 33 | protected Add(FluidStack stack, int energy) { 34 | super("CompressionDynamo"); 35 | this.stack = stack; 36 | this.energy = energy; 37 | } 38 | 39 | @Override 40 | public void apply() { 41 | CompressionManager.addFuel(stack.getFluid().getName(), energy); 42 | } 43 | 44 | @Override 45 | protected String getRecipeInfo() { 46 | return LogHelper.getStackDescription(stack); 47 | } 48 | } 49 | 50 | private static class Remove extends BaseAction { 51 | 52 | private FluidStack stack; 53 | 54 | protected Remove(FluidStack stack) { 55 | super("CompressionDynamo"); 56 | this.stack = stack; 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | CompressionManager.removeFuel(stack.getFluid().getName()); 62 | } 63 | 64 | @Override 65 | protected String getRecipeInfo() { 66 | return LogHelper.getStackDescription(stack); 67 | } 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/dynamos/EnervationDynamo.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion.dynamos; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.EnervationManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.*; 8 | import crafttweaker.api.item.IItemStack; 9 | import net.minecraft.item.ItemStack; 10 | import stanhebben.zenscript.annotations.*; 11 | 12 | @ZenClass("mods.thermalexpansion.EnervationDynamo") 13 | @ModOnly("thermalexpansion") 14 | @ZenRegister 15 | public class EnervationDynamo { 16 | 17 | @ZenMethod 18 | public static void addFuel(IItemStack stack, int energy) { 19 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(stack), energy)); 20 | } 21 | 22 | @ZenMethod 23 | public static void removeFuel(IItemStack stack) { 24 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(stack))); 25 | } 26 | 27 | 28 | private static class Add extends BaseAction { 29 | 30 | private ItemStack stack; 31 | private int energy; 32 | 33 | protected Add(ItemStack stack, int energy) { 34 | super("EnervationDynamo"); 35 | this.stack = stack; 36 | this.energy = energy; 37 | } 38 | 39 | @Override 40 | public void apply() { 41 | EnervationManager.addFuel(stack, energy); 42 | } 43 | 44 | @Override 45 | protected String getRecipeInfo() { 46 | return LogHelper.getStackDescription(stack); 47 | } 48 | } 49 | 50 | private static class Remove extends BaseAction { 51 | 52 | private ItemStack stack; 53 | 54 | protected Remove(ItemStack stack) { 55 | super("EnervationDynamo"); 56 | this.stack = stack; 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | EnervationManager.removeFuel(stack); 62 | } 63 | 64 | @Override 65 | protected String getRecipeInfo() { 66 | return LogHelper.getStackDescription(stack); 67 | } 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/dynamos/MagmaticDynamo.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion.dynamos; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.*; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.*; 8 | import crafttweaker.api.liquid.ILiquidStack; 9 | import net.minecraftforge.fluids.FluidStack; 10 | import stanhebben.zenscript.annotations.*; 11 | 12 | @ZenClass("mods.thermalexpansion.MagmaticDynamo") 13 | @ModOnly("thermalexpansion") 14 | @ZenRegister 15 | public class MagmaticDynamo { 16 | 17 | @ZenMethod 18 | public static void addFuel(ILiquidStack stack, int energy) { 19 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(stack), energy)); 20 | } 21 | 22 | @ZenMethod 23 | public static void removeFuel(ILiquidStack stack) { 24 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(stack))); 25 | } 26 | 27 | 28 | private static class Add extends BaseAction { 29 | 30 | private FluidStack stack; 31 | private int energy; 32 | 33 | protected Add(FluidStack stack, int energy) { 34 | super("MagmaticDynamo"); 35 | this.stack = stack; 36 | this.energy = energy; 37 | } 38 | 39 | @Override 40 | public void apply() { 41 | MagmaticManager.addFuel(stack.getFluid().getName(), energy); 42 | } 43 | 44 | @Override 45 | protected String getRecipeInfo() { 46 | return LogHelper.getStackDescription(stack); 47 | } 48 | } 49 | 50 | private static class Remove extends BaseAction { 51 | 52 | private FluidStack stack; 53 | 54 | protected Remove(FluidStack stack) { 55 | super("MagmaticDynamo"); 56 | this.stack = stack; 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | MagmaticManager.removeFuel(stack.getFluid().getName()); 62 | } 63 | 64 | @Override 65 | protected String getRecipeInfo() { 66 | return LogHelper.getStackDescription(stack); 67 | } 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/compat/thermalexpansion/dynamos/SteamDynamo.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.compat.thermalexpansion.dynamos; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.SteamManager; 4 | import com.blamejared.ModTweaker; 5 | import com.blamejared.mtlib.helpers.*; 6 | import com.blamejared.mtlib.utils.BaseAction; 7 | import crafttweaker.annotations.*; 8 | import crafttweaker.api.item.IItemStack; 9 | import net.minecraft.item.ItemStack; 10 | import stanhebben.zenscript.annotations.*; 11 | 12 | @ZenClass("mods.thermalexpansion.SteamDynamo") 13 | @ModOnly("thermalexpansion") 14 | @ZenRegister 15 | public class SteamDynamo { 16 | 17 | @ZenMethod 18 | public static void addFuel(IItemStack stack, int energy) { 19 | ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(stack), energy)); 20 | } 21 | 22 | @ZenMethod 23 | public static void removeFuel(IItemStack stack) { 24 | ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(stack))); 25 | } 26 | 27 | 28 | private static class Add extends BaseAction { 29 | 30 | private ItemStack stack; 31 | private int energy; 32 | 33 | protected Add(ItemStack stack, int energy) { 34 | super("SteamDynamo"); 35 | this.stack = stack; 36 | this.energy = energy; 37 | } 38 | 39 | @Override 40 | public void apply() { 41 | SteamManager.addFuel(stack, energy); 42 | } 43 | 44 | @Override 45 | protected String getRecipeInfo() { 46 | return LogHelper.getStackDescription(stack); 47 | } 48 | } 49 | 50 | private static class Remove extends BaseAction { 51 | 52 | private ItemStack stack; 53 | 54 | protected Remove(ItemStack stack) { 55 | super("SteamDynamo"); 56 | this.stack = stack; 57 | } 58 | 59 | @Override 60 | public void apply() { 61 | SteamManager.removeFuel(stack); 62 | } 63 | 64 | @Override 65 | protected String getRecipeInfo() { 66 | return LogHelper.getStackDescription(stack); 67 | } 68 | } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/blamejared/reference/Reference.java: -------------------------------------------------------------------------------- 1 | package com.blamejared.reference; 2 | 3 | public class Reference { 4 | 5 | public static final String MODID = "modtweaker"; 6 | public static final String NAME = "Modtweaker"; 7 | public static final String VERSION = "4.0.19"; 8 | public static final String DEPENDENCIES = "required-after:crafttweaker;required-after:mtlib;before:jei"; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "modtweaker", 4 | "name": "Mod Tweaker", 5 | "description": "ModTweaker is an addon for CraftTweaker, a recipe manipulator utility for Minecraft. It allows you to modify the recipes of other mods that add their own crafting mechanics", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "https://minecraft.curseforge.com/projects/ModTweaker", 9 | "updateUrl": "https://minecraft.curseforge.com/projects/ModTweaker/files", 10 | "authorList": [ 11 | "Jaredlll08" 12 | ], 13 | "credits": "Joshie and SpitefulFox for writing ModTweaker, Yulife for documentation.", 14 | "logoFile": "", 15 | "screenshots": [], 16 | "dependencies": [] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "modtweaker", 4 | "pack_format": 3, 5 | "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test_scripts/README.md: -------------------------------------------------------------------------------- 1 | This folder is to hold ModTweaker test scrips for ease of making sure everything works properly. -------------------------------------------------------------------------------- /test_scripts/botania.zs: -------------------------------------------------------------------------------- 1 | mods.botania.Apothecary.addRecipe(, [, ]); 2 | mods.botania.Apothecary.addRecipe("hydroangeas", [, ]); 3 | mods.botania.Apothecary.removeRecipe(.withTag({type: "fallenKanade"})); 4 | mods.botania.Apothecary.removeRecipe("thermalily"); 5 | 6 | mods.botania.Brew.addRecipe([, ], "healing"); 7 | mods.botania.Brew.removeRecipe("resistance"); 8 | 9 | mods.botania.ElvenTrade.addRecipe([], []); 10 | mods.botania.ElvenTrade.removeRecipe(); 11 | 12 | mods.botania.ManaInfusion.addInfusion(, , 140); 13 | mods.botania.ManaInfusion.addAlchemy(, , 40); 14 | mods.botania.ManaInfusion.addConjuration(, , 500); 15 | mods.botania.ManaInfusion.removeRecipe(); 16 | 17 | mods.botania.Orechid.addOre(, 40000); 18 | mods.botania.Orechid.addOre("blockQuartz", 99999); 19 | mods.botania.Orechid.removeOre(); 20 | mods.botania.Orechid.removeOre("oreRedstone"); 21 | 22 | mods.botania.PureDaisy.addRecipe(, , 4); 23 | mods.botania.PureDaisy.addRecipe(, ); 24 | mods.botania.PureDaisy.removeRecipe(); 25 | 26 | mods.botania.RuneAltar.addRecipe(, [, , ], 40); 27 | mods.botania.RuneAltar.removeRecipe(); 28 | 29 | mods.botania.Lexicon.addCategory("mtdev"); 30 | mods.botania.Lexicon.addEntry("deventry", "mtdev", ); 31 | mods.botania.Lexicon.setEntryKnowledgeType("deventry", "deventry"); 32 | mods.botania.Lexicon.addTextPage("devpage", "deventry", 0); 33 | mods.botania.Lexicon.addRunePage("devpage2", "deventry", 1, [], [[, , ]], [40]); 34 | mods.botania.Lexicon.addPetalPage("devpage3", "deventry", 2, [], [[, ]]); 35 | 36 | mods.botania.Lexicon.removeCategory("botania.category.generationFlowers"); 37 | mods.botania.Lexicon.removeEntry("botania.entry.relics"); 38 | 39 | mods.botania.Knowledge.registerKnowledgeType("deventry", "DARK_AQUA", true); 40 | mods.botania.Knowledge.registerKnowledgeType("jared", "GOLD", false); 41 | recipes.addShapeless(.withTag({"knowledge.jared" : true}), [[, ]]); 42 | 43 | var lex = ; 44 | lex.addBotaniaKnowledge("jared"); 45 | lex.addBotaniaKnowledge("deventry"); 46 | 47 | recipes.addShapeless("botaniaKnowledgeAddition", lex, [, ]); 48 | -------------------------------------------------------------------------------- /test_scripts/high_oven.zs: -------------------------------------------------------------------------------- 1 | import crafttweaker.oredict.IOreDictEntry; 2 | 3 | import mods.tcomplement.highoven.HighOven; 4 | import mods.tcomplement.highoven.MixRecipeBuilder; 5 | import mods.tcomplement.highoven.MixRecipeManager; 6 | 7 | HighOven.removeFuel(); 8 | HighOven.addFuel(, 1000, 25); 9 | 10 | HighOven.addMeltingOverride( * 144, , 2567); 11 | 12 | HighOven.removeHeatRecipe(); 13 | HighOven.addHeatRecipe( * 100, * 1000, 450); 14 | 15 | HighOven.removeMixRecipe(); 16 | HighOven.newMixRecipe( * 144, * 244, 3000) 17 | .addOxidizer(, 99) 18 | .addReducer(, 98) 19 | .addPurifier(, 3) 20 | .register(); 21 | 22 | HighOven.newMixRecipe( * 144, * 144, 1000) 23 | .addOxidizer(, 25) 24 | .addReducer(, 35) 25 | .addPurifier(, 45) 26 | .addPurifier(, 100) 27 | .register(); 28 | 29 | 30 | var manager = HighOven.manageMixRecipe(, null) as MixRecipeManager; 31 | manager.removeReducer(); 32 | manager.addPurifier(, 97); 33 | 34 | HighOven.manageMixRecipe(, null) 35 | .addOxidizer(, 0); 36 | 37 | HighOven.manageMixRecipe(, ) 38 | .removePurifier() 39 | .addPurifier(, 42); 40 | 41 | -------------------------------------------------------------------------------- /test_scripts/immersivetech.zs: -------------------------------------------------------------------------------- 1 | //Solar Tower 2 | mods.immersivetech.SolarTower.removeRecipe(); 3 | mods.immersivetech.SolarTower.removeRecipe(); 4 | 5 | mods.immersivetech.SolarTower.addRecipe( * 1000, * 1000, 10); 6 | mods.immersivetech.SolarTower.addRecipe( * 2000, * 1000, 10); 7 | 8 | 9 | //Distiller 10 | mods.immersivetech.Distiller.removeRecipe(); 11 | 12 | mods.immersivetech.Distiller.addRecipe( * 750, , * 1000, 500, 1, 0.001); 13 | 14 | 15 | //Boiler 16 | mods.immersivetech.Boiler.removeRecipe(); 17 | mods.immersivetech.Boiler.removeRecipe(); 18 | 19 | mods.immersivetech.Boiler.addRecipe( * 1500, * 1000, 10); 20 | mods.immersivetech.Boiler.addRecipe( * 3000, * 1000, 10); 21 | 22 | 23 | //Steam Turbine 24 | mods.immersivetech.SteamTurbine.removeSteam(); 25 | 26 | mods.immersivetech.SteamTurbine.registerSteam(, 50000); -------------------------------------------------------------------------------- /test_scripts/inspirations.zs: -------------------------------------------------------------------------------- 1 | // brewing recipes 2 | mods.inspirations.Cauldron.addBrewingRecipe("minecraft:invisibility", "minecraft:thick", ); 3 | mods.inspirations.Cauldron.addBrewingRecipe("minecraft:healing", "minecraft:thick", ); 4 | mods.inspirations.Cauldron.removeBrewingRecipe("inspirations:haste"); 5 | mods.inspirations.Cauldron.removeBrewingRecipe("minecraft:awkward", "minecraft:water", ); 6 | 7 | // dye recipes 8 | mods.inspirations.Cauldron.addDyeRecipe(, , "blue"); 9 | mods.inspirations.Cauldron.addDyeRecipe(, , "lime"); 10 | mods.inspirations.Cauldron.addDyeRecipe(, , "red", 2); 11 | mods.inspirations.Cauldron.removeDyeRecipe(<*>, <*>, "blue"); 12 | mods.inspirations.Cauldron.removeDyeRecipe(); 13 | 14 | // fluid recipes 15 | mods.inspirations.Cauldron.addFluidRecipe(, * 2, ); 16 | mods.inspirations.Cauldron.addFluidRecipe(, * 4, ); 17 | mods.inspirations.Cauldron.addFluidRecipe(, , , 1, true); 18 | mods.inspirations.Cauldron.addFluidRecipe(, .withTag({RepairCost: 0, display: {Name: "True Stick"}}), ); 19 | mods.inspirations.Cauldron.addFluidTransform(, , , 2, false); 20 | mods.inspirations.Cauldron.removeFluidRecipe(); 21 | mods.inspirations.Cauldron.removeFluidTransform(, , ); 22 | 23 | // cauldron filling 24 | mods.inspirations.Cauldron.addFillRecipe(, , 2, ); 25 | mods.inspirations.Cauldron.addFillRecipe(, ); 26 | mods.inspirations.Cauldron.addFillRecipe(, , 1, null, true); 27 | mods.inspirations.Cauldron.addFillRecipe(, , 1, , true); 28 | mods.inspirations.Cauldron.removeFillRecipe(); 29 | mods.inspirations.Cauldron.removeFillRecipe(<*>, ); 30 | 31 | // potions 32 | mods.inspirations.Cauldron.addPotionRecipe(, , "minecraft:regeneration", 2); 33 | 34 | // fluid mix 35 | mods.inspirations.Cauldron.addFluidMix(, , ); -------------------------------------------------------------------------------- /test_scripts/thaumcraft.zs: -------------------------------------------------------------------------------- 1 | //gold coins have a value of 2000, diamonds are 50 2 | //array is: 3 | //common: 0 4 | //uncommon: 1 5 | //rare: 2 6 | mods.thaumcraft.LootBag.addLoot(%20000, [0,1,2]); 7 | mods.thaumcraft.LootBag.removeLoot(, [1,2]); 8 | //*technically* negative warp can probably be a thing 9 | //not sure how this works with a warp of "0", if it still *applies* warp 10 | mods.thaumcraft.Warp.setWarp(, 500); 11 | 12 | 13 | .internal.chatColour ="r"; 14 | .setAspects(*5); 15 | 16 | .removeAspects(); 17 | 18 | mods.thaumcraft.Infusion.registerRecipe("testName", "", , 20, [, ], , [, ]); 19 | mods.thaumcraft.Infusion.removeRecipe(); 20 | 21 | mods.thaumcraft.ArcaneWorkbench.registerShapedRecipe("test", "", 20, [, , ], , [[], [], []]); 22 | mods.thaumcraft.ArcaneWorkbench.registerShapelessRecipe("tests", "", 20, [, , ], , [, , ]); 23 | 24 | mods.thaumcraft.ArcaneWorkbench.removeRecipe(); 25 | 26 | mods.thaumcraft.Crucible.registerRecipe("crucibleTest", "", , , []); 27 | mods.thaumcraft.Crucible.removeRecipe(); 28 | 29 | .setAspects(); 30 | --------------------------------------------------------------------------------