├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src └── main ├── java └── youyihj │ └── zenrecipereloading │ ├── ZenRecipeReloading.java │ ├── client │ ├── RenderAccess.java │ └── RuntimeProgressBarRender.java │ ├── command │ └── ReloadJEICommand.java │ ├── compat │ ├── artisanworktables │ │ └── ArtisanWorktablesModule.java │ ├── avaritia │ │ ├── AvaritiaCallbacks.java │ │ └── AvaritiaModule.java │ ├── bloodmagic │ │ ├── AlchemyArrayCallbacks.java │ │ ├── AlchemyTableCallbacks.java │ │ ├── BloodAltarCallbacks.java │ │ ├── BloodMagicModule.java │ │ └── TartaricForgeCallbacks.java │ ├── botania │ │ ├── BotaniaModule.java │ │ ├── OrechidCallbacks.java │ │ └── OrechidNetherCallbacks.java │ ├── dropt │ │ └── DroptModule.java │ ├── embers │ │ ├── AddMetalCoefficientAccessor.java │ │ ├── AlchemyCallbacks.java │ │ ├── DawnstoneAnvilCallbacks.java │ │ ├── EmberGenerationCallbacks.java │ │ ├── EmbersModule.java │ │ ├── HeatCoilCallbacks.java │ │ ├── MelterCallbacks.java │ │ ├── MixerCallbacks.java │ │ └── StamperCallbacks.java │ ├── extendedcrafting │ │ ├── CombinationCraftingCallbacks.java │ │ ├── CompressionCraftingCallbacks.java │ │ ├── EnderCraftingCallbacks.java │ │ ├── ExtendedCraftingModule.java │ │ └── TableCraftingCallbacks.java │ ├── forestry │ │ ├── AddForestryCallback.java │ │ ├── CharcoalPileCallbacks.java │ │ ├── ForestryModule.java │ │ └── RemoveForestryCallback.java │ ├── gregtech │ │ ├── BackupRecipeAction.java │ │ ├── BuildRecipeAction.java │ │ └── GregTechModule.java │ ├── immersiveengineering │ │ ├── AlloySmelterCallbacks.java │ │ ├── ArcFurnaceCallbacks.java │ │ ├── BlastFurnaceCallbacks.java │ │ ├── BlueprintCallbacks.java │ │ ├── BottlingMachineCallbacks.java │ │ ├── CokeOvenCallbacks.java │ │ ├── CrusherCallbacks.java │ │ ├── DieselCallbacks.java │ │ ├── ExcavatorCallbacks.java │ │ ├── FermenterCallbacks.java │ │ ├── ImmersiveEngineeringModule.java │ │ ├── MetalPressCallbacks.java │ │ ├── MixerCallbacks.java │ │ ├── RefineryCallbacks.java │ │ ├── SqueezerCallbacks.java │ │ └── ThermoelectricCallbacks.java │ ├── iwc │ │ └── InWorldCraftingModule.java │ ├── jei │ │ └── JEIModule.java │ ├── mekanism │ │ ├── MekanismModule.java │ │ └── RecipeMapModificationCallback.java │ ├── modtweaker │ │ ├── BaseListAdditionCallback.java │ │ ├── BaseListRemovalCallback.java │ │ ├── BaseMapAdditionCallback.java │ │ ├── BaseMapRemovalCallback.java │ │ └── ModTweakerModule.java │ ├── patchouli │ │ └── PatchouliModule.java │ ├── pneumaticcraft │ │ ├── ListAdditionCallback.java │ │ ├── ListRemovalCallback.java │ │ └── PneumaticCraftModule.java │ ├── tconstruct │ │ ├── FuelCallbacks.java │ │ └── TconstructModule.java │ ├── thaumcraft │ │ ├── ArcaneWorkbenchCallbacks.java │ │ ├── ArcaneWorkbenchRemoveAccessor.java │ │ ├── CrucibleCallbacks.java │ │ ├── CrucibleRemoveAccessor.java │ │ ├── InfusionCallbacks.java │ │ └── ThaumcraftModule.java │ ├── thermalexpansion │ │ ├── CentrifugeCallbacks.java │ │ ├── CompactorCallbacks.java │ │ ├── CompressionDynamoCallbacks.java │ │ ├── CoolantCallbacks.java │ │ ├── CrucibleCallbacks.java │ │ ├── EnchanterCallbacks.java │ │ ├── EnervationDynamoCallbacks.java │ │ ├── FactorizerCallbacks.java │ │ ├── ImbuerCallbacks.java │ │ ├── InductionSmelterCallbacks.java │ │ ├── InfuserCallbacks.java │ │ ├── InsolatorCallbacks.java │ │ ├── MagmaticDynamoCallbacks.java │ │ ├── NumisticDynamoCallbacks.java │ │ ├── PulverizerCallbacks.java │ │ ├── ReactantDynamoCallbacks.java │ │ ├── RedstoneFurnaceCallbacks.java │ │ ├── RefineryCallbacks.java │ │ ├── SawMillCallbacks.java │ │ ├── SteamDynamoCallbacks.java │ │ ├── ThermalExpansionModule.java │ │ └── TransposerCallbacks.java │ └── vanilla │ │ ├── ActionBaseRemoveRecipesAccessor.java │ │ ├── CraftingRecipeCallbacks.java │ │ ├── DummyRecipe.java │ │ ├── FurnaceRecipeCallbacks.java │ │ ├── IngredientMapEntryAccessor.java │ │ ├── OreDictCallbacks.java │ │ ├── TooltipCallbacks.java │ │ └── VanillaModule.java │ ├── core │ ├── MixinLateInit.java │ └── ZenRecipeReloadingPlugin.java │ ├── event │ └── EventHandler.java │ ├── mixins │ ├── artisanworktables │ │ └── RecipeRegistryAccessor.java │ ├── avaritia │ │ ├── AddRecipeActionAccessor.java │ │ └── RemoveRecipeActionAccessor.java │ ├── crafttweaker │ │ ├── ActionAddFurnaceRecipeAccessor.java │ │ ├── ActionBaseAddRecipeAccessor.java │ │ ├── ActionBaseRemoveRecipesMixin.java │ │ ├── ActionFurnaceRemoveRecipeAccessor.java │ │ ├── ActionOreDictAddAllAccessor.java │ │ ├── ActionOreDictAddItemAccessor.java │ │ ├── ActionOreDictRemoveItemAccessor.java │ │ ├── ActionRemoveRecipesNoIngredientsAccessor.java │ │ ├── ActionSetFuelAccessor.java │ │ ├── IngredientMapEntryMixin.java │ │ ├── IngredientTooltipsAccessor.java │ │ └── MCRecipeManagerAccessor.java │ ├── embers │ │ ├── AddBoilerFluidAccessor.java │ │ ├── AddCatalysisFuelAccessor.java │ │ ├── AddCombustionFuelAccessor.java │ │ ├── AddEmberFuelAccessor.java │ │ ├── AddSteamEngineFuelAccessor.java │ │ ├── AlchemyAddActionAccessor.java │ │ ├── AlchemyRemoveActionAccessor.java │ │ ├── DawnstoneAnvilAddAccessor.java │ │ ├── DawnstoneAnvilBlacklistBreakdownAccessor.java │ │ ├── DawnstoneAnvilBlacklistMaterialAccessor.java │ │ ├── DawnstoneAnvilBlacklistRepairAccessor.java │ │ ├── DawnstoneAnvilRemoveAccessor.java │ │ ├── HeatCoilAddAccessor.java │ │ ├── HeatCoilRemoveByInputAccessor.java │ │ ├── MelterAddAccessor.java │ │ ├── MelterRemoveByInputAccessor.java │ │ ├── MelterRemoveByOutputAccessor.java │ │ ├── MixerAddAccessor.java │ │ ├── MixerRemoveByOutputAccessor.java │ │ ├── MixinAddMetalCoefficient.java │ │ ├── RemoveBoilerFluidAccessor.java │ │ ├── RemoveCatalysisFuelAccessor.java │ │ ├── RemoveCombustionFuelAccessor.java │ │ ├── RemoveEmberFuelAccessor.java │ │ ├── RemoveSteamEngineFuelAccessor.java │ │ ├── StamperAddAccessor.java │ │ └── StamperRemoveByOutputAccessor.java │ ├── forestry │ │ ├── BaseAddForestryAccessor.java │ │ └── BaseRemoveForestryAccessor.java │ ├── forge │ │ ├── ForgeRegistryAccessor.java │ │ └── ProgressBarMixin.java │ ├── gregtech │ │ ├── MixinCTRecipeBuilder.java │ │ ├── MixinRecipeMap.java │ │ └── RecipeBuilderAccessor.java │ ├── immersiveengineering │ │ └── MixinArcFurnaceRecipe.java │ ├── jei │ │ └── JEIProxyClientAccessor.java │ ├── mekanism │ │ └── RecipeMapModificationAccessor.java │ ├── modtweaker │ │ ├── BaseListModificationAccessor.java │ │ ├── BaseMapAdditionAccessor.java │ │ └── BaseMapModificationAccessor.java │ ├── pneumaticcraft │ │ └── ListModificationAccessor.java │ ├── tconstruct │ │ └── TinkerRegistryAccessor.java │ ├── thaumcraft │ │ ├── MixinArcaneWorkbenchRemoveAction.java │ │ ├── MixinCrucibleRemoveAction.java │ │ └── MixinInfusionRemoveAction.java │ └── vanilla │ │ └── MinecraftAccessor.java │ ├── module │ ├── IModule.java │ ├── ModuleRegistry.java │ └── PlainModule.java │ ├── network │ ├── NetworkHandler.java │ └── ReloadJEIMessage.java │ └── util │ ├── MixinAccessibleActionReloadCallback.java │ ├── PrivateActionReloadCallback.java │ ├── ReflectionAccessibleActionReloadCallback.java │ ├── RuntimePrivateActionReloadCallback.java │ └── RuntimeReloadCallback.java └── resources ├── mcmod.info ├── mixins.zenrecipereloading.artisanworktables.json ├── mixins.zenrecipereloading.avaritia.json ├── mixins.zenrecipereloading.crafttweaker.json ├── mixins.zenrecipereloading.embers.json ├── mixins.zenrecipereloading.forestry.json ├── mixins.zenrecipereloading.gregtech.json ├── mixins.zenrecipereloading.immersiveengineering.json ├── mixins.zenrecipereloading.jei.json ├── mixins.zenrecipereloading.json ├── mixins.zenrecipereloading.mekanism.json ├── mixins.zenrecipereloading.modtweaker.json ├── mixins.zenrecipereloading.pneumaticcraft.json ├── mixins.zenrecipereloading.tconstruct.json ├── mixins.zenrecipereloading.thaumcraft.json └── pack.mcmeta /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | 9 | # idea 10 | out 11 | *.ipr 12 | *.iws 13 | *.iml 14 | .idea 15 | 16 | # gradle 17 | build 18 | .gradle 19 | 20 | # other 21 | eclipse 22 | run 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 youyihj 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ZenRecipeReload 2 | 3 | Allow recipe reloading for CraftTweaker 1.12 4 | 5 | Dependencies: 6 | 7 | * [ZenUtils](https://www.curseforge.com/minecraft/mc-mods/zenutil) 1.13.3 or above 8 | * Just Enough Items 9 | * ModTweaker 10 | 11 | Supported Operations: 12 | 13 | * Crafting table recipes (except `replaceAllOccurrence`) 14 | * Furnace recipes and fuel 15 | * Ore Dictionary (except `mirror`) 16 | * JEI hide and description 17 | * Tooltips 18 | * Actually Addition 19 | * Blood Magic 20 | * Botania (except lexicon) 21 | * Forestry 22 | * Thermal Expansion 23 | * Avaritia 24 | * Immersive Engineering 25 | * Tinker's Construct 26 | * GregTech CE Unofficial (only Machine Recipes) 27 | * Extended Crafting 28 | * In World Crafting 29 | * Embers 30 | * Thaumcraft Arcane Workbench & Crucible & Infusion 31 | -------------------------------------------------------------------------------- /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 | 5 | # Mod Information 6 | mod_version = 1.4.5 7 | maven_group = youyihj 8 | archives_base_name = zenrecipereloading 9 | 10 | # If any properties changes below this line, run `gradlew setupDecompWorkspace` and refresh gradle again to ensure everything is working correctly. 11 | 12 | # Boilerplate Options 13 | use_mixins = true 14 | use_coremod = true 15 | use_assetmover = false 16 | 17 | # Access Transformer files should be in the root of `resources` folder and with the filename formatted as: `{archives_base_name}_at.cfg` 18 | use_access_transformer = false 19 | 20 | # Coremod Arguments 21 | include_mod = true 22 | coremod_plugin_class_name = youyihj.zenrecipereloading.core.ZenRecipeReloadingPlugin -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/friendlyhj/ZenRecipeReloading/ebc70f227822499c3e0b4c9499532710332f971c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 14 12:28:28 PDT 2015 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-4.10.3-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 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 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 Windowz 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 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/command/ReloadJEICommand.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.command; 2 | 3 | import crafttweaker.mc1120.commands.CraftTweakerCommand; 4 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.entity.player.EntityPlayerMP; 7 | import net.minecraft.server.MinecraftServer; 8 | import net.minecraft.util.text.TextFormatting; 9 | import youyihj.zenrecipereloading.network.NetworkHandler; 10 | 11 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.getNormalMessage; 12 | 13 | /** 14 | * @author youyihj 15 | */ 16 | public class ReloadJEICommand extends CraftTweakerCommand { 17 | public ReloadJEICommand() { 18 | super("jeiReload"); 19 | } 20 | 21 | @Override 22 | protected void init() { 23 | setDescription(SpecialMessagesChat.getNormalMessage("Reload JEI")); 24 | } 25 | 26 | @Override 27 | public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) { 28 | if (server.isDedicatedServer()) { 29 | sender.sendMessage(getNormalMessage(TextFormatting.DARK_RED + "The command only can be run in integrated server (SinglePlayer)!")); 30 | } else if (sender instanceof EntityPlayerMP) { 31 | NetworkHandler.INSTANCE.sendReloadJEIMessage(((EntityPlayerMP) sender)); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/artisanworktables/ArtisanWorktablesModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.artisanworktables; 2 | 3 | import com.codetaylor.mc.artisanworktables.api.ArtisanRegistries; 4 | import com.codetaylor.mc.artisanworktables.modules.worktables.ModuleWorktables; 5 | import com.codetaylor.mc.artisanworktables.modules.worktables.integration.crafttweaker.CTActionAdd; 6 | import com.codetaylor.mc.artisanworktables.modules.worktables.integration.crafttweaker.CTArtisanRecipe; 7 | import com.codetaylor.mc.artisanworktables.modules.worktables.integration.crafttweaker.CTRecipeAdditionQueue; 8 | import crafttweaker.CraftTweakerAPI; 9 | import crafttweaker.mc1120.CraftTweaker; 10 | import crafttweaker.mc1120.events.ActionApplyEvent; 11 | import youyihj.zenrecipereloading.mixins.artisanworktables.RecipeRegistryAccessor; 12 | import youyihj.zenrecipereloading.module.IModule; 13 | import youyihj.zenrecipereloading.util.RuntimeReloadCallback; 14 | import youyihj.zenutils.api.reload.IActionReloadCallbackFactory; 15 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 16 | 17 | public class ArtisanWorktablesModule implements IModule { 18 | @Override 19 | public void registerReloadCallbacks() { 20 | IActionReloadCallbackFactory.register(CTActionAdd.class, RuntimeReloadCallback::new); 21 | } 22 | 23 | @Override 24 | public void onReloadPre(ScriptReloadEvent.Pre event) { 25 | ArtisanRegistries.RECIPE_REGISTRY.forEach(it -> { 26 | RecipeRegistryAccessor registry = (RecipeRegistryAccessor) it; 27 | registry.getRecipeList().removeIf(CTArtisanRecipe.class::isInstance); 28 | registry.getRecipeMap().values().removeIf(CTArtisanRecipe.class::isInstance); 29 | }); 30 | } 31 | 32 | @Override 33 | public void onReloadPost(ScriptReloadEvent.Post event) { 34 | CTRecipeAdditionQueue recipeAdditionQueue = (CTRecipeAdditionQueue) ModuleWorktables.RECIPE_ADDITION_QUEUE; 35 | // collect recipes to add actions 36 | recipeAdditionQueue.on(new ActionApplyEvent.Pre()); 37 | CraftTweaker.LATE_ACTIONS.forEach(it -> { 38 | if (it instanceof CTActionAdd) { 39 | CraftTweakerAPI.apply(it); 40 | } 41 | }); 42 | // add copy recipe 43 | recipeAdditionQueue.on(new ActionApplyEvent.Post()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/avaritia/AvaritiaCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.avaritia; 2 | 3 | import morph.avaritia.compat.crafttweaker.AddRecipeAction; 4 | import morph.avaritia.compat.crafttweaker.RemoveRecipeAction; 5 | import net.minecraft.util.ResourceLocation; 6 | import net.minecraftforge.registries.IForgeRegistryEntry; 7 | import youyihj.zenrecipereloading.mixins.avaritia.AddRecipeActionAccessor; 8 | import youyihj.zenrecipereloading.mixins.avaritia.RemoveRecipeActionAccessor; 9 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * @author youyihj 17 | */ 18 | public class AvaritiaCallbacks { 19 | public static class Add, A extends AddRecipeAction> extends MixinAccessibleActionReloadCallback> { 20 | 21 | public Add(A action) { 22 | super(action); 23 | } 24 | 25 | @Override 26 | public void undo() { 27 | getActionAccessor().getRegistry().remove(getActionAccessor().getRecipe().getRegistryName()); 28 | } 29 | 30 | @Override 31 | public boolean hasUndoMethod() { 32 | return true; 33 | } 34 | } 35 | 36 | public static class Remove, A extends RemoveRecipeAction> extends MixinAccessibleActionReloadCallback> { 37 | private List snapshot; 38 | 39 | public Remove(A action) { 40 | super(action); 41 | } 42 | 43 | @Override 44 | public void beforeApply(boolean reload) { 45 | Map registry = getActionAccessor().getRegistry(); 46 | snapshot = getActionAccessor().getFilter().apply(registry.values()).stream() 47 | .map(registry::get) 48 | .collect(Collectors.toList()); 49 | } 50 | 51 | @Override 52 | public void undo() { 53 | Map registry = getActionAccessor().getRegistry(); 54 | snapshot.forEach(it -> registry.put(it.getRegistryName(), it)); 55 | } 56 | 57 | @Override 58 | public boolean hasUndoMethod() { 59 | return true; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/avaritia/AvaritiaModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.avaritia; 2 | 3 | import morph.avaritia.compat.crafttweaker.AddRecipeAction; 4 | import morph.avaritia.compat.crafttweaker.RemoveRecipeAction; 5 | import youyihj.zenrecipereloading.module.PlainModule; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class AvaritiaModule extends PlainModule { 11 | public AvaritiaModule() { 12 | addCallbackFactory(AddRecipeAction.class, AvaritiaCallbacks.Add::new); 13 | addCallbackFactory(RemoveRecipeAction.class, AvaritiaCallbacks.Remove::new); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/bloodmagic/AlchemyArrayCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.bloodmagic; 2 | 3 | import WayofTime.bloodmagic.api.impl.BloodMagicAPI; 4 | import WayofTime.bloodmagic.api.impl.recipe.RecipeAlchemyArray; 5 | import crafttweaker.IAction; 6 | import net.minecraft.item.ItemStack; 7 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | public class AlchemyArrayCallbacks { 13 | public static class Removal extends PrivateActionReloadCallback { 14 | 15 | private RecipeAlchemyArray recipe; 16 | 17 | public Removal(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void beforeApply(boolean reload) { 23 | ItemStack input = getActionField("input"); 24 | ItemStack catalyst = getActionField("catalyst"); 25 | recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyArray(input, catalyst); 26 | } 27 | 28 | @Override 29 | public void undo() { 30 | if (recipe != null) { 31 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().addAlchemyArray(recipe.getInput(), recipe.getCatalyst(), recipe.getOutput(), recipe.getCircleTexture()); 32 | } 33 | } 34 | 35 | @Override 36 | public boolean hasUndoMethod() { 37 | return true; 38 | } 39 | } 40 | 41 | public static class Addition extends PrivateActionReloadCallback { 42 | 43 | public Addition(IAction action) { 44 | super(action); 45 | } 46 | 47 | @Override 48 | public void undo() { 49 | ItemStack input = getActionField("input"); 50 | ItemStack catalyst = getActionField("catalyst"); 51 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().removeAlchemyArray(input, catalyst); 52 | } 53 | 54 | @Override 55 | public boolean hasUndoMethod() { 56 | return true; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/bloodmagic/BloodAltarCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.bloodmagic; 2 | 3 | import WayofTime.bloodmagic.api.impl.BloodMagicAPI; 4 | import WayofTime.bloodmagic.api.impl.recipe.RecipeBloodAltar; 5 | import crafttweaker.IAction; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.crafting.Ingredient; 8 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public class BloodAltarCallbacks { 14 | public static class Remove extends PrivateActionReloadCallback { 15 | 16 | private RecipeBloodAltar recipe; 17 | 18 | public Remove(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void beforeApply(boolean reload) { 24 | ItemStack input = getActionField("input"); 25 | recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getBloodAltar(input); 26 | } 27 | 28 | @Override 29 | public void undo() { 30 | if (recipe != null) { 31 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().addBloodAltar(recipe.getInput(), recipe.getOutput(), recipe.getMinimumTier().ordinal(), recipe.getSyphon(), recipe.getConsumeRate(), recipe.getDrainRate()); 32 | } 33 | } 34 | 35 | @Override 36 | public boolean hasUndoMethod() { 37 | return true; 38 | } 39 | } 40 | 41 | public static class Add extends PrivateActionReloadCallback { 42 | 43 | public Add(IAction action) { 44 | super(action); 45 | } 46 | 47 | @Override 48 | public void undo() { 49 | Ingredient input = getActionField("input"); 50 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().removeBloodAltar(input.getMatchingStacks()[0]); 51 | } 52 | 53 | @Override 54 | public boolean hasUndoMethod() { 55 | return true; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/bloodmagic/BloodMagicModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.bloodmagic; 2 | 3 | import youyihj.zenrecipereloading.module.IModule; 4 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 5 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class BloodMagicModule implements IModule { 11 | @Override 12 | public void registerReloadCallbacks() { 13 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.AlchemyArray$Remove", AlchemyArrayCallbacks.Removal::new); 14 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.AlchemyArray$Add", AlchemyArrayCallbacks.Addition::new); 15 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.AlchemyTable$Add", AlchemyTableCallbacks.Add::new); 16 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.AlchemyTable$AddPotion", AlchemyTableCallbacks.AddPotion::new); 17 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.AlchemyTable$Remove", AlchemyTableCallbacks.Remove::new); 18 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.BloodAltar$Remove", BloodAltarCallbacks.Remove::new); 19 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.BloodAltar$Add", BloodAltarCallbacks.Add::new); 20 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.TartaricForge$Remove", TartaricForgeCallbacks.Remove::new); 21 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.bloodmagic.TartaricForge$Add", TartaricForgeCallbacks.Add::new); 22 | } 23 | 24 | @Override 25 | public void onReloadPre(ScriptReloadEvent.Pre event) { 26 | 27 | } 28 | 29 | @Override 30 | public void onReloadPost(ScriptReloadEvent.Post event) { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/bloodmagic/TartaricForgeCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.bloodmagic; 2 | 3 | import WayofTime.bloodmagic.api.impl.BloodMagicAPI; 4 | import WayofTime.bloodmagic.api.impl.recipe.RecipeTartaricForge; 5 | import crafttweaker.IAction; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.item.crafting.Ingredient; 8 | import net.minecraftforge.oredict.OreDictionary; 9 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 10 | 11 | import java.util.Arrays; 12 | 13 | /** 14 | * @author youyihj 15 | */ 16 | public class TartaricForgeCallbacks { 17 | public static class Add extends PrivateActionReloadCallback { 18 | 19 | public Add(IAction action) { 20 | super(action); 21 | } 22 | 23 | @Override 24 | public void undo() { 25 | Object[] inputs = getActionField("inputs"); 26 | ItemStack[] stacks = new ItemStack[inputs.length]; 27 | Arrays.fill(stacks, ItemStack.EMPTY); 28 | for (int i = 0; i < inputs.length; i++) { 29 | Object input = inputs[i]; 30 | if (input instanceof ItemStack) { 31 | stacks[i] = ((ItemStack) input); 32 | } else if (input instanceof String) { 33 | stacks[i] = OreDictionary.getOres(((String) input)).get(0); 34 | } 35 | } 36 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().removeTartaricForge(stacks); 37 | } 38 | 39 | @Override 40 | public boolean hasUndoMethod() { 41 | return true; 42 | } 43 | } 44 | 45 | public static class Remove extends PrivateActionReloadCallback { 46 | private RecipeTartaricForge recipe; 47 | 48 | public Remove(IAction action) { 49 | super(action); 50 | } 51 | 52 | @Override 53 | public void beforeApply(boolean reload) { 54 | ItemStack[] inputs = getActionField("inputs"); 55 | recipe = BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForge(Arrays.asList(inputs)); 56 | } 57 | 58 | @Override 59 | public void undo() { 60 | if (recipe != null) { 61 | BloodMagicAPI.INSTANCE.getRecipeRegistrar().addTartaricForge(recipe.getOutput(), recipe.getMinimumSouls(), recipe.getSoulDrain(), recipe.getInput().toArray(new Ingredient[0])); 62 | } 63 | } 64 | 65 | @Override 66 | public boolean hasUndoMethod() { 67 | return true; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/botania/BotaniaModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.botania; 2 | 3 | import youyihj.zenrecipereloading.module.PlainModule; 4 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public class BotaniaModule extends PlainModule { 10 | @Override 11 | public void registerReloadCallbacks() { 12 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.botania.handlers.Orechid$Add", OrechidCallbacks.Add::new); 13 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.botania.handlers.Orechid$Remove", OrechidCallbacks.Remove::new); 14 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.botania.handlers.OrechidIgnem$Add", OrechidNetherCallbacks.Add::new); 15 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.botania.handlers.OrechidIgnem$Remove", OrechidNetherCallbacks.Remove::new); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/botania/OrechidCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.botania; 2 | 3 | import crafttweaker.IAction; 4 | import vazkii.botania.api.BotaniaAPI; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class OrechidCallbacks { 11 | public static class Add extends PrivateActionReloadCallback { 12 | 13 | public Add(IAction action) { 14 | super(action); 15 | } 16 | 17 | @Override 18 | public void undo() { 19 | String oreDict = getActionField("oreDict"); 20 | BotaniaAPI.oreWeights.remove(oreDict); 21 | } 22 | 23 | @Override 24 | public boolean hasUndoMethod() { 25 | return true; 26 | } 27 | } 28 | 29 | public static class Remove extends PrivateActionReloadCallback { 30 | 31 | private Integer prev; 32 | 33 | public Remove(IAction action) { 34 | super(action); 35 | } 36 | 37 | @Override 38 | public void beforeApply(boolean reload) { 39 | String oreDict = getActionField("oreDict"); 40 | prev = BotaniaAPI.oreWeights.get(oreDict); 41 | } 42 | 43 | @Override 44 | public void undo() { 45 | if (prev != null) { 46 | String oreDict = getActionField("oreDict"); 47 | BotaniaAPI.addOreWeight(oreDict, prev); 48 | } 49 | } 50 | 51 | @Override 52 | public boolean hasUndoMethod() { 53 | return true; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/botania/OrechidNetherCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.botania; 2 | 3 | import crafttweaker.IAction; 4 | import vazkii.botania.api.BotaniaAPI; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class OrechidNetherCallbacks { 11 | public static class Add extends PrivateActionReloadCallback { 12 | 13 | public Add(IAction action) { 14 | super(action); 15 | } 16 | 17 | @Override 18 | public void undo() { 19 | String oreDict = getActionField("oreDict"); 20 | BotaniaAPI.oreWeightsNether.remove(oreDict); 21 | } 22 | 23 | @Override 24 | public boolean hasUndoMethod() { 25 | return true; 26 | } 27 | } 28 | 29 | public static class Remove extends PrivateActionReloadCallback { 30 | 31 | private Integer prev; 32 | 33 | public Remove(IAction action) { 34 | super(action); 35 | } 36 | 37 | @Override 38 | public void beforeApply(boolean reload) { 39 | String oreDict = getActionField("oreDict"); 40 | prev = BotaniaAPI.oreWeights.get(oreDict); 41 | } 42 | 43 | @Override 44 | public void undo() { 45 | if (prev != null) { 46 | String oreDict = getActionField("oreDict"); 47 | BotaniaAPI.addOreWeightNether(oreDict, prev); 48 | } 49 | } 50 | 51 | @Override 52 | public boolean hasUndoMethod() { 53 | return true; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/dropt/DroptModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.dropt; 2 | 3 | import com.codetaylor.mc.dropt.modules.dropt.compat.crafttweaker.ZenDropt; 4 | import crafttweaker.mc1120.CraftTweaker; 5 | import youyihj.zenrecipereloading.module.IModule; 6 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 7 | 8 | public class DroptModule implements IModule { 9 | @Override 10 | public void registerReloadCallbacks() { 11 | 12 | } 13 | 14 | @Override 15 | public void onReloadPre(ScriptReloadEvent.Pre event) { 16 | ZenDropt.LISTS.clear(); 17 | } 18 | 19 | @Override 20 | public void onReloadPost(ScriptReloadEvent.Post event) { 21 | CraftTweaker.server.getCommandManager().executeCommand(event.getRequester(), "dropt reload"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/embers/AddMetalCoefficientAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.embers; 2 | 3 | import teamroots.embers.api.misc.IMetalCoefficient; 4 | 5 | public interface AddMetalCoefficientAccessor { 6 | IMetalCoefficient getMetalCoefficient(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/embers/AlchemyCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import teamroots.embers.compat.crafttweaker.Alchemy; 5 | import teamroots.embers.recipe.AlchemyRecipe; 6 | import teamroots.embers.recipe.RecipeRegistry; 7 | import youyihj.zenrecipereloading.mixins.embers.AlchemyAddActionAccessor; 8 | import youyihj.zenrecipereloading.mixins.embers.AlchemyRemoveActionAccessor; 9 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 10 | import youyihj.zenutils.api.reload.ActionReloadCallback; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | import java.util.stream.Collectors; 15 | 16 | /** 17 | * @author youyihj 18 | */ 19 | public class AlchemyCallbacks { 20 | 21 | public static class Add extends MixinAccessibleActionReloadCallback { 22 | 23 | public Add(Alchemy.Add action) { 24 | super(action); 25 | } 26 | 27 | @Override 28 | public void undo() { 29 | RecipeRegistry.alchemyRecipes.remove(getActionAccessor().getRecipe()); 30 | } 31 | } 32 | 33 | public static class Remove extends MixinAccessibleActionReloadCallback { 34 | private List backup; 35 | 36 | public Remove(Alchemy.RemoveByOutput action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | backup = RecipeRegistry.alchemyRecipes.stream() 43 | .filter(it -> ItemStack.areItemStacksEqual(it.result, getActionAccessor().getOutput())) 44 | .collect(Collectors.toList()); 45 | } 46 | 47 | @Override 48 | public void undo() { 49 | RecipeRegistry.alchemyRecipes.addAll(backup); 50 | } 51 | } 52 | 53 | public static class RemoveAll extends ActionReloadCallback { 54 | private List backup; 55 | 56 | public RemoveAll(Alchemy.RemoveAll action) { 57 | super(action); 58 | } 59 | 60 | @Override 61 | public void beforeApply(boolean reload) { 62 | backup = new ArrayList<>(RecipeRegistry.alchemyRecipes); 63 | } 64 | 65 | @Override 66 | public void undo() { 67 | RecipeRegistry.alchemyRecipes.addAll(backup); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/embers/HeatCoilCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.embers; 2 | 3 | import teamroots.embers.compat.crafttweaker.HeatCoil; 4 | import teamroots.embers.recipe.HeatCoilRecipe; 5 | import teamroots.embers.recipe.RecipeRegistry; 6 | import youyihj.zenrecipereloading.mixins.embers.HeatCoilAddAccessor; 7 | import youyihj.zenrecipereloading.mixins.embers.HeatCoilRemoveByInputAccessor; 8 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 9 | import youyihj.zenutils.api.reload.ActionReloadCallback; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * @author youyihj 17 | */ 18 | public class HeatCoilCallbacks { 19 | public static class RemoveAll extends ActionReloadCallback { 20 | private List backup; 21 | 22 | public RemoveAll(HeatCoil.RemoveAll action) { 23 | super(action); 24 | } 25 | 26 | @Override 27 | public void beforeApply(boolean reload) { 28 | backup = new ArrayList<>(RecipeRegistry.heatCoilRecipes); 29 | } 30 | 31 | @Override 32 | public void undo() { 33 | RecipeRegistry.heatCoilRecipes.addAll(backup); 34 | } 35 | } 36 | 37 | public static class RemoveByInput extends MixinAccessibleActionReloadCallback { 38 | private List backup; 39 | 40 | public RemoveByInput(HeatCoil.RemoveByInput action) { 41 | super(action); 42 | } 43 | 44 | @Override 45 | public void beforeApply(boolean reload) { 46 | backup = RecipeRegistry.heatCoilRecipes.stream().filter(it -> it.matches(getActionAccessor().getInput())).collect(Collectors.toList()); 47 | } 48 | 49 | @Override 50 | public void undo() { 51 | RecipeRegistry.heatCoilRecipes.addAll(backup); 52 | } 53 | } 54 | 55 | public static class Add extends MixinAccessibleActionReloadCallback { 56 | 57 | public Add(HeatCoil.Add action) { 58 | super(action); 59 | } 60 | 61 | @Override 62 | public void undo() { 63 | RecipeRegistry.heatCoilRecipes.remove(getActionAccessor().getRecipe()); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/embers/MixerCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.embers; 2 | 3 | import teamroots.embers.compat.crafttweaker.Mixer; 4 | import teamroots.embers.recipe.FluidMixingRecipe; 5 | import teamroots.embers.recipe.RecipeRegistry; 6 | import youyihj.zenrecipereloading.mixins.embers.MixerAddAccessor; 7 | import youyihj.zenrecipereloading.mixins.embers.MixerRemoveByOutputAccessor; 8 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 9 | import youyihj.zenutils.api.reload.ActionReloadCallback; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * @author youyihj 17 | */ 18 | public class MixerCallbacks { 19 | public static class RemoveAll extends ActionReloadCallback { 20 | private List backup; 21 | 22 | public RemoveAll(Mixer.RemoveAll action) { 23 | super(action); 24 | } 25 | 26 | @Override 27 | public void beforeApply(boolean reload) { 28 | backup = new ArrayList<>(RecipeRegistry.mixingRecipes); 29 | } 30 | 31 | @Override 32 | public void undo() { 33 | RecipeRegistry.mixingRecipes.addAll(backup); 34 | } 35 | } 36 | 37 | public static class RemoveByOutput extends MixinAccessibleActionReloadCallback { 38 | private List backup; 39 | 40 | public RemoveByOutput(Mixer.RemoveByOutput action) { 41 | super(action); 42 | } 43 | 44 | @Override 45 | public void beforeApply(boolean reload) { 46 | backup = RecipeRegistry.mixingRecipes.stream().filter(it -> it.output.isFluidStackIdentical(getActionAccessor().getOutput())).collect(Collectors.toList()); 47 | } 48 | 49 | @Override 50 | public void undo() { 51 | RecipeRegistry.mixingRecipes.addAll(backup); 52 | } 53 | } 54 | 55 | public static class Add extends MixinAccessibleActionReloadCallback { 56 | 57 | public Add(Mixer.Add action) { 58 | super(action); 59 | } 60 | 61 | @Override 62 | public void undo() { 63 | RecipeRegistry.mixingRecipes.remove(getActionAccessor().getRecipe()); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/embers/StamperCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import teamroots.embers.compat.crafttweaker.Stamper; 5 | import teamroots.embers.recipe.ItemStampingRecipe; 6 | import teamroots.embers.recipe.RecipeRegistry; 7 | import youyihj.zenrecipereloading.mixins.embers.StamperAddAccessor; 8 | import youyihj.zenrecipereloading.mixins.embers.StamperRemoveByOutputAccessor; 9 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 10 | import youyihj.zenutils.api.reload.ActionReloadCallback; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | import java.util.stream.Collectors; 15 | 16 | /** 17 | * @author youyihj 18 | */ 19 | public class StamperCallbacks { 20 | public static class RemoveAll extends ActionReloadCallback { 21 | private List backup; 22 | 23 | public RemoveAll(Stamper.RemoveAll action) { 24 | super(action); 25 | } 26 | 27 | @Override 28 | public void beforeApply(boolean reload) { 29 | backup = new ArrayList<>(RecipeRegistry.stampingRecipes); 30 | } 31 | 32 | @Override 33 | public void undo() { 34 | RecipeRegistry.stampingRecipes.addAll(backup); 35 | } 36 | } 37 | 38 | public static class RemoveByOutput extends MixinAccessibleActionReloadCallback { 39 | private List backup; 40 | 41 | public RemoveByOutput(Stamper.RemoveByOutput action) { 42 | super(action); 43 | } 44 | 45 | @Override 46 | public void beforeApply(boolean reload) { 47 | backup = RecipeRegistry.stampingRecipes.stream().filter(it -> ItemStack.areItemsEqual(it.result, getActionAccessor().getOutput())).collect(Collectors.toList()); 48 | } 49 | 50 | @Override 51 | public void undo() { 52 | RecipeRegistry.stampingRecipes.addAll(backup); 53 | } 54 | } 55 | 56 | public static class Add extends MixinAccessibleActionReloadCallback { 57 | 58 | public Add(Stamper.Add action) { 59 | super(action); 60 | } 61 | 62 | @Override 63 | public void undo() { 64 | RecipeRegistry.stampingRecipes.remove(getActionAccessor().getRecipe()); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/extendedcrafting/CombinationCraftingCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.extendedcrafting; 2 | 3 | import com.blakebr0.extendedcrafting.crafting.CombinationRecipe; 4 | import com.blakebr0.extendedcrafting.crafting.CombinationRecipeManager; 5 | import crafttweaker.IAction; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | public class CombinationCraftingCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blakebr0.extendedcrafting.compat.crafttweaker.CombinationCrafting$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | CombinationRecipe recipe = getActionField("recipe"); 25 | CombinationRecipeManager.getInstance().getRecipes().remove(recipe); 26 | } 27 | 28 | @Override 29 | public boolean hasUndoMethod() { 30 | return true; 31 | } 32 | } 33 | 34 | public static class Remove extends PrivateActionReloadCallback { 35 | 36 | private List backup; 37 | 38 | public Remove(IAction action) { 39 | super(action); 40 | } 41 | 42 | @Override 43 | public void beforeApply(boolean reload) { 44 | backup = CombinationRecipeManager.getInstance().getRecipes().stream() 45 | .filter(it -> it.getOutput().isItemEqual(getActionField("remove"))) 46 | .collect(Collectors.toList()); 47 | } 48 | 49 | @Override 50 | public void undo() { 51 | if (backup != null) { 52 | CombinationRecipeManager.getInstance().getRecipes().addAll(backup); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean hasUndoMethod() { 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/extendedcrafting/CompressionCraftingCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.extendedcrafting; 2 | 3 | import com.blakebr0.extendedcrafting.crafting.CompressorRecipe; 4 | import com.blakebr0.extendedcrafting.crafting.CompressorRecipeManager; 5 | import crafttweaker.IAction; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | public class CompressionCraftingCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blakebr0.extendedcrafting.compat.crafttweaker.CompressionCrafting$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | CompressorRecipe recipe = getActionField("recipe"); 25 | CompressorRecipeManager.getInstance().getRecipes().remove(recipe); 26 | } 27 | 28 | @Override 29 | public boolean hasUndoMethod() { 30 | return true; 31 | } 32 | } 33 | 34 | public static class Remove extends PrivateActionReloadCallback { 35 | 36 | private List backup; 37 | 38 | public Remove(IAction action) { 39 | super(action); 40 | } 41 | 42 | @Override 43 | public void beforeApply(boolean reload) { 44 | backup = CompressorRecipeManager.getInstance().getRecipes().stream() 45 | .filter(it -> it.getOutput().isItemEqual(getActionField("remove"))) 46 | .collect(Collectors.toList()); 47 | } 48 | 49 | @Override 50 | public void undo() { 51 | if (backup != null) { 52 | CompressorRecipeManager.getInstance().getRecipes().addAll(backup); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean hasUndoMethod() { 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/extendedcrafting/EnderCraftingCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.extendedcrafting; 2 | 3 | import com.blakebr0.extendedcrafting.crafting.endercrafter.EnderCrafterRecipeManager; 4 | import crafttweaker.IAction; 5 | import net.minecraft.item.crafting.IRecipe; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | public class EnderCraftingCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blakebr0.extendedcrafting.compat.crafttweaker.EnderCrafting$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | IRecipe recipe = getActionField("recipe"); 25 | EnderCrafterRecipeManager.getInstance().getRecipes().remove(recipe); 26 | } 27 | 28 | @Override 29 | public boolean hasUndoMethod() { 30 | return true; 31 | } 32 | } 33 | 34 | public static class Remove extends PrivateActionReloadCallback { 35 | 36 | private List backup; 37 | 38 | public Remove(IAction action) { 39 | super(action); 40 | } 41 | 42 | @Override 43 | public void beforeApply(boolean reload) { 44 | backup = EnderCrafterRecipeManager.getInstance().getRecipes().stream() 45 | .filter(it -> it.getRecipeOutput().isItemEqual(getActionField("remove"))) 46 | .collect(Collectors.toList()); 47 | } 48 | 49 | @Override 50 | public void undo() { 51 | if (backup != null) { 52 | EnderCrafterRecipeManager.getInstance().getRecipes().addAll(backup); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean hasUndoMethod() { 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/extendedcrafting/ExtendedCraftingModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.extendedcrafting; 2 | 3 | import youyihj.zenrecipereloading.module.PlainModule; 4 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public class ExtendedCraftingModule extends PlainModule { 10 | public ExtendedCraftingModule() { 11 | PrivateActionReloadCallback.uncheckedRegister(CombinationCraftingCallbacks.getActionName("Add"), CombinationCraftingCallbacks.Add::new); 12 | PrivateActionReloadCallback.uncheckedRegister(CombinationCraftingCallbacks.getActionName("Remove"), CombinationCraftingCallbacks.Remove::new); 13 | PrivateActionReloadCallback.uncheckedRegister(CompressionCraftingCallbacks.getActionName("Add"), CompressionCraftingCallbacks.Add::new); 14 | PrivateActionReloadCallback.uncheckedRegister(CompressionCraftingCallbacks.getActionName("Remove"), CompressionCraftingCallbacks.Remove::new); 15 | PrivateActionReloadCallback.uncheckedRegister(EnderCraftingCallbacks.getActionName("Add"), EnderCraftingCallbacks.Add::new); 16 | PrivateActionReloadCallback.uncheckedRegister(EnderCraftingCallbacks.getActionName("Remove"), EnderCraftingCallbacks.Remove::new); 17 | PrivateActionReloadCallback.uncheckedRegister(TableCraftingCallbacks.getActionName("Add"), TableCraftingCallbacks.Add::new); 18 | PrivateActionReloadCallback.uncheckedRegister(TableCraftingCallbacks.getActionName("Remove"), TableCraftingCallbacks.Remove::new); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/extendedcrafting/TableCraftingCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.extendedcrafting; 2 | 3 | import com.blakebr0.extendedcrafting.crafting.table.ITieredRecipe; 4 | import com.blakebr0.extendedcrafting.crafting.table.TableRecipeManager; 5 | import crafttweaker.IAction; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | public class TableCraftingCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blakebr0.extendedcrafting.compat.crafttweaker.TableCrafting$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | ITieredRecipe recipe = getActionField("recipe"); 25 | TableRecipeManager.getInstance().getRecipes().remove(recipe); 26 | } 27 | 28 | @Override 29 | public boolean hasUndoMethod() { 30 | return true; 31 | } 32 | } 33 | 34 | public static class Remove extends PrivateActionReloadCallback { 35 | 36 | private List backup; 37 | 38 | public Remove(IAction action) { 39 | super(action); 40 | } 41 | 42 | @Override 43 | public void beforeApply(boolean reload) { 44 | backup = TableRecipeManager.getInstance().getRecipes().stream() 45 | .filter(it -> it.getRecipeOutput().isItemEqual(getActionField("remove"))) 46 | .collect(Collectors.toList()); 47 | } 48 | 49 | @Override 50 | public void undo() { 51 | if (backup != null) { 52 | TableRecipeManager.getInstance().getRecipes().addAll(backup); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean hasUndoMethod() { 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/forestry/AddForestryCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.forestry; 2 | 3 | import com.blamejared.mtlib.utils.BaseAddForestry; 4 | import forestry.api.recipes.IForestryRecipe; 5 | import youyihj.zenrecipereloading.mixins.forestry.BaseAddForestryAccessor; 6 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class AddForestryCallback, R extends IForestryRecipe> extends MixinAccessibleActionReloadCallback> { 12 | public AddForestryCallback(T action) { 13 | super(action); 14 | } 15 | 16 | @Override 17 | public void undo() { 18 | getActionAccessor().getProvider().removeRecipe(getActionAccessor().getRecipe()); 19 | } 20 | 21 | @Override 22 | public boolean hasUndoMethod() { 23 | return true; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/forestry/CharcoalPileCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.forestry; 2 | 3 | import crafttweaker.IAction; 4 | import forestry.api.arboriculture.ICharcoalPileWall; 5 | import forestry.api.arboriculture.TreeManager; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.block.state.IBlockState; 8 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 9 | 10 | import java.util.Objects; 11 | 12 | /** 13 | * @author youyihj 14 | */ 15 | public class CharcoalPileCallbacks { 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | Block block = getActionField("block"); 25 | IBlockState state = getActionField("state"); 26 | if (block != null) { 27 | Objects.requireNonNull(TreeManager.charcoalManager).removeWall(block); 28 | } 29 | if (state != null) { 30 | Objects.requireNonNull(TreeManager.charcoalManager).removeWall(state); 31 | } 32 | } 33 | 34 | @Override 35 | public boolean hasUndoMethod() { 36 | return true; 37 | } 38 | } 39 | 40 | public static class Remove extends PrivateActionReloadCallback { 41 | 42 | private ICharcoalPileWall recipe; 43 | 44 | public Remove(IAction action) { 45 | super(action); 46 | } 47 | 48 | @Override 49 | public void beforeApply(boolean reload) { 50 | IBlockState state = getActionField("state"); 51 | if (state == null) { 52 | Block block = getActionField("block"); 53 | state = block.getDefaultState(); 54 | } 55 | for (ICharcoalPileWall wall : Objects.requireNonNull(TreeManager.charcoalManager).getWalls()) { 56 | if (wall.matches(state)) { 57 | this.recipe = wall; 58 | break; 59 | } 60 | } 61 | } 62 | 63 | @Override 64 | public void undo() { 65 | Objects.requireNonNull(TreeManager.charcoalManager).registerWall(recipe); 66 | } 67 | 68 | @Override 69 | public boolean hasUndoMethod() { 70 | return true; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/forestry/ForestryModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.forestry; 2 | 3 | import com.blamejared.mtlib.utils.BaseAddForestry; 4 | import com.blamejared.mtlib.utils.BaseRemoveForestry; 5 | import youyihj.zenrecipereloading.module.PlainModule; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class ForestryModule extends PlainModule { 12 | public ForestryModule() { 13 | addCallbackFactory(BaseRemoveForestry.class, RemoveForestryCallback::new); 14 | addCallbackFactory(BaseAddForestry.class, AddForestryCallback::new); 15 | } 16 | 17 | @Override 18 | public void registerReloadCallbacks() { 19 | super.registerReloadCallbacks(); 20 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.forestry.CharcoalPile$Add", CharcoalPileCallbacks.Add::new); 21 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.forestry.CharcoalPile$Remove", CharcoalPileCallbacks.Remove::new); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/forestry/RemoveForestryCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.forestry; 2 | 3 | import com.blamejared.mtlib.utils.BaseRemoveForestry; 4 | import forestry.api.recipes.IForestryRecipe; 5 | import youyihj.zenrecipereloading.mixins.forestry.BaseRemoveForestryAccessor; 6 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | public class RemoveForestryCallback, R extends IForestryRecipe> extends MixinAccessibleActionReloadCallback> { 15 | private final List removed = new ArrayList<>(); 16 | 17 | public RemoveForestryCallback(T action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void beforeApply(boolean reload) { 23 | getActionAccessor().getProvider().recipes().stream().filter(action::checkIsRecipe).forEach(removed::add); 24 | } 25 | 26 | @Override 27 | public void undo() { 28 | removed.forEach(getActionAccessor().getProvider()::addRecipe); 29 | } 30 | 31 | @Override 32 | public boolean hasUndoMethod() { 33 | return true; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/gregtech/BackupRecipeAction.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.gregtech; 2 | 3 | import crafttweaker.IAction; 4 | import gregtech.api.recipes.Recipe; 5 | import gregtech.api.recipes.RecipeMap; 6 | import gregtech.api.util.EnumValidationResult; 7 | import gregtech.api.util.ValidationResult; 8 | import youyihj.zenutils.api.reload.Reloadable; 9 | import youyihj.zenutils.api.util.ReflectionInvoked; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | @Reloadable 15 | public class BackupRecipeAction implements IAction { 16 | private final Recipe backup; 17 | private final RecipeMap recipeMap; 18 | 19 | public BackupRecipeAction(Recipe backup, RecipeMap recipeMap) { 20 | this.backup = backup; 21 | this.recipeMap = recipeMap; 22 | } 23 | 24 | @Override 25 | public void apply() { 26 | 27 | } 28 | 29 | @Override 30 | public String describe() { 31 | return null; 32 | } 33 | 34 | @ReflectionInvoked 35 | public void undo() { 36 | recipeMap.addRecipe(ValidationResult.newResult(EnumValidationResult.VALID, backup)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/gregtech/BuildRecipeAction.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.gregtech; 2 | 3 | import crafttweaker.IAction; 4 | import gregtech.api.recipes.Recipe; 5 | import gregtech.api.recipes.RecipeBuilder; 6 | import gregtech.api.util.EnumValidationResult; 7 | import gregtech.api.util.ValidationResult; 8 | import youyihj.zenrecipereloading.mixins.gregtech.RecipeBuilderAccessor; 9 | import youyihj.zenutils.api.reload.Reloadable; 10 | import youyihj.zenutils.api.util.ReflectionInvoked; 11 | 12 | import java.util.function.Consumer; 13 | 14 | /** 15 | * @author youyihj 16 | */ 17 | @Reloadable 18 | public class BuildRecipeAction> implements IAction { 19 | private final R recipeBuilder; 20 | private ValidationResult recipe; 21 | 22 | @SuppressWarnings("unchecked") 23 | public BuildRecipeAction(RecipeBuilder recipeBuilder) { 24 | this.recipeBuilder = (R) recipeBuilder; 25 | } 26 | 27 | @Override 28 | @SuppressWarnings("unchecked") 29 | public void apply() { 30 | recipe = recipeBuilder.isCTRecipe().build(); 31 | Consumer onBuildAction = ((RecipeBuilderAccessor) recipeBuilder).getOnBuildAction(); 32 | if (onBuildAction != null) { 33 | onBuildAction.accept(recipeBuilder); 34 | } 35 | ((RecipeBuilderAccessor) recipeBuilder).getRecipeMap().addRecipe(recipe); 36 | } 37 | 38 | @Override 39 | public String describe() { 40 | return "Adding a GregTech recipe: " + recipeBuilder; 41 | } 42 | 43 | @ReflectionInvoked 44 | public void undo() { 45 | if (recipe.getType() == EnumValidationResult.VALID) { 46 | ((RecipeBuilderAccessor) recipeBuilder).getRecipeMap().removeRecipe(recipe.getResult()); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/gregtech/GregTechModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.gregtech; 2 | 3 | import gregtech.api.recipes.ingredients.GTRecipeOreInput; 4 | import gregtech.integration.crafttweaker.recipe.MetaItemBracketHandler; 5 | import youyihj.zenrecipereloading.module.PlainModule; 6 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 7 | 8 | public class GregTechModule extends PlainModule { 9 | @Override 10 | public void onReloadPre(ScriptReloadEvent.Pre event) { 11 | MetaItemBracketHandler.rebuildComponentRegistry(); 12 | } 13 | 14 | @Override 15 | public void onReloadPost(ScriptReloadEvent.Post event) { 16 | MetaItemBracketHandler.clearComponentRegistry(); 17 | //noinspection UnstableApiUsage 18 | GTRecipeOreInput.refreshStackCache(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/AlloySmelterCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.AlloyRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class AlloySmelterCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.AlloySmelter$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | AlloyRecipe recipe = getActionField("recipe"); 23 | AlloyRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removed = getActionField("removedRecipes"); 41 | AlloyRecipe.recipeList.addAll(removed); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/ArcFurnaceCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.ArcFurnaceRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class ArcFurnaceCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.ArcFurnace$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | ArcFurnaceRecipe recipe = getActionField("recipe"); 23 | ArcFurnaceRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removed = getActionField("removedRecipes"); 41 | ArcFurnaceRecipe.recipeList.addAll(removed); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/BlastFurnaceCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.BlastFurnaceRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class BlastFurnaceCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.BlastFurnace$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | BlastFurnaceRecipe recipe = getActionField("recipe"); 23 | BlastFurnaceRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removed = getActionField("removedRecipes"); 41 | BlastFurnaceRecipe.recipeList.addAll(removed); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | 50 | public static class AddFuel extends PrivateActionReloadCallback { 51 | public AddFuel(IAction action) { 52 | super(action); 53 | } 54 | 55 | @Override 56 | public void undo() { 57 | BlastFurnaceRecipe.BlastFurnaceFuel fuel = getActionField("fuelRecipeKey"); 58 | BlastFurnaceRecipe.blastFuels.remove(fuel); 59 | } 60 | 61 | @Override 62 | public boolean hasUndoMethod() { 63 | return true; 64 | } 65 | } 66 | 67 | public static class RemoveFuel extends PrivateActionReloadCallback { 68 | public RemoveFuel(IAction action) { 69 | super(action); 70 | } 71 | 72 | @Override 73 | public void undo() { 74 | BlastFurnaceRecipe.BlastFurnaceFuel removed = getActionField("removed"); 75 | if (removed != null) { 76 | BlastFurnaceRecipe.blastFuels.add(removed); 77 | } 78 | } 79 | 80 | @Override 81 | public boolean hasUndoMethod() { 82 | return true; 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/BlueprintCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.BlueprintCraftingRecipe; 4 | import com.google.common.collect.ArrayListMultimap; 5 | import crafttweaker.IAction; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | import java.util.List; 9 | 10 | public class BlueprintCallbacks { 11 | public static String getActionName(String path) { 12 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Blueprint$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | BlueprintCraftingRecipe recipe = getActionField("recipe"); 24 | BlueprintCraftingRecipe.recipeList.remove(recipe.blueprintCategory, recipe); 25 | } 26 | 27 | @Override 28 | public boolean hasUndoMethod() { 29 | return true; 30 | } 31 | } 32 | 33 | public static class Remove extends PrivateActionReloadCallback { 34 | 35 | public Remove(IAction action) { 36 | super(action); 37 | } 38 | 39 | @Override 40 | public void undo() { 41 | List removedRecipes = getActionField("removedRecipes"); 42 | for (BlueprintCraftingRecipe recipe : removedRecipes) { 43 | BlueprintCraftingRecipe.recipeList.remove(recipe.blueprintCategory, recipe); 44 | } 45 | } 46 | 47 | @Override 48 | public boolean hasUndoMethod() { 49 | return true; 50 | } 51 | } 52 | 53 | public static class RemoveAll extends PrivateActionReloadCallback { 54 | 55 | public RemoveAll(IAction action) { 56 | super(action); 57 | } 58 | 59 | @Override 60 | public void undo() { 61 | ArrayListMultimap removedRecipes = getActionField("removedRecipes"); 62 | BlueprintCraftingRecipe.recipeList.putAll(removedRecipes); 63 | } 64 | 65 | @Override 66 | public boolean hasUndoMethod() { 67 | return true; 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/BottlingMachineCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.BottlingMachineRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class BottlingMachineCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.BottlingMachine$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | BottlingMachineRecipe recipe = getActionField("recipe"); 23 | BottlingMachineRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | BottlingMachineRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/CokeOvenCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.CokeOvenRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class CokeOvenCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.CokeOven$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | CokeOvenRecipe recipe = getActionField("recipe"); 23 | CokeOvenRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | CokeOvenRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/CrusherCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.CrusherRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class CrusherCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Crusher$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | CrusherRecipe recipe = getActionField("recipe"); 23 | CrusherRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | CrusherRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/ExcavatorCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.tool.ExcavatorHandler; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class ExcavatorCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Excavator$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | ExcavatorHandler.MineralMix mineral = getActionField("mineral"); 23 | ExcavatorHandler.mineralList.remove(mineral); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | ArrayList mix = getActionField("mix"); 41 | ArrayList weight = getActionField("weight"); 42 | if (mix.size() == weight.size()) { 43 | for (int i = 0; i < mix.size(); i++) { 44 | ExcavatorHandler.mineralList.put(mix.get(i), weight.get(i)); 45 | } 46 | } 47 | } 48 | 49 | @Override 50 | public boolean hasUndoMethod() { 51 | return true; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/FermenterCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.FermenterRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class FermenterCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Fermenter$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | FermenterRecipe recipe = getActionField("recipe"); 23 | FermenterRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | FermenterRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/MetalPressCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.MetalPressRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class MetalPressCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.MetalPress$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | MetalPressRecipe recipe = getActionField("recipe"); 23 | MetalPressRecipe.recipeList.remove(recipe.mold, recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | for (MetalPressRecipe removedRecipe : removedRecipes) { 42 | MetalPressRecipe.recipeList.put(removedRecipe.mold, removedRecipe); 43 | } 44 | } 45 | 46 | @Override 47 | public boolean hasUndoMethod() { 48 | return true; 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/MixerCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.MixerRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class MixerCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Mixer$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | MixerRecipe recipe = getActionField("recipe"); 23 | MixerRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | MixerRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/RefineryCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.RefineryRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class RefineryCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Refinery$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | RefineryRecipe recipe = getActionField("recipe"); 23 | RefineryRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | RefineryRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/SqueezerCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.SqueezerRecipe; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | import java.util.List; 8 | 9 | public class SqueezerCallbacks { 10 | public static String getActionName(String path) { 11 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Squeezer$" + path; 12 | } 13 | 14 | public static class Add extends PrivateActionReloadCallback { 15 | 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | SqueezerRecipe recipe = getActionField("recipe"); 23 | SqueezerRecipe.recipeList.remove(recipe); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | public Remove(IAction action) { 35 | super(action); 36 | } 37 | 38 | @Override 39 | public void undo() { 40 | List removedRecipes = getActionField("removedRecipes"); 41 | SqueezerRecipe.recipeList.addAll(removedRecipes); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/immersiveengineering/ThermoelectricCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.IngredientStack; 4 | import blusunrize.immersiveengineering.api.energy.ThermoelectricHandler; 5 | import crafttweaker.IAction; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | public class ThermoelectricCallbacks { 9 | public static String getActionName(String path) { 10 | return "blusunrize.immersiveengineering.common.util.compat.crafttweaker.Thermoelectric$" + path; 11 | } 12 | 13 | public static class Add extends PrivateActionReloadCallback { 14 | 15 | public Add(IAction action) { 16 | super(action); 17 | } 18 | 19 | @Override 20 | public void undo() { 21 | IngredientStack ingredientStack = getActionField("ingredientStack"); 22 | ThermoelectricHandler.temperatureMap.remove(ingredientStack); 23 | } 24 | 25 | @Override 26 | public boolean hasUndoMethod() { 27 | return true; 28 | } 29 | } 30 | 31 | public static class Remove extends PrivateActionReloadCallback { 32 | 33 | private int temperature = -1; 34 | 35 | public Remove(IAction action) { 36 | super(action); 37 | } 38 | 39 | @Override 40 | public void beforeApply(boolean reload) { 41 | IngredientStack ingredientStack = getActionField("ingredientStack"); 42 | if (ThermoelectricHandler.temperatureMap.containsKey(ingredientStack)) { 43 | temperature = ThermoelectricHandler.temperatureMap.get(ingredientStack); 44 | } 45 | } 46 | 47 | @Override 48 | public void undo() { 49 | if (temperature != -1) { 50 | IngredientStack ingredientStack = getActionField("ingredientStack"); 51 | ThermoelectricHandler.registerSource(ingredientStack, temperature); 52 | } 53 | } 54 | 55 | @Override 56 | public boolean hasUndoMethod() { 57 | return true; 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/iwc/InWorldCraftingModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.iwc; 2 | 3 | import xt9.inworldcrafting.common.event.EntityMatcher; 4 | import xt9.inworldcrafting.common.recipe.*; 5 | import youyihj.zenrecipereloading.module.PlainModule; 6 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class InWorldCraftingModule extends PlainModule { 12 | @Override 13 | public void onReloadPre(ScriptReloadEvent.Pre event) { 14 | EntityMatcher.allValidInputs.clear(); 15 | BurnItemRecipe.recipes.clear(); 16 | ExplodeBlockRecipe.recipes.clear(); 17 | ExplodeItemRecipe.recipes.clear(); 18 | FluidToFluidRecipe.recipes.clear(); 19 | FluidToItemRecipe.recipes.clear(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/jei/JEIModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.jei; 2 | 3 | import crafttweaker.mods.jei.JEI; 4 | import crafttweaker.mods.jei.actions.*; 5 | import youyihj.zenrecipereloading.module.PlainModule; 6 | import youyihj.zenrecipereloading.util.RuntimeReloadCallback; 7 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | public class JEIModule extends PlainModule { 13 | public JEIModule() { 14 | trackActions(JEI.LATE_ACTIONS_PRE); 15 | trackActions(JEI.LATE_ACTIONS_POST); 16 | addCallbackFactory(HideAction.class, RuntimeReloadCallback::new); 17 | addCallbackFactory(HideFluidAction.class, RuntimeReloadCallback::new); 18 | addCallbackFactory(HideCategoryAction.class, RuntimeReloadCallback::new); 19 | addCallbackFactory(DescribeAction.class, RuntimeReloadCallback::new); 20 | addCallbackFactory(AddItemAction.class, RuntimeReloadCallback::new); 21 | } 22 | 23 | @Override 24 | public void onReloadPre(ScriptReloadEvent.Pre event) { 25 | super.onReloadPre(event); 26 | JEI.DESCRIPTIONS.clear(); 27 | JEI.HIDDEN_ITEMS.clear(); 28 | JEI.HIDDEN_LIQUIDS.clear(); 29 | JEI.HIDDEN_CATEGORIES.clear(); 30 | } 31 | 32 | @Override 33 | public void onReloadPost(ScriptReloadEvent.Post event) { 34 | // shouldn't apply tracked actions, they are applied while jei reloading 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/mekanism/MekanismModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.mekanism; 2 | 3 | import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; 4 | import mekanism.common.integration.crafttweaker.util.RecipeMapModification; 5 | import youyihj.zenrecipereloading.module.PlainModule; 6 | 7 | public class MekanismModule extends PlainModule { 8 | public MekanismModule() { 9 | trackActions(CrafttweakerIntegration.LATE_REMOVALS); 10 | trackActions(CrafttweakerIntegration.LATE_ADDITIONS); 11 | addCallbackFactory(RecipeMapModification.class, RecipeMapModificationCallback::new); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/mekanism/RecipeMapModificationCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.mekanism; 2 | 3 | import mekanism.common.integration.crafttweaker.util.RecipeMapModification; 4 | import mekanism.common.recipe.inputs.MachineInput; 5 | import mekanism.common.recipe.machines.MachineRecipe; 6 | import youyihj.zenrecipereloading.mixins.mekanism.RecipeMapModificationAccessor; 7 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 8 | 9 | public class RecipeMapModificationCallback, INPUT extends MachineInput, RECIPE extends MachineRecipe> 10 | extends MixinAccessibleActionReloadCallback> { 11 | public RecipeMapModificationCallback(T action) { 12 | super(action); 13 | } 14 | 15 | @Override 16 | public void undo() { 17 | RecipeMapModificationAccessor accessor = getActionAccessor(); 18 | if (accessor.isAdd()) { 19 | accessor.getRecipes().forEach((input, recipe) -> accessor.getMap().remove(input, recipe)); 20 | } else { 21 | accessor.getRecipes().forEach((input, recipe) -> accessor.getMap().put(input, recipe)); 22 | } 23 | } 24 | 25 | @Override 26 | public boolean hasUndoMethod() { 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/modtweaker/BaseListAdditionCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseListAddition; 4 | import youyihj.zenrecipereloading.mixins.modtweaker.BaseListModificationAccessor; 5 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class BaseListAdditionCallback, R> extends MixinAccessibleActionReloadCallback> { 11 | public BaseListAdditionCallback(T action) { 12 | super(action); 13 | } 14 | 15 | @Override 16 | public void undo() { 17 | getActionAccessor().getList().removeAll(getActionAccessor().getSuccessful()); 18 | } 19 | 20 | @Override 21 | public boolean hasUndoMethod() { 22 | return true; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/modtweaker/BaseListRemovalCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseListRemoval; 4 | import youyihj.zenrecipereloading.mixins.modtweaker.BaseListModificationAccessor; 5 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class BaseListRemovalCallback, R> extends MixinAccessibleActionReloadCallback> { 11 | public BaseListRemovalCallback(T action) { 12 | super(action); 13 | } 14 | 15 | @Override 16 | public void undo() { 17 | getActionAccessor().getList().addAll(getActionAccessor().getSuccessful()); 18 | } 19 | 20 | @Override 21 | public boolean hasUndoMethod() { 22 | return true; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/modtweaker/BaseMapAdditionCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseMapAddition; 4 | import youyihj.zenrecipereloading.mixins.modtweaker.BaseMapAdditionAccessor; 5 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public class BaseMapAdditionCallback, K, V> extends MixinAccessibleActionReloadCallback> { 14 | public BaseMapAdditionCallback(T action) { 15 | super(action); 16 | } 17 | 18 | @Override 19 | public void undo() { 20 | Map map = getActionAccessor().getMap(); 21 | HashMap successful = getActionAccessor().getSuccessful(); 22 | HashMap overwritten = getActionAccessor().getOverwritten(); 23 | for (K key : successful.keySet()) { 24 | if (overwritten.containsKey(key)) { 25 | map.put(key, overwritten.get(key)); 26 | } else { 27 | map.remove(key); 28 | } 29 | } 30 | } 31 | 32 | @Override 33 | public boolean hasUndoMethod() { 34 | return true; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/modtweaker/BaseMapRemovalCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseMapRemoval; 4 | import youyihj.zenrecipereloading.mixins.modtweaker.BaseMapModificationAccessor; 5 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class BaseMapRemovalCallback, K, V> extends MixinAccessibleActionReloadCallback> { 11 | public BaseMapRemovalCallback(T action) { 12 | super(action); 13 | } 14 | 15 | @Override 16 | public void undo() { 17 | getActionAccessor().getMap().putAll(getActionAccessor().getSuccessful()); 18 | } 19 | 20 | @Override 21 | public boolean hasUndoMethod() { 22 | return true; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/modtweaker/ModTweakerModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.modtweaker; 2 | 3 | import com.blamejared.ModTweaker; 4 | import com.blamejared.mtlib.utils.BaseListAddition; 5 | import com.blamejared.mtlib.utils.BaseListRemoval; 6 | import com.blamejared.mtlib.utils.BaseMapAddition; 7 | import com.blamejared.mtlib.utils.BaseMapRemoval; 8 | import youyihj.zenrecipereloading.module.PlainModule; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public class ModTweakerModule extends PlainModule { 14 | public ModTweakerModule() { 15 | trackActions(ModTweaker.LATE_REMOVALS); 16 | trackActions(ModTweaker.LATE_ADDITIONS); 17 | addCallbackFactory(BaseListAddition.class, BaseListAdditionCallback::new); 18 | addCallbackFactory(BaseListRemoval.class, BaseListRemovalCallback::new); 19 | addCallbackFactory(BaseMapAddition.class, BaseMapAdditionCallback::new); 20 | addCallbackFactory(BaseMapRemoval.class, BaseMapRemovalCallback::new); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/patchouli/PatchouliModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.patchouli; 2 | 3 | import vazkii.patchouli.api.PatchouliAPI; 4 | import youyihj.zenrecipereloading.module.IModule; 5 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 6 | 7 | public class PatchouliModule implements IModule { 8 | @Override 9 | public void registerReloadCallbacks() { 10 | 11 | } 12 | 13 | @Override 14 | public void onReloadPre(ScriptReloadEvent.Pre event) { 15 | 16 | } 17 | 18 | @Override 19 | public void onReloadPost(ScriptReloadEvent.Post event) { 20 | PatchouliAPI.instance.reloadBookContents(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/pneumaticcraft/ListAdditionCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.pneumaticcraft; 2 | 3 | import me.desht.pneumaticcraft.common.thirdparty.crafttweaker.util.ListAddition; 4 | import youyihj.zenrecipereloading.mixins.pneumaticcraft.ListModificationAccessor; 5 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 6 | 7 | public class ListAdditionCallback, E> extends MixinAccessibleActionReloadCallback> { 8 | public ListAdditionCallback(T action) { 9 | super(action); 10 | } 11 | 12 | @Override 13 | public void undo() { 14 | getActionAccessor().getEntries().removeAll(getActionAccessor().getRecipes()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/pneumaticcraft/ListRemovalCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.pneumaticcraft; 2 | 3 | import me.desht.pneumaticcraft.common.thirdparty.crafttweaker.util.ListRemoval; 4 | import youyihj.zenrecipereloading.mixins.pneumaticcraft.ListModificationAccessor; 5 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 6 | 7 | public class ListRemovalCallback, E> extends MixinAccessibleActionReloadCallback> { 8 | public ListRemovalCallback(T action) { 9 | super(action); 10 | } 11 | 12 | @Override 13 | public void undo() { 14 | getActionAccessor().getEntries().addAll(getActionAccessor().getRecipes()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/pneumaticcraft/PneumaticCraftModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.pneumaticcraft; 2 | 3 | import me.desht.pneumaticcraft.common.thirdparty.crafttweaker.CraftTweaker; 4 | import me.desht.pneumaticcraft.common.thirdparty.crafttweaker.util.ListAddition; 5 | import me.desht.pneumaticcraft.common.thirdparty.crafttweaker.util.ListRemoval; 6 | import youyihj.zenrecipereloading.module.PlainModule; 7 | 8 | public class PneumaticCraftModule extends PlainModule { 9 | public PneumaticCraftModule() { 10 | trackActions(CraftTweaker.ADDITIONS); 11 | trackActions(CraftTweaker.REMOVALS); 12 | addCallbackFactory(ListAddition.class, ListAdditionCallback::new); 13 | addCallbackFactory(ListRemoval.class, ListRemovalCallback::new); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/tconstruct/FuelCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.tconstruct; 2 | 3 | import crafttweaker.IAction; 4 | import net.minecraftforge.fluids.FluidStack; 5 | import youyihj.zenrecipereloading.mixins.tconstruct.TinkerRegistryAccessor; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | public class FuelCallbacks { 9 | public static String getActionName(String path) { 10 | return "com.blamejared.compat.tconstruct.Fuel$" + path; 11 | } 12 | 13 | public static class Add extends PrivateActionReloadCallback { 14 | 15 | public Add(IAction action) { 16 | super(action); 17 | } 18 | 19 | @Override 20 | public void undo() { 21 | FluidStack fuel = getActionField("fuel"); 22 | TinkerRegistryAccessor.getSmelteryFuels().remove(fuel); 23 | } 24 | 25 | @Override 26 | public boolean hasUndoMethod() { 27 | return true; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thaumcraft/ArcaneWorkbenchCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thaumcraft; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.handlers.ArcaneWorkbench; 4 | import net.minecraftforge.fml.common.registry.ForgeRegistries; 5 | import net.minecraftforge.registries.GameData; 6 | import net.minecraftforge.registries.RegistryManager; 7 | import thaumcraft.api.crafting.IArcaneRecipe; 8 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 9 | import youyihj.zenrecipereloading.util.ReflectionAccessibleActionReloadCallback; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | public class ArcaneWorkbenchCallbacks { 15 | public static class AddShapeless extends ReflectionAccessibleActionReloadCallback { 16 | 17 | public AddShapeless(ArcaneWorkbench.AddShapeless action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | RegistryManager.ACTIVE.getRegistry(GameData.RECIPES).remove(getActionField("location")); 24 | } 25 | } 26 | 27 | public static class AddShaped extends ReflectionAccessibleActionReloadCallback { 28 | public AddShaped(ArcaneWorkbench.AddShaped action) { 29 | super(action); 30 | } 31 | 32 | @Override 33 | public void undo() { 34 | RegistryManager.ACTIVE.getRegistry(GameData.RECIPES).remove(getActionField("location")); 35 | } 36 | } 37 | 38 | public static class Remove extends MixinAccessibleActionReloadCallback { 39 | public Remove(ArcaneWorkbench.Remove action) { 40 | super(action); 41 | } 42 | 43 | @Override 44 | public void undo() { 45 | ForgeRegistries.RECIPES.registerAll(getActionAccessor().getRemoved().toArray(new IArcaneRecipe[0])); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thaumcraft/ArcaneWorkbenchRemoveAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thaumcraft; 2 | 3 | import thaumcraft.api.crafting.IArcaneRecipe; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public interface ArcaneWorkbenchRemoveAccessor { 11 | List getRemoved(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thaumcraft/CrucibleCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thaumcraft; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.handlers.Crucible; 4 | import net.minecraft.util.ResourceLocation; 5 | import thaumcraft.api.internal.CommonInternals; 6 | import youyihj.zenrecipereloading.util.MixinAccessibleActionReloadCallback; 7 | import youyihj.zenrecipereloading.util.ReflectionAccessibleActionReloadCallback; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | public class CrucibleCallbacks { 13 | public static class Add extends ReflectionAccessibleActionReloadCallback { 14 | 15 | public Add(Crucible.Add action) { 16 | super(action); 17 | } 18 | 19 | @Override 20 | public void undo() { 21 | CommonInternals.craftingRecipeCatalog.remove((ResourceLocation) getActionField("name")); 22 | } 23 | } 24 | 25 | public static class Remove extends MixinAccessibleActionReloadCallback { 26 | 27 | public Remove(Crucible.Remove action) { 28 | super(action); 29 | } 30 | 31 | @Override 32 | public void undo() { 33 | CommonInternals.craftingRecipeCatalog.putAll(getActionAccessor().getRemoved()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thaumcraft/CrucibleRemoveAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thaumcraft; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import thaumcraft.api.crafting.IThaumcraftRecipe; 5 | 6 | import java.util.Map; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public interface CrucibleRemoveAccessor { 12 | Map getRemoved(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thaumcraft/InfusionCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thaumcraft; 2 | 3 | import crafttweaker.IAction; 4 | import net.minecraft.util.ResourceLocation; 5 | import thaumcraft.api.internal.CommonInternals; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class InfusionCallbacks { 12 | public static class Add extends PrivateActionReloadCallback { 13 | 14 | public Add(IAction action) { 15 | super(action); 16 | } 17 | 18 | @Override 19 | public void undo() { 20 | CommonInternals.craftingRecipeCatalog.remove((ResourceLocation) getActionField("resourceLocation")); 21 | } 22 | } 23 | 24 | public static class Remove extends PrivateActionReloadCallback { 25 | public Remove(IAction action) { 26 | super(action); 27 | } 28 | 29 | @Override 30 | public void undo() { 31 | CommonInternals.craftingRecipeCatalog.putAll(getActionField("removedRecipes")); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thaumcraft/ThaumcraftModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thaumcraft; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.handlers.ArcaneWorkbench; 4 | import com.blamejared.compat.thaumcraft.handlers.handlers.Crucible; 5 | import com.buuz135.thaumicjei.config.ThaumicConfig; 6 | import net.minecraftforge.fml.common.Loader; 7 | import youyihj.zenrecipereloading.module.PlainModule; 8 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 9 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | public class ThaumcraftModule extends PlainModule { 15 | public ThaumcraftModule() { 16 | addCallbackFactory(ArcaneWorkbench.AddShaped.class, ArcaneWorkbenchCallbacks.AddShaped::new); 17 | addCallbackFactory(ArcaneWorkbench.AddShapeless.class, ArcaneWorkbenchCallbacks.AddShapeless::new); 18 | addCallbackFactory(ArcaneWorkbench.Remove.class, ArcaneWorkbenchCallbacks.Remove::new); 19 | addCallbackFactory(Crucible.Add.class, CrucibleCallbacks.Add::new); 20 | addCallbackFactory(Crucible.Remove.class, CrucibleCallbacks.Remove::new); 21 | } 22 | 23 | @Override 24 | public void registerReloadCallbacks() { 25 | super.registerReloadCallbacks(); 26 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.thaumcraft.handlers.handlers.Infusion$Remove", InfusionCallbacks.Remove::new); 27 | PrivateActionReloadCallback.uncheckedRegister("com.blamejared.compat.thaumcraft.handlers.handlers.Infusion$Add", InfusionCallbacks.Add::new); 28 | } 29 | 30 | @Override 31 | public void onReloadPost(ScriptReloadEvent.Post event) { 32 | if (Loader.isModLoaded("thaumicjei")) { 33 | ThaumicConfig.hideRecipesIfMissingResearch = false; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/CompactorCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.CompactorManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class CompactorCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Compactor$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | CompactorManager.removeRecipe(getActionField("input"), getActionField("mode")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private CompactorManager.CompactorRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = CompactorManager.getRecipe(getActionField("input"), getActionField("mode")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | CompactorManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getOutput(), getActionField("mode")); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/CompressionDynamoCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.CompressionManager; 4 | import crafttweaker.IAction; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class CompressionDynamoCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blamejared.compat.thermalexpansion.dynamos.CompressionDynamo$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | FluidStack stack = getActionField("stack"); 25 | CompressionManager.removeFuel(stack.getFluid().getName()); 26 | } 27 | 28 | @Override 29 | public boolean hasUndoMethod() { 30 | return true; 31 | } 32 | } 33 | 34 | public static class Remove extends PrivateActionReloadCallback { 35 | 36 | private int prevValue; 37 | 38 | public Remove(IAction action) { 39 | super(action); 40 | } 41 | 42 | @Override 43 | public void beforeApply(boolean reload) { 44 | FluidStack stack = getActionField("stack"); 45 | prevValue = CompressionManager.getFuelEnergy(stack); 46 | } 47 | 48 | @Override 49 | public void undo() { 50 | if (prevValue != 0) { 51 | FluidStack stack = getActionField("stack"); 52 | CompressionManager.addFuel(stack.getFluid().getName(), prevValue); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean hasUndoMethod() { 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/CoolantCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.device.CoolantManager; 4 | import com.blamejared.mtlib.helpers.InputHelper; 5 | import crafttweaker.IAction; 6 | import crafttweaker.api.liquid.ILiquidStack; 7 | import net.minecraftforge.fluids.Fluid; 8 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public class CoolantCallbacks { 14 | public static String getActionName(String path) { 15 | return "com.blamejared.compat.thermalexpansion.devicemanagers.Coolant$" + path; 16 | } 17 | 18 | public static class Add extends PrivateActionReloadCallback { 19 | 20 | public Add(IAction action) { 21 | super(action); 22 | } 23 | 24 | @Override 25 | public void undo() { 26 | ILiquidStack fluid = getActionField("fluid"); 27 | CoolantManager.removeCoolant(fluid.getDefinition().getName()); 28 | } 29 | 30 | @Override 31 | public boolean hasUndoMethod() { 32 | return true; 33 | } 34 | } 35 | 36 | public static class Remove extends PrivateActionReloadCallback { 37 | 38 | private int rf, factor; 39 | private boolean valid; 40 | 41 | public Remove(IAction action) { 42 | super(action); 43 | } 44 | 45 | @Override 46 | public void beforeApply(boolean reload) { 47 | Fluid fluid = InputHelper.getFluid(getActionField("liquid")); 48 | rf = CoolantManager.getCoolantRF(fluid); 49 | factor = CoolantManager.getCoolantFactor(fluid); 50 | valid = CoolantManager.isValidCoolant(fluid); 51 | } 52 | 53 | @Override 54 | public void undo() { 55 | if (valid) { 56 | ILiquidStack fluid = getActionField("liquid"); 57 | CoolantManager.addCoolant(fluid.getDefinition().getName(), rf, factor); 58 | } 59 | } 60 | 61 | @Override 62 | public boolean hasUndoMethod() { 63 | return true; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/CrucibleCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.CrucibleManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class CrucibleCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Crucible$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | CrucibleManager.removeRecipe(getActionField("input")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private CrucibleManager.CrucibleRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = CrucibleManager.getRecipe(getActionField("input")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | CrucibleManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getOutput()); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/EnchanterCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.EnchanterManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class EnchanterCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Enchanter$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | EnchanterManager.removeRecipe(getActionField("input"), getActionField("inputSecondary")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private EnchanterManager.EnchanterRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = EnchanterManager.getRecipe(getActionField("input"), getActionField("inputSecondary")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | EnchanterManager.addRecipe(recipe.getEnergy(), recipe.getPrimaryInput(), recipe.getSecondaryInput(), recipe.getOutput(), recipe.getExperience(), recipe.getType()); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/EnervationDynamoCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.EnervationManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class EnervationDynamoCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.dynamos.EnervationDynamo$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | EnervationManager.removeFuel(getActionField("stack")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private int energy; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | energy = EnervationManager.getFuelEnergy(getActionField("stack")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (energy != 0) { 48 | EnervationManager.addFuel(getActionField("stack"), energy); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/FactorizerCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.device.FactorizerManager; 4 | import crafttweaker.IAction; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import net.minecraft.item.ItemStack; 8 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public class FactorizerCallbacks { 14 | public static String getActionName(String path) { 15 | return "com.blamejared.compat.thermalexpansion.devicemanagers.Factorizer$" + path; 16 | } 17 | 18 | public static class Add extends PrivateActionReloadCallback { 19 | 20 | public Add(IAction action) { 21 | super(action); 22 | } 23 | 24 | @Override 25 | public void undo() { 26 | ItemStack input = CraftTweakerMC.getItemStack((IItemStack) getActionField("input")); 27 | String type = getActionField("type").toString(); 28 | switch (type) { 29 | case "Spilt": 30 | FactorizerManager.removeRecipe(input, true); 31 | break; 32 | case "Combine": 33 | FactorizerManager.removeRecipe(input, false); 34 | break; 35 | case "Both": 36 | FactorizerManager.removeRecipe(input, true); 37 | FactorizerManager.removeRecipe(input, false); 38 | } 39 | } 40 | 41 | @Override 42 | public boolean hasUndoMethod() { 43 | return true; 44 | } 45 | } 46 | 47 | public static class Remove extends PrivateActionReloadCallback { 48 | 49 | private FactorizerManager.FactorizerRecipe recipe; 50 | 51 | public Remove(IAction action) { 52 | super(action); 53 | } 54 | 55 | @Override 56 | public void beforeApply(boolean reload) { 57 | recipe = FactorizerManager.getRecipe(CraftTweakerMC.getItemStack((IItemStack) getActionField("input")), getActionField("isSplit")); 58 | } 59 | 60 | @Override 61 | public void undo() { 62 | FactorizerManager.addRecipe(recipe.getInput(), recipe.getOutput(), getActionField("isSplit")); 63 | } 64 | 65 | @Override 66 | public boolean hasUndoMethod() { 67 | return true; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/ImbuerCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.BrewerManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class ImbuerCallbacks { 11 | public static String getActonName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Imbuer$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | BrewerManager.removeRecipe(getActionField("input"), getActionField("inputFluid")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private BrewerManager.BrewerRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = BrewerManager.getRecipe(getActionField("input"), getActionField("fluid")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | BrewerManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getInputFluid(), recipe.getOutputFluid()); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/InductionSmelterCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.SmelterManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class InductionSmelterCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.InductionSmelter$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | public Add(IAction action) { 17 | super(action); 18 | } 19 | 20 | @Override 21 | public void undo() { 22 | SmelterManager.removeRecipe(getActionField("primaryInput"), getActionField("secondaryInput")); 23 | } 24 | 25 | @Override 26 | public boolean hasUndoMethod() { 27 | return true; 28 | } 29 | } 30 | 31 | public static class Remove extends PrivateActionReloadCallback { 32 | 33 | private SmelterManager.SmelterRecipe recipe; 34 | 35 | public Remove(IAction action) { 36 | super(action); 37 | } 38 | 39 | @Override 40 | public void beforeApply(boolean reload) { 41 | recipe = SmelterManager.getRecipe(getActionField("primaryInput"), getActionField("secondaryInput")); 42 | } 43 | 44 | @Override 45 | public void undo() { 46 | if (recipe != null) { 47 | SmelterManager.addRecipe(recipe.getEnergy(), recipe.getPrimaryInput(), recipe.getSecondaryInput(), recipe.getPrimaryOutput(), recipe.getSecondaryOutput(), recipe.getSecondaryOutputChance()); 48 | } 49 | } 50 | 51 | @Override 52 | public boolean hasUndoMethod() { 53 | return true; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/InfuserCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.ChargerManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class InfuserCallbacks { 11 | public static String getActonName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Infuser$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | ChargerManager.removeRecipe(getActionField("input")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private ChargerManager.ChargerRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = ChargerManager.getRecipe(getActionField("input")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | ChargerManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getOutput()); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/InsolatorCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.InsolatorManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class InsolatorCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Insolator$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | InsolatorManager.removeRecipe(getActionField("primaryInput"), getActionField("secondaryInput")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private InsolatorManager.InsolatorRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = InsolatorManager.getRecipe(getActionField("primaryInput"), getActionField("secondaryInput")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | InsolatorManager.addRecipe(recipe.getEnergy(), recipe.getWater(), recipe.getPrimaryInput(), recipe.getSecondaryInput(), recipe.getSecondaryInput(), recipe.getSecondaryOutput(), recipe.getSecondaryOutputChance(), recipe.getType()); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return true; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/MagmaticDynamoCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.MagmaticManager; 4 | import crafttweaker.IAction; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class MagmaticDynamoCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blamejared.compat.thermalexpansion.dynamos.MagmaticDynamo$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | FluidStack stack = getActionField("stack"); 25 | MagmaticManager.removeFuel(stack.getFluid().getName()); 26 | } 27 | 28 | @Override 29 | public boolean hasUndoMethod() { 30 | return true; 31 | } 32 | } 33 | 34 | public static class Remove extends PrivateActionReloadCallback { 35 | 36 | private int energy; 37 | 38 | public Remove(IAction action) { 39 | super(action); 40 | } 41 | 42 | @Override 43 | public void beforeApply(boolean reload) { 44 | FluidStack stack = getActionField("stack"); 45 | energy = MagmaticManager.getFuelEnergy(stack); 46 | } 47 | 48 | @Override 49 | public void undo() { 50 | if (energy != 0) { 51 | FluidStack stack = getActionField("stack"); 52 | MagmaticManager.addFuel(stack.getFluid().getName(), energy); 53 | } 54 | } 55 | 56 | @Override 57 | public boolean hasUndoMethod() { 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/PulverizerCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.PulverizerManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class PulverizerCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.Pulverizer$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | PulverizerManager.removeRecipe(getActionField("input")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | private PulverizerManager.PulverizerRecipe recipe; 34 | 35 | public Remove(IAction action) { 36 | super(action); 37 | } 38 | 39 | @Override 40 | public void beforeApply(boolean reload) { 41 | recipe = PulverizerManager.getRecipe(getActionField("input")); 42 | } 43 | 44 | @Override 45 | public void undo() { 46 | if (recipe != null) { 47 | PulverizerManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getPrimaryOutput(), recipe.getSecondaryOutput(), recipe.getSecondaryOutputChance()); 48 | } 49 | } 50 | 51 | @Override 52 | public boolean hasUndoMethod() { 53 | return true; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/ReactantDynamoCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.ReactantManager; 4 | import crafttweaker.IAction; 5 | import net.minecraftforge.fluids.Fluid; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class ReactantDynamoCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blamejared.compat.thermalexpansion.dynamos.ReactantDynamo$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | ReactantManager.removeReaction(getActionField("stack"), getActionField("fluid")); 25 | } 26 | 27 | @Override 28 | public boolean hasUndoMethod() { 29 | return true; 30 | } 31 | } 32 | 33 | public static class AddElemental extends PrivateActionReloadCallback { 34 | 35 | public AddElemental(IAction action) { 36 | super(action); 37 | } 38 | 39 | @Override 40 | public void undo() { 41 | ReactantManager.removeElementalReaction(getActionField("stack"), getActionField("fluid")); 42 | } 43 | 44 | @Override 45 | public boolean hasUndoMethod() { 46 | return true; 47 | } 48 | } 49 | 50 | public static class Remove extends PrivateActionReloadCallback { 51 | 52 | protected ReactantManager.Reaction reaction; 53 | 54 | public Remove(IAction action) { 55 | super(action); 56 | } 57 | 58 | @Override 59 | public void beforeApply(boolean reload) { 60 | reaction = ReactantManager.getReaction(getActionField("stack"), ((Fluid) getActionField("fluid"))); 61 | } 62 | 63 | @Override 64 | public void undo() { 65 | if (reaction != null) { 66 | ReactantManager.addReaction(reaction.getReactant(), reaction.getFluid(), reaction.getEnergy()); 67 | } 68 | } 69 | 70 | @Override 71 | public boolean hasUndoMethod() { 72 | return true; 73 | } 74 | } 75 | 76 | public static class RemoveElemental extends Remove { 77 | 78 | public RemoveElemental(IAction action) { 79 | super(action); 80 | } 81 | 82 | @Override 83 | public void undo() { 84 | if (reaction != null) { 85 | ReactantManager.addElementalReaction(reaction.getReactant(), reaction.getFluid(), reaction.getEnergy()); 86 | } 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/RefineryCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.RefineryManager; 4 | import crafttweaker.IAction; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class RefineryCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blamejared.compat.thermalexpansion.Refinery$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | private final boolean potion; 19 | 20 | public Add(IAction action, boolean potion) { 21 | super(action); 22 | this.potion = potion; 23 | } 24 | 25 | @Override 26 | public void undo() { 27 | FluidStack input = getActionField("input"); 28 | if (potion) { 29 | RefineryManager.removeRecipe(input); 30 | } else { 31 | RefineryManager.removeRecipePotion(input); 32 | } 33 | } 34 | 35 | @Override 36 | public boolean hasUndoMethod() { 37 | return true; 38 | } 39 | } 40 | 41 | public static class Remove extends PrivateActionReloadCallback { 42 | 43 | private RefineryManager.RefineryRecipe recipe; 44 | 45 | public Remove(IAction action) { 46 | super(action); 47 | } 48 | 49 | @Override 50 | public void beforeApply(boolean reload) { 51 | FluidStack input = getActionField("input"); 52 | if (getActionField("potion")) { 53 | recipe = RefineryManager.getRecipePotion(input); 54 | } else { 55 | recipe = RefineryManager.getRecipe(input); 56 | } 57 | } 58 | 59 | @Override 60 | public void undo() { 61 | if (recipe != null) { 62 | if (getActionField("potion")) { 63 | RefineryManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getOutputFluid(), recipe.getOutputItem(), recipe.getChance()); 64 | } else { 65 | RefineryManager.addRecipePotion(recipe.getEnergy(), recipe.getInput(), recipe.getOutputFluid()); 66 | } 67 | } 68 | } 69 | 70 | @Override 71 | public boolean hasUndoMethod() { 72 | return true; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/SawMillCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.machine.SawmillManager; 4 | import crafttweaker.IAction; 5 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | public class SawMillCallbacks { 11 | public static String getActionName(String path) { 12 | return "com.blamejared.compat.thermalexpansion.SawMill$" + path; 13 | } 14 | 15 | public static class Add extends PrivateActionReloadCallback { 16 | 17 | public Add(IAction action) { 18 | super(action); 19 | } 20 | 21 | @Override 22 | public void undo() { 23 | SawmillManager.removeRecipe(getActionField("input")); 24 | } 25 | 26 | @Override 27 | public boolean hasUndoMethod() { 28 | return true; 29 | } 30 | } 31 | 32 | public static class Remove extends PrivateActionReloadCallback { 33 | 34 | private SawmillManager.SawmillRecipe recipe; 35 | 36 | public Remove(IAction action) { 37 | super(action); 38 | } 39 | 40 | @Override 41 | public void beforeApply(boolean reload) { 42 | recipe = SawmillManager.getRecipe(getActionField("input")); 43 | } 44 | 45 | @Override 46 | public void undo() { 47 | if (recipe != null) { 48 | SawmillManager.addRecipe(recipe.getEnergy(), recipe.getInput(), recipe.getPrimaryOutput(), recipe.getSecondaryOutput(), recipe.getSecondaryOutputChance()); 49 | } 50 | } 51 | 52 | @Override 53 | public boolean hasUndoMethod() { 54 | return false; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/thermalexpansion/SteamDynamoCallbacks.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.thermalexpansion; 2 | 3 | import cofh.thermalexpansion.util.managers.dynamo.MagmaticManager; 4 | import cofh.thermalexpansion.util.managers.dynamo.SteamManager; 5 | import crafttweaker.IAction; 6 | import youyihj.zenrecipereloading.util.PrivateActionReloadCallback; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | public class SteamDynamoCallbacks { 12 | public static String getActionName(String path) { 13 | return "com.blamejared.compat.thermalexpansion.dynamos.SteamDynamo$" + path; 14 | } 15 | 16 | public static class Add extends PrivateActionReloadCallback { 17 | 18 | public Add(IAction action) { 19 | super(action); 20 | } 21 | 22 | @Override 23 | public void undo() { 24 | SteamManager.removeFuel(getActionField("stack")); 25 | } 26 | 27 | @Override 28 | public boolean hasUndoMethod() { 29 | return true; 30 | } 31 | } 32 | 33 | public static class Remove extends PrivateActionReloadCallback { 34 | 35 | private int energy; 36 | 37 | public Remove(IAction action) { 38 | super(action); 39 | } 40 | 41 | @Override 42 | public void beforeApply(boolean reload) { 43 | energy = SteamManager.getFuelEnergy(getActionField("stack")); 44 | } 45 | 46 | @Override 47 | public void undo() { 48 | if (energy != 0) { 49 | MagmaticManager.addFuel(getActionField("stack"), energy); 50 | } 51 | } 52 | 53 | @Override 54 | public boolean hasUndoMethod() { 55 | return true; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/vanilla/ActionBaseRemoveRecipesAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.vanilla; 2 | 3 | import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; 4 | import net.minecraft.item.crafting.IRecipe; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public interface ActionBaseRemoveRecipesAccessor { 10 | Int2ObjectArrayMap zenRecipeReload$getRemovedRecipes(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/vanilla/DummyRecipe.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.vanilla; 2 | 3 | import net.minecraft.inventory.InventoryCrafting; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.item.crafting.IRecipe; 6 | import net.minecraft.world.World; 7 | import net.minecraftforge.registries.IForgeRegistryEntry; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | public class DummyRecipe extends IForgeRegistryEntry.Impl implements IRecipe { 13 | @Override 14 | public boolean matches(InventoryCrafting inv, World worldIn) { 15 | return false; 16 | } 17 | 18 | @Override 19 | public ItemStack getCraftingResult(InventoryCrafting inv) { 20 | return ItemStack.EMPTY; 21 | } 22 | 23 | @Override 24 | public boolean canFit(int width, int height) { 25 | return false; 26 | } 27 | 28 | @Override 29 | public ItemStack getRecipeOutput() { 30 | return ItemStack.EMPTY; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/compat/vanilla/IngredientMapEntryAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.compat.vanilla; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | 5 | /** 6 | * @author kurrycat 7 | */ 8 | public interface IngredientMapEntryAccessor { 9 | IIngredient zenRecipeReload$getIngredient(); 10 | 11 | T zenRecipeReload$getEntry(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/core/MixinLateInit.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.core; 2 | 3 | import com.google.common.collect.Lists; 4 | import net.minecraftforge.fml.common.Loader; 5 | import youyihj.zenutils.api.util.ReflectionInvoked; 6 | import zone.rong.mixinbooter.ILateMixinLoader; 7 | 8 | import java.util.List; 9 | import java.util.stream.Collectors; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | @ReflectionInvoked 15 | public class MixinLateInit implements ILateMixinLoader { 16 | private final List mods = Lists.newArrayList( 17 | "crafttweaker", 18 | "jei", 19 | "modtweaker", 20 | "forestry", 21 | "avaritia", 22 | "tconstruct", 23 | "gregtech", 24 | "artisanworktables", 25 | "mekanism", 26 | "pneumaticcraft", 27 | "embers", 28 | "thaumcraft", 29 | "immersiveengineering" 30 | ); 31 | 32 | @Override 33 | public List getMixinConfigs() { 34 | return mods.stream().map(it -> String.format("mixins.zenrecipereloading.%s.json", it)).collect(Collectors.toList()); 35 | } 36 | 37 | @Override 38 | public boolean shouldMixinConfigQueue(String mixinConfig) { 39 | String[] parts = mixinConfig.split("\\."); 40 | return parts.length != 4 || Loader.isModLoaded(parts[2]); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/core/ZenRecipeReloadingPlugin.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.core; 2 | 3 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 4 | import zone.rong.mixinbooter.IEarlyMixinLoader; 5 | 6 | import javax.annotation.Nullable; 7 | import java.util.Collections; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | public class ZenRecipeReloadingPlugin implements IFMLLoadingPlugin, IEarlyMixinLoader { 15 | @Override 16 | public String[] getASMTransformerClass() { 17 | return new String[0]; 18 | } 19 | 20 | @Override 21 | public String getModContainerClass() { 22 | return null; 23 | } 24 | 25 | @Nullable 26 | @Override 27 | public String getSetupClass() { 28 | return null; 29 | } 30 | 31 | @Override 32 | public void injectData(Map data) { 33 | 34 | } 35 | 36 | @Override 37 | public String getAccessTransformerClass() { 38 | return null; 39 | } 40 | 41 | @Override 42 | public List getMixinConfigs() { 43 | return Collections.singletonList("mixins.zenrecipereloading.json"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/event/EventHandler.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.event; 2 | 3 | import crafttweaker.mc1120.commands.SpecialMessagesChat; 4 | import crafttweaker.mc1120.events.ScriptRunEvent; 5 | import net.minecraft.util.text.TextFormatting; 6 | import net.minecraftforge.fml.common.Mod; 7 | import net.minecraftforge.fml.common.eventhandler.EventPriority; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | import youyihj.zenrecipereloading.compat.vanilla.CraftingRecipeCallbacks; 10 | import youyihj.zenrecipereloading.module.IModule; 11 | import youyihj.zenrecipereloading.module.ModuleRegistry; 12 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 13 | 14 | /** 15 | * @author youyihj 16 | */ 17 | @Mod.EventBusSubscriber 18 | public class EventHandler { 19 | @SubscribeEvent 20 | public static void registerActionCallbacks(ScriptRunEvent.Pre event) { 21 | ModuleRegistry.modules.forEach(IModule::registerReloadCallbacks); 22 | } 23 | 24 | @SubscribeEvent(priority = EventPriority.HIGHEST) 25 | public static void onReloadPre(ScriptReloadEvent.Pre event) { 26 | CraftingRecipeCallbacks.getRecipeRegistry().unfreeze(); 27 | ModuleRegistry.modules.forEach(it -> it.onReloadPre(event)); 28 | } 29 | 30 | @SubscribeEvent 31 | public static void onReloadPost(ScriptReloadEvent.Post event) { 32 | ModuleRegistry.modules.forEach(it -> it.onReloadPost(event)); 33 | CraftingRecipeCallbacks.getRecipeRegistry().freeze(); 34 | event.getRequester().sendMessage( 35 | SpecialMessagesChat.getClickableCommandText(TextFormatting.DARK_GREEN + "Reload JEI to review recipe modifications", "/ct jeiReload", true) 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/artisanworktables/RecipeRegistryAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.artisanworktables; 2 | 3 | import com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeRegistry; 4 | import com.codetaylor.mc.artisanworktables.api.recipe.IArtisanRecipe; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | @Mixin(value = RecipeRegistry.class, remap = false) 12 | public interface RecipeRegistryAccessor { 13 | @Accessor 14 | List getRecipeList(); 15 | 16 | @Accessor 17 | Map getRecipeMap(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/avaritia/AddRecipeActionAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.avaritia; 2 | 3 | import morph.avaritia.compat.crafttweaker.AddRecipeAction; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.registries.IForgeRegistryEntry; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | @Mixin(value = AddRecipeAction.class, remap = false) 15 | public interface AddRecipeActionAccessor> { 16 | @Accessor 17 | R getRecipe(); 18 | 19 | @Accessor 20 | Map getRegistry(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/avaritia/RemoveRecipeActionAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.avaritia; 2 | 3 | import morph.avaritia.compat.crafttweaker.RemoveRecipeAction; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.registries.IForgeRegistryEntry; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.Collection; 10 | import java.util.List; 11 | import java.util.Map; 12 | import java.util.function.Function; 13 | 14 | /** 15 | * @author youyihj 16 | */ 17 | @Mixin(value = RemoveRecipeAction.class, remap = false) 18 | public interface RemoveRecipeActionAccessor> { 19 | @Accessor 20 | Map getRegistry(); 21 | 22 | @Accessor 23 | Function, List> getFilter(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionAddFurnaceRecipeAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.actions.ActionAddFurnaceRecipe; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = ActionAddFurnaceRecipe.class, remap = false) 12 | public interface ActionAddFurnaceRecipeAccessor { 13 | @Accessor 14 | ItemStack[] getInput(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionBaseAddRecipeAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.recipes.MCRecipeManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | @Mixin(value = MCRecipeManager.ActionBaseAddRecipe.class, remap = false) 11 | public interface ActionBaseAddRecipeAccessor { 12 | @Accessor 13 | String getName(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionBaseRemoveRecipesMixin.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.recipes.MCRecipeManager; 4 | import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap; 5 | import net.minecraft.item.crafting.IRecipe; 6 | import net.minecraft.util.ResourceLocation; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Unique; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | import youyihj.zenrecipereloading.compat.vanilla.CraftingRecipeCallbacks; 13 | import youyihj.zenrecipereloading.compat.vanilla.ActionBaseRemoveRecipesAccessor; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * @author youyihj 19 | */ 20 | @Mixin(value = MCRecipeManager.ActionBaseRemoveRecipes.class, remap = false) 21 | public abstract class ActionBaseRemoveRecipesMixin implements ActionBaseRemoveRecipesAccessor { 22 | @Unique 23 | private final Int2ObjectArrayMap zenRecipeReload$removed = new Int2ObjectArrayMap<>(); 24 | 25 | @Inject(method = "removeRecipes", at = @At("HEAD")) 26 | private void recordRemoveRecipes(List removingRecipes, CallbackInfo ci) { 27 | zenRecipeReload$removed.clear(); 28 | removingRecipes.forEach(it -> { 29 | IRecipe recipe = CraftingRecipeCallbacks.getRecipeRegistry().getValue(it); 30 | int id = CraftingRecipeCallbacks.getRecipeRegistry().getID(it); 31 | zenRecipeReload$removed.put(id, recipe); 32 | }); 33 | } 34 | 35 | @Override 36 | public Int2ObjectArrayMap zenRecipeReload$getRemovedRecipes() { 37 | return zenRecipeReload$removed; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionFurnaceRemoveRecipeAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.actions.ActionFurnaceRemoveRecipe; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | import java.util.Map; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | @Mixin(value = ActionFurnaceRemoveRecipe.class, remap = false) 14 | public interface ActionFurnaceRemoveRecipeAccessor { 15 | @Accessor 16 | Map getSmeltingMap(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionOreDictAddAllAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.actions.ActionOreDictAddAll; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | /** 8 | * @author youyihj 9 | */ 10 | @Mixin(value = ActionOreDictAddAll.class, remap = false) 11 | public interface ActionOreDictAddAllAccessor { 12 | @Accessor 13 | String getIdTarget(); 14 | 15 | @Accessor 16 | String getIdSource(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionOreDictAddItemAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.actions.ActionOreDictAddItem; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = ActionOreDictAddItem.class, remap = false) 12 | public interface ActionOreDictAddItemAccessor { 13 | @Accessor 14 | String getId(); 15 | 16 | @Accessor 17 | ItemStack getItem(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionOreDictRemoveItemAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.actions.ActionOreDictRemoveItem; 4 | import net.minecraft.item.ItemStack; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = ActionOreDictRemoveItem.class, remap = false) 12 | public interface ActionOreDictRemoveItemAccessor { 13 | @Accessor 14 | String getId(); 15 | 16 | @Accessor 17 | ItemStack getItem(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionRemoveRecipesNoIngredientsAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import crafttweaker.mc1120.recipes.MCRecipeManager; 5 | import org.apache.commons.lang3.tuple.Pair; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | @Mixin(value = MCRecipeManager.ActionRemoveRecipesNoIngredients.class, remap = false) 15 | public interface ActionRemoveRecipesNoIngredientsAccessor { 16 | @Accessor 17 | List> getOutputs(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/ActionSetFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.mc1120.actions.ActionSetFuel; 4 | import crafttweaker.mc1120.furnace.SetFuelPattern; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = ActionSetFuel.class, remap = false) 12 | public interface ActionSetFuelAccessor { 13 | @Accessor 14 | SetFuelPattern getPattern(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/IngredientMapEntryMixin.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import crafttweaker.api.util.IngredientMap; 5 | import org.spongepowered.asm.mixin.Final; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import youyihj.zenrecipereloading.compat.vanilla.IngredientMapEntryAccessor; 9 | 10 | /** 11 | * @author kurrycat 12 | */ 13 | @Mixin(value = IngredientMap.IngredientMapEntry.class, remap = false) 14 | public class IngredientMapEntryMixin implements IngredientMapEntryAccessor { 15 | @Shadow 16 | @Final 17 | private IIngredient ingredient; 18 | 19 | @Shadow 20 | @Final 21 | private T entry; 22 | 23 | // We need this. 24 | // I don't know how IngredientMap.unregister is even supposed to work without this, but I suppose it wasn't implemented completely 25 | public boolean equals(Object obj) { 26 | if (this == obj) return true; 27 | if (!(obj instanceof IngredientMap.IngredientMapEntry)) return false; 28 | 29 | IngredientMap.IngredientMapEntry other = (IngredientMap.IngredientMapEntry) obj; 30 | 31 | // noinspection unchecked 32 | IngredientMapEntryAccessor otherAccessor = (IngredientMapEntryAccessor) other; 33 | return this.ingredient.equals(otherAccessor.zenRecipeReload$getIngredient()) && 34 | this.entry.equals(otherAccessor.zenRecipeReload$getEntry()); 35 | } 36 | 37 | @Override 38 | public IIngredient zenRecipeReload$getIngredient() { 39 | return ingredient; 40 | } 41 | 42 | @Override 43 | public T zenRecipeReload$getEntry() { 44 | return entry; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/IngredientTooltipsAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | 4 | import crafttweaker.api.formatting.IFormattedText; 5 | import crafttweaker.api.tooltip.ITooltipFunction; 6 | import crafttweaker.api.tooltip.IngredientTooltips; 7 | import crafttweaker.api.util.IngredientMap; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.gen.Accessor; 10 | import stanhebben.zenscript.util.Pair; 11 | 12 | import java.util.regex.Pattern; 13 | 14 | @Mixin(value = IngredientTooltips.class, remap = false) 15 | public interface IngredientTooltipsAccessor { 16 | @Accessor("TOOLTIPS") 17 | static IngredientMap> getTooltips() { 18 | throw new AssertionError(); 19 | } 20 | 21 | @Accessor("SHIFT_TOOLTIPS") 22 | static IngredientMap> getShiftTooltips() { 23 | throw new AssertionError(); 24 | } 25 | 26 | @Accessor("CLEARED_TOOLTIPS") 27 | static IngredientMap getClearedTooltips() { 28 | throw new AssertionError(); 29 | } 30 | 31 | @Accessor("TOOLTIP_FUNCTIONS") 32 | static IngredientMap> getTooltipFunctions() { 33 | throw new AssertionError(); 34 | } 35 | 36 | @Accessor("SHIFT_TOOLTIP_FUNCTIONS") 37 | static IngredientMap> getShiftTooltipFunctions() { 38 | throw new AssertionError(); 39 | } 40 | 41 | @Accessor("REMOVED_TOOLTIPS") 42 | static IngredientMap getRemovedTooltips() { 43 | throw new AssertionError(); 44 | } 45 | 46 | @Accessor("REMOVED_TOOLTIPS_LINE") 47 | static IngredientMap getRemovedTooltipsLine() { 48 | throw new AssertionError(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/crafttweaker/MCRecipeManagerAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.crafttweaker; 2 | 3 | 4 | import crafttweaker.mc1120.recipes.MCRecipeManager; 5 | import gnu.trove.set.TIntSet; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.HashSet; 10 | 11 | @Mixin(value = MCRecipeManager.class, remap = false) 12 | public interface MCRecipeManagerAccessor { 13 | @Accessor 14 | static TIntSet getUsedHashes() { 15 | throw new AssertionError(); 16 | } 17 | 18 | @Accessor 19 | static HashSet getUsedRecipeNames() { 20 | throw new AssertionError(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AddBoilerFluidAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.liquid.ILiquidStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.AddBoilerFluid.class, remap = false) 9 | public interface AddBoilerFluidAccessor { 10 | @Accessor 11 | ILiquidStack getLiquid(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AddCatalysisFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.AddCatalysisFuel.class, remap = false) 9 | public interface AddCatalysisFuelAccessor { 10 | @Accessor 11 | IIngredient getItem(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AddCombustionFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.AddCombustionFuel.class, remap = false) 9 | public interface AddCombustionFuelAccessor { 10 | @Accessor 11 | IIngredient getItem(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AddEmberFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.item.IIngredient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.AddEmberFuel.class, remap = false) 9 | public interface AddEmberFuelAccessor { 10 | @Accessor 11 | IIngredient getItem(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AddSteamEngineFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.liquid.ILiquidStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.AddSteamEngineFuel.class, remap = false) 9 | public interface AddSteamEngineFuelAccessor { 10 | @Accessor 11 | ILiquidStack getLiquid(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AlchemyAddActionAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import teamroots.embers.compat.crafttweaker.Alchemy; 6 | import teamroots.embers.recipe.AlchemyRecipe; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = Alchemy.Add.class, remap = false) 12 | public interface AlchemyAddActionAccessor { 13 | @Accessor 14 | AlchemyRecipe getRecipe(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/AlchemyRemoveActionAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.Alchemy; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = Alchemy.RemoveByOutput.class, remap = false) 12 | public interface AlchemyRemoveActionAccessor { 13 | @Accessor 14 | ItemStack getOutput(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/DawnstoneAnvilAddAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import teamroots.embers.compat.crafttweaker.DawnstoneAnvil; 6 | import teamroots.embers.recipe.DawnstoneAnvilRecipe; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = DawnstoneAnvil.Add.class, remap = false) 12 | public interface DawnstoneAnvilAddAccessor { 13 | @Accessor 14 | DawnstoneAnvilRecipe getRecipe(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/DawnstoneAnvilBlacklistBreakdownAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.crafting.Ingredient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.DawnstoneAnvil; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = DawnstoneAnvil.BlacklistBreakdown.class, remap = false) 12 | public interface DawnstoneAnvilBlacklistBreakdownAccessor { 13 | @Accessor 14 | Ingredient getMatch(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/DawnstoneAnvilBlacklistMaterialAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.crafting.Ingredient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.DawnstoneAnvil; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = DawnstoneAnvil.BlacklistMateria.class, remap = false) 12 | public interface DawnstoneAnvilBlacklistMaterialAccessor { 13 | @Accessor 14 | Ingredient getMatch(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/DawnstoneAnvilBlacklistRepairAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.crafting.Ingredient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.DawnstoneAnvil; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = DawnstoneAnvil.BlacklistRepair.class, remap = false) 12 | public interface DawnstoneAnvilBlacklistRepairAccessor { 13 | @Accessor 14 | Ingredient getMatch(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/DawnstoneAnvilRemoveAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.DawnstoneAnvil; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = DawnstoneAnvil.RemoveByInput.class, remap = false) 12 | public interface DawnstoneAnvilRemoveAccessor { 13 | @Accessor 14 | ItemStack getBottom(); 15 | 16 | @Accessor 17 | ItemStack getTop(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/HeatCoilAddAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import teamroots.embers.compat.crafttweaker.HeatCoil; 6 | import teamroots.embers.recipe.HeatCoilRecipe; 7 | 8 | @Mixin(value = HeatCoil.Add.class, remap = false) 9 | public interface HeatCoilAddAccessor { 10 | @Accessor 11 | HeatCoilRecipe getRecipe(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/HeatCoilRemoveByInputAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.HeatCoil; 7 | 8 | /** 9 | * @author youyihj 10 | */ 11 | @Mixin(value = HeatCoil.RemoveByInput.class, remap = false) 12 | public interface HeatCoilRemoveByInputAccessor { 13 | @Accessor 14 | ItemStack getInput(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/MelterAddAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import teamroots.embers.compat.crafttweaker.Melter; 6 | import teamroots.embers.recipe.ItemMeltingRecipe; 7 | 8 | @Mixin(value = Melter.Add.class, remap = false) 9 | public interface MelterAddAccessor { 10 | @Accessor 11 | ItemMeltingRecipe getRecipe(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/MelterRemoveByInputAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.Melter; 7 | 8 | @Mixin(value = Melter.RemoveByInput.class, remap = false) 9 | public interface MelterRemoveByInputAccessor { 10 | @Accessor 11 | ItemStack getInput(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/MelterRemoveByOutputAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraftforge.fluids.FluidStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.Melter; 7 | 8 | @Mixin(value = Melter.RemoveByOutput.class, remap = false) 9 | public interface MelterRemoveByOutputAccessor { 10 | @Accessor 11 | FluidStack getOutput(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/MixerAddAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import teamroots.embers.compat.crafttweaker.Mixer; 6 | import teamroots.embers.recipe.FluidMixingRecipe; 7 | 8 | @Mixin(value = Mixer.Add.class, remap = false) 9 | public interface MixerAddAccessor { 10 | @Accessor 11 | FluidMixingRecipe getRecipe(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/MixerRemoveByOutputAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraftforge.fluids.FluidStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.Mixer; 7 | 8 | @Mixin(value = Mixer.RemoveByOutput.class, remap = false) 9 | public interface MixerRemoveByOutputAccessor { 10 | @Accessor 11 | FluidStack getOutput(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/MixinAddMetalCoefficient.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Unique; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.ModifyArg; 7 | import teamroots.embers.api.misc.IMetalCoefficient; 8 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 9 | import youyihj.zenrecipereloading.compat.embers.AddMetalCoefficientAccessor; 10 | 11 | /** 12 | * @author youyihj 13 | */ 14 | @Mixin(value = EmberGeneration.AddMetalCoefficient.class, remap = false) 15 | public class MixinAddMetalCoefficient implements AddMetalCoefficientAccessor { 16 | @Unique 17 | private IMetalCoefficient metalCoefficient; 18 | 19 | @ModifyArg(method = "apply", at = @At(value = "INVOKE", target = "Lteamroots/embers/api/EmbersAPI;registerMetalCoefficient(Lteamroots/embers/api/misc/IMetalCoefficient;)V")) 20 | private IMetalCoefficient recordMetalCoefficient(IMetalCoefficient metalCoefficient) { 21 | this.metalCoefficient = metalCoefficient; 22 | return metalCoefficient; 23 | } 24 | 25 | @Override 26 | public IMetalCoefficient getMetalCoefficient() { 27 | return metalCoefficient; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/RemoveBoilerFluidAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.liquid.ILiquidStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.RemoveBoilerFluid.class, remap = false) 9 | public interface RemoveBoilerFluidAccessor { 10 | @Accessor 11 | ILiquidStack getLiquid(); 12 | } -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/RemoveCatalysisFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.RemoveCatalysisFuel.class, remap = false) 9 | public interface RemoveCatalysisFuelAccessor { 10 | @Accessor 11 | IItemStack getItem(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/RemoveCombustionFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.RemoveCombustionFuel.class, remap = false) 9 | public interface RemoveCombustionFuelAccessor { 10 | @Accessor 11 | IItemStack getItem(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/RemoveEmberFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.item.IItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.RemoveEmberFuel.class, remap = false) 9 | public interface RemoveEmberFuelAccessor { 10 | @Accessor 11 | IItemStack getItem(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/RemoveSteamEngineFuelAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import crafttweaker.api.liquid.ILiquidStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.EmberGeneration; 7 | 8 | @Mixin(value = EmberGeneration.RemoveSteamEngineFuel.class, remap = false) 9 | public interface RemoveSteamEngineFuelAccessor { 10 | @Accessor 11 | ILiquidStack getLiquid(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/StamperAddAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.gen.Accessor; 5 | import teamroots.embers.compat.crafttweaker.Stamper; 6 | import teamroots.embers.recipe.ItemStampingRecipe; 7 | 8 | @Mixin(value = Stamper.Add.class, remap = false) 9 | public interface StamperAddAccessor { 10 | @Accessor 11 | ItemStampingRecipe getRecipe(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/embers/StamperRemoveByOutputAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.embers; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import teamroots.embers.compat.crafttweaker.Stamper; 7 | 8 | @Mixin(value = Stamper.RemoveByOutput.class, remap = false) 9 | public interface StamperRemoveByOutputAccessor { 10 | @Accessor 11 | ItemStack getOutput(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/forestry/BaseAddForestryAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.forestry; 2 | 3 | import com.blamejared.mtlib.utils.BaseAddForestry; 4 | import forestry.api.recipes.ICraftingProvider; 5 | import forestry.api.recipes.IForestryRecipe; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | @Mixin(value = BaseAddForestry.class, remap = false) 13 | public interface BaseAddForestryAccessor { 14 | 15 | @Accessor 16 | ICraftingProvider getProvider(); 17 | 18 | @Accessor 19 | R getRecipe(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/forestry/BaseRemoveForestryAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.forestry; 2 | 3 | import com.blamejared.mtlib.utils.BaseRemoveForestry; 4 | import forestry.api.recipes.ICraftingProvider; 5 | import forestry.api.recipes.IForestryRecipe; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | @Mixin(value = BaseRemoveForestry.class, remap = false) 13 | public interface BaseRemoveForestryAccessor { 14 | @Accessor 15 | ICraftingProvider getProvider(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/forge/ForgeRegistryAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.forge; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import net.minecraftforge.registries.ForgeRegistry; 5 | import net.minecraftforge.registries.IForgeRegistry; 6 | import net.minecraftforge.registries.IForgeRegistryEntry; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Mutable; 9 | import org.spongepowered.asm.mixin.gen.Accessor; 10 | import org.spongepowered.asm.mixin.gen.Invoker; 11 | 12 | /** 13 | * @author youyihj 14 | */ 15 | @Mixin(value = ForgeRegistry.class, remap = false) 16 | public interface ForgeRegistryAccessor> { 17 | @Accessor 18 | @Mutable 19 | void setDummyFactory(IForgeRegistry.DummyFactory dummyFactory); 20 | 21 | @Invoker 22 | boolean callMarkDummy(ResourceLocation key, int id); 23 | 24 | @Invoker 25 | int callAdd(int id, V value, String owner); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/forge/ProgressBarMixin.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.forge; 2 | 3 | import net.minecraftforge.fml.common.ProgressManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import youyihj.zenrecipereloading.client.RuntimeProgressBarRender; 9 | 10 | @Mixin(value = ProgressManager.ProgressBar.class, remap = false) 11 | public abstract class ProgressBarMixin { 12 | @Inject(method = "step(Ljava/lang/String;)V", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;processWindowMessages()V"), cancellable = true) 13 | private void renderBarNow(String message, CallbackInfo ci) { 14 | if (RuntimeProgressBarRender.shouldRender()) { 15 | RuntimeProgressBarRender.render(); 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/gregtech/MixinCTRecipeBuilder.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.gregtech; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import gregtech.api.recipes.RecipeBuilder; 5 | import gregtech.integration.crafttweaker.recipe.CTRecipeBuilder; 6 | import org.spongepowered.asm.mixin.Final; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | import youyihj.zenrecipereloading.compat.gregtech.BuildRecipeAction; 13 | 14 | /** 15 | * @author youyihj 16 | */ 17 | @Mixin(value = CTRecipeBuilder.class, remap = false) 18 | public abstract class MixinCTRecipeBuilder { 19 | @Shadow 20 | @Final 21 | public RecipeBuilder backingBuilder; 22 | 23 | @Inject(method = "buildAndRegister", at = @At("HEAD"), cancellable = true) 24 | public void migrateToAction(CallbackInfo ci) { 25 | CraftTweakerAPI.apply(new BuildRecipeAction<>(backingBuilder)); 26 | ci.cancel(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/gregtech/MixinRecipeMap.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.gregtech; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import gregtech.api.recipes.Recipe; 5 | import gregtech.api.recipes.RecipeMap; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | import youyihj.zenrecipereloading.compat.gregtech.BackupRecipeAction; 11 | 12 | /** 13 | * @author youyihj 14 | */ 15 | @Mixin(value = RecipeMap.class, remap = false) 16 | public abstract class MixinRecipeMap { 17 | 18 | @Inject(method = "removeRecipe", at = @At("RETURN")) 19 | private void addBackup(Recipe recipe, CallbackInfoReturnable cir) { 20 | if (new Throwable().getStackTrace()[2].getClassName().endsWith("BuildRecipeAction")) { 21 | return; 22 | } 23 | if (cir.getReturnValue()) { 24 | CraftTweakerAPI.apply(new BackupRecipeAction(recipe, ((RecipeMap) ((Object) this)))); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/gregtech/RecipeBuilderAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.gregtech; 2 | 3 | import gregtech.api.recipes.RecipeBuilder; 4 | import gregtech.api.recipes.RecipeMap; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | import java.util.function.Consumer; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | @Mixin(value = RecipeBuilder.class, remap = false) 14 | public interface RecipeBuilderAccessor> { 15 | @Accessor 16 | Consumer getOnBuildAction(); 17 | 18 | @Accessor 19 | RecipeMap getRecipeMap(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/immersiveengineering/MixinArcFurnaceRecipe.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.immersiveengineering; 2 | 3 | import blusunrize.immersiveengineering.api.crafting.ArcFurnaceRecipe; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 5 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 6 | import net.minecraft.item.ItemStack; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | @Mixin(value = ArcFurnaceRecipe.class, remap = false) 14 | public class MixinArcFurnaceRecipe { 15 | @WrapOperation(method = "removeRecipes", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/oredict/OreDictionary;itemMatches(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;Z)Z")) 16 | private static boolean fixRemoveNPE(ItemStack target, ItemStack input, boolean strict, Operation original) { 17 | return target != null && input != null && original.call(target, input, strict); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/jei/JEIProxyClientAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.jei; 2 | 3 | import mezz.jei.api.IModPlugin; 4 | import mezz.jei.gui.textures.Textures; 5 | import mezz.jei.startup.JeiStarter; 6 | import mezz.jei.startup.ProxyCommonClient; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Accessor; 9 | 10 | import java.util.List; 11 | 12 | @Mixin(value = ProxyCommonClient.class, remap = false) 13 | public interface JEIProxyClientAccessor { 14 | @Accessor 15 | List getPlugins(); 16 | 17 | @Accessor 18 | JeiStarter getStarter(); 19 | 20 | @Accessor 21 | Textures getTextures(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/mekanism/RecipeMapModificationAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.mekanism; 2 | 3 | import mekanism.common.integration.crafttweaker.util.RecipeMapModification; 4 | import mekanism.common.recipe.inputs.MachineInput; 5 | import mekanism.common.recipe.machines.MachineRecipe; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.Map; 10 | 11 | @Mixin(value = RecipeMapModification.class, remap = false) 12 | public interface RecipeMapModificationAccessor, RECIPE extends MachineRecipe> { 13 | @Accessor 14 | Map getRecipes(); 15 | 16 | @Accessor 17 | Map getMap(); 18 | 19 | @Accessor 20 | boolean isAdd(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/modtweaker/BaseListModificationAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseListModification; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.LinkedList; 8 | import java.util.List; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | @Mixin(value = BaseListModification.class, remap = false) 14 | public interface BaseListModificationAccessor { 15 | @Accessor 16 | LinkedList getSuccessful(); 17 | 18 | @Accessor 19 | List getList(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/modtweaker/BaseMapAdditionAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseMapAddition; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.HashMap; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | @Mixin(value = BaseMapAddition.class, remap = false) 13 | public interface BaseMapAdditionAccessor extends BaseMapModificationAccessor { 14 | @Accessor 15 | HashMap getOverwritten(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/modtweaker/BaseMapModificationAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.modtweaker; 2 | 3 | import com.blamejared.mtlib.utils.BaseMapModification; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | @Mixin(value = BaseMapModification.class, remap = false) 14 | public interface BaseMapModificationAccessor { 15 | @Accessor 16 | Map getMap(); 17 | 18 | @Accessor 19 | HashMap getSuccessful(); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/pneumaticcraft/ListModificationAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.pneumaticcraft; 2 | 3 | import me.desht.pneumaticcraft.common.thirdparty.crafttweaker.util.ListModification; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.List; 8 | 9 | @Mixin(value = ListModification.class, remap = false) 10 | public interface ListModificationAccessor { 11 | @Accessor 12 | List getRecipes(); 13 | 14 | @Accessor 15 | List getEntries(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/tconstruct/TinkerRegistryAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.tconstruct; 2 | 3 | import com.google.common.collect.Lists; 4 | import com.google.common.collect.Maps; 5 | import net.minecraft.util.ResourceLocation; 6 | import net.minecraftforge.fluids.FluidStack; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Accessor; 9 | import slimeknights.tconstruct.library.DryingRecipe; 10 | import slimeknights.tconstruct.library.TinkerRegistry; 11 | import slimeknights.tconstruct.library.smeltery.AlloyRecipe; 12 | import slimeknights.tconstruct.library.smeltery.ICastingRecipe; 13 | import slimeknights.tconstruct.library.smeltery.MeltingRecipe; 14 | 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | @Mixin(value = TinkerRegistry.class, remap = false) 19 | public interface TinkerRegistryAccessor { 20 | @Accessor 21 | static List getMeltingRegistry() { 22 | return Lists.newArrayList(); 23 | } 24 | 25 | @Accessor 26 | static List getTableCastRegistry() { 27 | return Lists.newArrayList(); 28 | } 29 | 30 | @Accessor 31 | static List getBasinCastRegistry() { 32 | return Lists.newArrayList(); 33 | } 34 | 35 | @Accessor 36 | static List getAlloyRegistry() { 37 | return Lists.newArrayList(); 38 | } 39 | 40 | @Accessor 41 | static List getDryingRegistry() { 42 | return Lists.newArrayList(); 43 | } 44 | 45 | @Accessor 46 | static Map getSmelteryFuels() { 47 | return Maps.newHashMap(); 48 | } 49 | 50 | @Accessor 51 | static Map getEntityMeltingRegistry() { 52 | return Maps.newHashMap(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/thaumcraft/MixinArcaneWorkbenchRemoveAction.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.thaumcraft; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.handlers.ArcaneWorkbench; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 5 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 6 | import net.minecraft.util.ResourceLocation; 7 | import net.minecraftforge.registries.GameData; 8 | import net.minecraftforge.registries.RegistryManager; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Unique; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import thaumcraft.api.crafting.IArcaneRecipe; 13 | import youyihj.zenrecipereloading.compat.thaumcraft.ArcaneWorkbenchRemoveAccessor; 14 | 15 | import java.util.List; 16 | import java.util.function.Consumer; 17 | import java.util.stream.Collectors; 18 | 19 | /** 20 | * @author youyihj 21 | */ 22 | @Mixin(value = ArcaneWorkbench.Remove.class, remap = false) 23 | public abstract class MixinArcaneWorkbenchRemoveAction implements ArcaneWorkbenchRemoveAccessor { 24 | @Unique 25 | private List removedRecipes; 26 | 27 | @WrapOperation(method = "apply", at = @At(value = "INVOKE", target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V")) 28 | private void recordRemoveRecipes(List instance, Consumer consumer, Operation original) { 29 | removedRecipes = instance.stream() 30 | .map(it -> RegistryManager.ACTIVE.getRegistry(GameData.RECIPES).getValue(it)) 31 | .filter(IArcaneRecipe.class::isInstance) 32 | .map(IArcaneRecipe.class::cast) 33 | .collect(Collectors.toList()); 34 | original.call(instance, consumer); 35 | } 36 | 37 | @Override 38 | public List getRemoved() { 39 | return removedRecipes; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/thaumcraft/MixinCrucibleRemoveAction.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.thaumcraft; 2 | 3 | import com.blamejared.compat.thaumcraft.handlers.handlers.Crucible; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 5 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 6 | import net.minecraft.util.ResourceLocation; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Unique; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import thaumcraft.api.crafting.IThaumcraftRecipe; 11 | import thaumcraft.api.internal.CommonInternals; 12 | import youyihj.zenrecipereloading.compat.thaumcraft.CrucibleRemoveAccessor; 13 | 14 | import java.util.List; 15 | import java.util.Map; 16 | import java.util.function.Consumer; 17 | import java.util.function.Function; 18 | import java.util.stream.Collectors; 19 | 20 | /** 21 | * @author youyihj 22 | */ 23 | @Mixin(value = Crucible.Remove.class, remap = false) 24 | public abstract class MixinCrucibleRemoveAction implements CrucibleRemoveAccessor { 25 | @Unique 26 | private Map removedRecipes; 27 | 28 | @WrapOperation(method = "apply", at = @At(value = "INVOKE", target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V")) 29 | private void recordRemoveRecipes(List instance, Consumer consumer, Operation original) { 30 | removedRecipes = instance.stream().collect(Collectors.toMap( 31 | Function.identity(), 32 | CommonInternals.craftingRecipeCatalog::get 33 | )); 34 | original.call(instance, consumer); 35 | } 36 | 37 | @Override 38 | public Map getRemoved() { 39 | return removedRecipes; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/thaumcraft/MixinInfusionRemoveAction.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.thaumcraft; 2 | 3 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 5 | import net.minecraft.util.ResourceLocation; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import thaumcraft.api.crafting.IThaumcraftRecipe; 9 | import thaumcraft.api.internal.CommonInternals; 10 | import youyihj.zenutils.api.util.ReflectionInvoked; 11 | 12 | import java.util.List; 13 | import java.util.Map; 14 | import java.util.function.Consumer; 15 | import java.util.function.Function; 16 | import java.util.stream.Collectors; 17 | 18 | /** 19 | * @author youyihj 20 | */ 21 | @Mixin(targets = "com.blamejared.compat.thaumcraft.handlers.handlers.Infusion$Remove", remap = false) 22 | public abstract class MixinInfusionRemoveAction { 23 | @ReflectionInvoked 24 | public Map removedRecipes; 25 | 26 | @WrapOperation(method = "apply", at = @At(value = "INVOKE", target = "Ljava/util/List;forEach(Ljava/util/function/Consumer;)V")) 27 | private void recordRemoveRecipes(List instance, Consumer consumer, Operation original) { 28 | removedRecipes = instance.stream().collect(Collectors.toMap( 29 | Function.identity(), 30 | CommonInternals.craftingRecipeCatalog::get 31 | )); 32 | original.call(instance, consumer); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/mixins/vanilla/MinecraftAccessor.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.mixins.vanilla; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Minecraft.class) 8 | public interface MinecraftAccessor { 9 | @Accessor 10 | void setIsGamePaused(boolean paused); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/module/IModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.module; 2 | 3 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 4 | 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public interface IModule { 10 | 11 | void registerReloadCallbacks(); 12 | 13 | void onReloadPre(ScriptReloadEvent.Pre event); 14 | 15 | void onReloadPost(ScriptReloadEvent.Post event); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/module/ModuleRegistry.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.module; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collection; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public class ModuleRegistry { 10 | public static final Collection modules = new ArrayList<>(); 11 | 12 | public static void register(IModule module) { 13 | modules.add(module); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/module/PlainModule.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.module; 2 | 3 | import crafttweaker.CraftTweakerAPI; 4 | import crafttweaker.IAction; 5 | import youyihj.zenutils.api.reload.IActionReloadCallbackFactory; 6 | import youyihj.zenutils.api.reload.ScriptReloadEvent; 7 | 8 | import java.util.*; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public class PlainModule implements IModule { 14 | private final Map, IActionReloadCallbackFactory> callbackFactories = new HashMap<>(); 15 | private final List> trackActions = new ArrayList<>(); 16 | 17 | @Override 18 | public void registerReloadCallbacks() { 19 | registerReloadCallbacks0(); 20 | } 21 | 22 | public void addCallbackFactory(Class clazz, IActionReloadCallbackFactory callbackFactory) { 23 | callbackFactories.put(clazz, callbackFactory); 24 | } 25 | 26 | public void trackActions(Collection actions) { 27 | trackActions.add(actions); 28 | } 29 | 30 | @SuppressWarnings("unchecked") 31 | private void registerReloadCallbacks0() { 32 | callbackFactories.forEach((clazz, factory) -> { 33 | Class tClass = (Class) clazz; 34 | IActionReloadCallbackFactory callbackFactory = (IActionReloadCallbackFactory) factory; 35 | IActionReloadCallbackFactory.register(tClass, callbackFactory); 36 | }); 37 | } 38 | 39 | @Override 40 | public void onReloadPre(ScriptReloadEvent.Pre event) { 41 | trackActions.forEach(Collection::clear); 42 | } 43 | 44 | @Override 45 | public void onReloadPost(ScriptReloadEvent.Post event) { 46 | trackActions.forEach(it -> it.forEach(CraftTweakerAPI::apply)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/network/NetworkHandler.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.network; 2 | 3 | import net.minecraft.entity.player.EntityPlayerMP; 4 | import net.minecraftforge.fml.common.network.NetworkRegistry; 5 | import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | import youyihj.zenrecipereloading.ZenRecipeReloading; 8 | 9 | /** 10 | * @author youyihj 11 | */ 12 | public enum NetworkHandler { 13 | INSTANCE; 14 | 15 | NetworkHandler() { 16 | channel.registerMessage(ReloadJEIMessage.Handler.class, ReloadJEIMessage.class, 0, Side.CLIENT); 17 | } 18 | 19 | private final SimpleNetworkWrapper channel = NetworkRegistry.INSTANCE.newSimpleChannel(ZenRecipeReloading.MOD_ID); 20 | 21 | public void sendReloadJEIMessage(EntityPlayerMP player) { 22 | channel.sendTo(new ReloadJEIMessage(), player); 23 | } 24 | 25 | @SuppressWarnings("unused") 26 | public void sendReloadJEIMessageToAllPlayers() { 27 | channel.sendToAll(new ReloadJEIMessage()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/network/ReloadJEIMessage.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.network; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import mezz.jei.JustEnoughItems; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 8 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 9 | import youyihj.zenrecipereloading.ZenRecipeReloading; 10 | import youyihj.zenrecipereloading.client.RuntimeProgressBarRender; 11 | import youyihj.zenrecipereloading.mixins.jei.JEIProxyClientAccessor; 12 | 13 | import static crafttweaker.mc1120.commands.SpecialMessagesChat.getNormalMessage; 14 | 15 | /** 16 | * @author youyihj 17 | */ 18 | public class ReloadJEIMessage implements IMessage { 19 | @Override 20 | public void fromBytes(ByteBuf byteBuf) { 21 | 22 | } 23 | 24 | @Override 25 | public void toBytes(ByteBuf byteBuf) { 26 | 27 | } 28 | 29 | public static class Handler implements IMessageHandler { 30 | 31 | @Override 32 | public IMessage onMessage(ReloadJEIMessage reloadJEIMessage, MessageContext messageContext) { 33 | Minecraft.getMinecraft().addScheduledTask(ReloadJEIMessage::reloadJEI); 34 | return null; 35 | } 36 | } 37 | 38 | private static void reloadJEI() { 39 | Minecraft mc = Minecraft.getMinecraft(); 40 | ZenRecipeReloading.logger.info("Reloading JEI"); 41 | RuntimeProgressBarRender.start("Reloading JEI"); 42 | JEIProxyClientAccessor jeiProxy = (JEIProxyClientAccessor) JustEnoughItems.getProxy(); 43 | long a = System.currentTimeMillis(); 44 | jeiProxy.getStarter().start(jeiProxy.getPlugins(), jeiProxy.getTextures()); 45 | long b = System.currentTimeMillis(); 46 | RuntimeProgressBarRender.end(); 47 | mc.player.sendMessage(getNormalMessage("Reloaded JEI successfully in " + (b - a) + "ms")); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/util/MixinAccessibleActionReloadCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.util; 2 | 3 | import crafttweaker.IAction; 4 | import youyihj.zenutils.api.reload.ActionReloadCallback; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public abstract class MixinAccessibleActionReloadCallback extends ActionReloadCallback { 10 | public MixinAccessibleActionReloadCallback(T action) { 11 | super(action); 12 | } 13 | 14 | @SuppressWarnings("unchecked") 15 | protected ACCESSOR getActionAccessor() { 16 | return ((ACCESSOR) action); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/util/PrivateActionReloadCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.util; 2 | 3 | import crafttweaker.IAction; 4 | import youyihj.zenutils.api.reload.IActionReloadCallbackFactory; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public abstract class PrivateActionReloadCallback extends ReflectionAccessibleActionReloadCallback { 10 | 11 | public PrivateActionReloadCallback(IAction action) { 12 | super(action); 13 | } 14 | 15 | @SuppressWarnings("unchecked") 16 | public static void uncheckedRegister(String className, Factory factory) { 17 | try { 18 | Class clazz = (Class) Class.forName(className); 19 | IActionReloadCallbackFactory.register(clazz, factory); 20 | } catch (ClassNotFoundException e) { 21 | throw new RuntimeException("No such action class", e); 22 | } 23 | } 24 | 25 | public interface Factory extends IActionReloadCallbackFactory { 26 | @Override 27 | PrivateActionReloadCallback create(IAction action); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/util/ReflectionAccessibleActionReloadCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.util; 2 | 3 | import com.google.common.collect.HashBasedTable; 4 | import com.google.common.collect.Table; 5 | import crafttweaker.IAction; 6 | import youyihj.zenutils.api.reload.ActionReloadCallback; 7 | 8 | import java.lang.reflect.Field; 9 | 10 | /** 11 | * @author youyihj 12 | */ 13 | public abstract class ReflectionAccessibleActionReloadCallback extends ActionReloadCallback { 14 | private static final Table, String, Field> FIELD_CACHE = HashBasedTable.create(); 15 | 16 | public ReflectionAccessibleActionReloadCallback(T action) { 17 | super(action); 18 | } 19 | 20 | @SuppressWarnings("unchecked") 21 | protected final U getActionField(String fieldName) { 22 | try { 23 | return (U) findField(fieldName).get(action); 24 | } catch (IllegalAccessException | NoSuchFieldException e) { 25 | throw new RuntimeException(e); 26 | } 27 | } 28 | 29 | private Field findField(String fieldName) throws NoSuchFieldException { 30 | Class actionClass = action.getClass(); 31 | Field field = FIELD_CACHE.get(actionClass, fieldName); 32 | if (field == null) { 33 | for (Class clazz = actionClass; clazz != null; clazz = clazz.getSuperclass()) { 34 | try { 35 | field = clazz.getDeclaredField(fieldName); 36 | break; 37 | } catch (NoSuchFieldException ignored) { 38 | 39 | } 40 | } 41 | if (field != null) { 42 | field.setAccessible(true); 43 | FIELD_CACHE.put(actionClass, fieldName, field); 44 | } else { 45 | throw new NoSuchFieldException(fieldName + " does not exist in " + actionClass.getSimpleName() + " or any of its superclasses."); 46 | } 47 | } 48 | return field; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/util/RuntimePrivateActionReloadCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.util; 2 | 3 | import crafttweaker.IAction; 4 | 5 | public class RuntimePrivateActionReloadCallback extends PrivateActionReloadCallback { 6 | public RuntimePrivateActionReloadCallback(IAction action) { 7 | super(action); 8 | } 9 | 10 | @Override 11 | public boolean hasUndoMethod() { 12 | return false; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/youyihj/zenrecipereloading/util/RuntimeReloadCallback.java: -------------------------------------------------------------------------------- 1 | package youyihj.zenrecipereloading.util; 2 | 3 | import crafttweaker.IAction; 4 | import youyihj.zenutils.api.reload.ActionReloadCallback; 5 | 6 | /** 7 | * @author youyihj 8 | */ 9 | public class RuntimeReloadCallback extends ActionReloadCallback { 10 | public RuntimeReloadCallback(T action) { 11 | super(action); 12 | } 13 | 14 | @Override 15 | public boolean hasUndoMethod() { 16 | return false; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "zenrecipereloading", 4 | "name": "ZenRecipeReloading", 5 | "description": "Recipe hot reloading for CraftTweaker 1.12", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": ["youyihj"], 11 | "credits": "", 12 | "logoFile": "", 13 | "screenshots": [], 14 | "dependencies": [] 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.artisanworktables.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.artisanworktables", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "RecipeRegistryAccessor" 11 | ], 12 | "client": [ 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.avaritia.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.avaritia", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "AddRecipeActionAccessor", 11 | "RemoveRecipeActionAccessor" 12 | ], 13 | "client": [ 14 | 15 | ] 16 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.crafttweaker.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.crafttweaker", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "ActionAddFurnaceRecipeAccessor", 11 | "ActionBaseAddRecipeAccessor", 12 | "ActionBaseRemoveRecipesMixin", 13 | "ActionFurnaceRemoveRecipeAccessor", 14 | "ActionOreDictAddAllAccessor", 15 | "ActionOreDictAddItemAccessor", 16 | "ActionOreDictRemoveItemAccessor", 17 | "ActionRemoveRecipesNoIngredientsAccessor", 18 | "ActionSetFuelAccessor", 19 | "IngredientMapEntryMixin", 20 | "IngredientTooltipsAccessor", 21 | "MCRecipeManagerAccessor" 22 | ], 23 | "client": [ 24 | ] 25 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.embers.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.embers", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "AddBoilerFluidAccessor", 11 | "AddCatalysisFuelAccessor", 12 | "AddCombustionFuelAccessor", 13 | "AddEmberFuelAccessor", 14 | "AddSteamEngineFuelAccessor", 15 | "AlchemyAddActionAccessor", 16 | "AlchemyRemoveActionAccessor", 17 | "DawnstoneAnvilAddAccessor", 18 | "DawnstoneAnvilBlacklistBreakdownAccessor", 19 | "DawnstoneAnvilBlacklistMaterialAccessor", 20 | "DawnstoneAnvilBlacklistRepairAccessor", 21 | "DawnstoneAnvilRemoveAccessor", 22 | "HeatCoilAddAccessor", 23 | "HeatCoilRemoveByInputAccessor", 24 | "MelterAddAccessor", 25 | "MelterRemoveByInputAccessor", 26 | "MelterRemoveByOutputAccessor", 27 | "MixerAddAccessor", 28 | "MixerRemoveByOutputAccessor", 29 | "MixinAddMetalCoefficient", 30 | "RemoveBoilerFluidAccessor", 31 | "RemoveCatalysisFuelAccessor", 32 | "RemoveCombustionFuelAccessor", 33 | "RemoveEmberFuelAccessor", 34 | "RemoveSteamEngineFuelAccessor", 35 | "StamperAddAccessor", 36 | "StamperRemoveByOutputAccessor" 37 | ], 38 | "client": [ 39 | ] 40 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.forestry.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.forestry", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "BaseRemoveForestryAccessor", 11 | "BaseAddForestryAccessor" 12 | ], 13 | "client": [ 14 | ] 15 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.gregtech.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.gregtech", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "MixinCTRecipeBuilder", 11 | "MixinRecipeMap", 12 | "RecipeBuilderAccessor" 13 | ], 14 | "client": [ 15 | ] 16 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.immersiveengineering.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.immersiveengineering", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "MixinArcFurnaceRecipe" 11 | ], 12 | "client": [ 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.jei.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.jei", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | ], 11 | "client": [ 12 | "JEIProxyClientAccessor" 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "forge.ForgeRegistryAccessor", 11 | "forge.ProgressBarMixin" 12 | ], 13 | "client": [ 14 | "vanilla.MinecraftAccessor" 15 | ] 16 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.mekanism.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.mekanism", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "RecipeMapModificationAccessor" 11 | ], 12 | "client": [ 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.modtweaker.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.modtweaker", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "BaseListModificationAccessor", 11 | "BaseMapModificationAccessor", 12 | "BaseMapAdditionAccessor" 13 | ], 14 | "client": [ 15 | ] 16 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.pneumaticcraft.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.pneumaticcraft", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "ListModificationAccessor" 11 | ], 12 | "client": [ 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.tconstruct.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.tconstruct", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "TinkerRegistryAccessor" 11 | ], 12 | "client": [ 13 | ] 14 | } -------------------------------------------------------------------------------- /src/main/resources/mixins.zenrecipereloading.thaumcraft.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "youyihj.zenrecipereloading.mixins.thaumcraft", 5 | "minVersion": "0.7.11", 6 | "setSourceFile": true, 7 | "priority": 0, 8 | "refmap": "mixins.zenrecipereloading.refmap.json", 9 | "mixins": [ 10 | "MixinArcaneWorkbenchRemoveAction", 11 | "MixinCrucibleRemoveAction", 12 | "MixinInfusionRemoveAction" 13 | ], 14 | "client": [ 15 | ] 16 | } -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "examplemod resources", 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 | --------------------------------------------------------------------------------