This should be a CT support for fluid replicator

This commit is contained in:
drcrazy 2018-04-27 15:01:46 +03:00
parent 6e02bb8153
commit be52e991a7
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,58 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.compat.crafttweaker;
import java.util.Optional;
import net.minecraftforge.fluids.Fluid;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
/**
* @author drcrazy
*
*/
@ZenClass("mods.techreborn.fluidReplicator")
public class CTFluidReplicator {
@ZenMethod
@ZenDocumentation("int input, ILiquidStack output, int ticks, int euPerTick")
public static void addRecipe(int input, Fluid output, int ticks, int euPerTick) {
if(input > 0 || ticks > 0 || euPerTick > 0){
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(input, output, ticks, euPerTick));
}
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removeRecipe(Fluid output) {
Optional<FluidReplicatorRecipe> recipe = FluidReplicatorRecipeList.getRecipeForFluid(output);
if (recipe.isPresent()) {
FluidReplicatorRecipeList.removeRecipe(recipe.get());
}
}
}

View file

@ -90,6 +90,7 @@ public class CraftTweakerCompat implements ICompatModule {
CraftTweakerAPI.registerClass(CTDistillationTower.class);
CraftTweakerAPI.registerClass(CTGrinder.class);
CraftTweakerAPI.registerClass(CTExtractor.class);
CraftTweakerAPI.registerClass(CTFluidReplicator.class);
}
@Override