Added dynamo support, Close #656
This commit is contained in:
parent
c3c7ab4158
commit
5f0ac9729a
6 changed files with 537 additions and 0 deletions
|
@ -0,0 +1,71 @@
|
|||
package com.blamejared.compat.thermalexpansion.dynamos;
|
||||
|
||||
import cofh.thermalexpansion.util.managers.dynamo.CompressionManager;
|
||||
import com.blamejared.ModTweaker;
|
||||
import com.blamejared.mtlib.helpers.*;
|
||||
import com.blamejared.mtlib.utils.BaseAction;
|
||||
import crafttweaker.annotations.*;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.CompressionDynamo")
|
||||
@ModOnly("thermalexpansion")
|
||||
@ZenRegister
|
||||
public class CompressionDynamo {
|
||||
|
||||
@ZenMethod
|
||||
public static void addFuel(ILiquidStack stack, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(stack), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeFuel(ILiquidStack stack) {
|
||||
ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(stack)));
|
||||
}
|
||||
|
||||
|
||||
private static class Add extends BaseAction {
|
||||
|
||||
private FluidStack stack;
|
||||
private int energy;
|
||||
|
||||
protected Add(FluidStack stack, int energy) {
|
||||
super("CompressionDynamo");
|
||||
this.stack = stack;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
CompressionManager.addFuel(stack.getFluid().getName(), energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove extends BaseAction {
|
||||
|
||||
private FluidStack stack;
|
||||
|
||||
protected Remove(FluidStack stack) {
|
||||
super("CompressionDynamo");
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
CompressionManager.removeFuel(stack.getFluid().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.blamejared.compat.thermalexpansion.dynamos;
|
||||
|
||||
import cofh.thermalexpansion.util.managers.dynamo.EnervationManager;
|
||||
import com.blamejared.ModTweaker;
|
||||
import com.blamejared.mtlib.helpers.*;
|
||||
import com.blamejared.mtlib.utils.BaseAction;
|
||||
import crafttweaker.annotations.*;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.EnervationDynamo")
|
||||
@ModOnly("thermalexpansion")
|
||||
@ZenRegister
|
||||
public class EnervationDynamo {
|
||||
|
||||
@ZenMethod
|
||||
public static void addFuel(IItemStack stack, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(stack), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeFuel(IItemStack stack) {
|
||||
ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(stack)));
|
||||
}
|
||||
|
||||
|
||||
private static class Add extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private int energy;
|
||||
|
||||
protected Add(ItemStack stack, int energy) {
|
||||
super("EnervationDynamo");
|
||||
this.stack = stack;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
EnervationManager.addFuel(stack, energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
|
||||
protected Remove(ItemStack stack) {
|
||||
super("EnervationDynamo");
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
EnervationManager.removeFuel(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.blamejared.compat.thermalexpansion.dynamos;
|
||||
|
||||
import cofh.thermalexpansion.util.managers.dynamo.*;
|
||||
import com.blamejared.ModTweaker;
|
||||
import com.blamejared.mtlib.helpers.*;
|
||||
import com.blamejared.mtlib.utils.BaseAction;
|
||||
import crafttweaker.annotations.*;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.MagmaticDynamo")
|
||||
@ModOnly("thermalexpansion")
|
||||
@ZenRegister
|
||||
public class MagmaticDynamo {
|
||||
|
||||
@ZenMethod
|
||||
public static void addFuel(ILiquidStack stack, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toFluid(stack), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeFuel(ILiquidStack stack) {
|
||||
ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toFluid(stack)));
|
||||
}
|
||||
|
||||
|
||||
private static class Add extends BaseAction {
|
||||
|
||||
private FluidStack stack;
|
||||
private int energy;
|
||||
|
||||
protected Add(FluidStack stack, int energy) {
|
||||
super("MagmaticDynamo");
|
||||
this.stack = stack;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
MagmaticManager.addFuel(stack.getFluid().getName(), energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove extends BaseAction {
|
||||
|
||||
private FluidStack stack;
|
||||
|
||||
protected Remove(FluidStack stack) {
|
||||
super("MagmaticDynamo");
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
MagmaticManager.removeFuel(stack.getFluid().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package com.blamejared.compat.thermalexpansion.dynamos;
|
||||
|
||||
import cofh.thermalexpansion.util.managers.dynamo.NumismaticManager;
|
||||
import com.blamejared.ModTweaker;
|
||||
import com.blamejared.mtlib.helpers.*;
|
||||
import com.blamejared.mtlib.utils.BaseAction;
|
||||
import crafttweaker.annotations.*;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.NumisticDynamo")
|
||||
@ModOnly("thermalexpansion")
|
||||
@ZenRegister
|
||||
public class NumisticDynamo {
|
||||
|
||||
@ZenMethod
|
||||
public static void addFuel(IItemStack stack, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(stack), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeFuel(IItemStack stack) {
|
||||
ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(stack)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addGemFuel(IItemStack stack, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new AddGem(InputHelper.toStack(stack), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeGemFuel(IItemStack stack) {
|
||||
ModTweaker.LATE_REMOVALS.add(new RemoveGem(InputHelper.toStack(stack)));
|
||||
}
|
||||
|
||||
|
||||
private static class Add extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private int energy;
|
||||
|
||||
protected Add(ItemStack stack, int energy) {
|
||||
super("NumisticDynamo");
|
||||
this.stack = stack;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
NumismaticManager.addFuel(stack, energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
|
||||
protected Remove(ItemStack stack) {
|
||||
super("NumisticDynamo");
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
NumismaticManager.removeFuel(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class AddGem extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private int energy;
|
||||
|
||||
protected AddGem(ItemStack stack, int energy) {
|
||||
super("NumisticDynamoGem");
|
||||
this.stack = stack;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
NumismaticManager.addGemFuel(stack, energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveGem extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
|
||||
protected RemoveGem(ItemStack stack) {
|
||||
super("NumisticDynamoGem");
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
NumismaticManager.removeGemFuel(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
package com.blamejared.compat.thermalexpansion.dynamos;
|
||||
|
||||
import cofh.thermalexpansion.util.managers.dynamo.ReactantManager;
|
||||
import com.blamejared.ModTweaker;
|
||||
import com.blamejared.mtlib.helpers.*;
|
||||
import com.blamejared.mtlib.utils.BaseAction;
|
||||
import crafttweaker.annotations.*;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.ReactantDynamo")
|
||||
@ModOnly("thermalexpansion")
|
||||
@ZenRegister
|
||||
public class ReactantDynamo {
|
||||
|
||||
@ZenMethod
|
||||
public static void addReaction(IItemStack stack, ILiquidStack fluid, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(stack), InputHelper.toFluid(fluid).getFluid(), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addReactionElemental(IItemStack stack, ILiquidStack fluid, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new AddElemental(InputHelper.toStack(stack), InputHelper.toFluid(fluid).getFluid(), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeReaction(IItemStack stack, ILiquidStack fluid) {
|
||||
ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(stack), InputHelper.toFluid(fluid).getFluid()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeReactionElemental(IItemStack stack, ILiquidStack fluid) {
|
||||
ModTweaker.LATE_REMOVALS.add(new RemoveElemental(InputHelper.toStack(stack), InputHelper.toFluid(fluid).getFluid()));
|
||||
}
|
||||
|
||||
private static class Add extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private Fluid fluid;
|
||||
private int energy;
|
||||
|
||||
protected Add(ItemStack stack, Fluid fluid, int energy) {
|
||||
super("ReactantDynamo");
|
||||
this.stack = stack;
|
||||
this.fluid = fluid;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ReactantManager.addReaction(stack, fluid, energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack) + " " + LogHelper.getStackDescription(fluid);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private Fluid fluid;
|
||||
|
||||
protected Remove(ItemStack stack, Fluid fluid) {
|
||||
super("ReactantDynamo");
|
||||
this.stack = stack;
|
||||
this.fluid = fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ReactantManager.removeReaction(stack, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack) + " " + LogHelper.getStackDescription(fluid);
|
||||
}
|
||||
}
|
||||
|
||||
private static class AddElemental extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private Fluid fluid;
|
||||
private int energy;
|
||||
|
||||
protected AddElemental(ItemStack stack, Fluid fluid, int energy) {
|
||||
super("ReactantDynamoElemental");
|
||||
this.stack = stack;
|
||||
this.fluid = fluid;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ReactantManager.addElementalReaction(stack, fluid, energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack) + " " + LogHelper.getStackDescription(fluid);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveElemental extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private Fluid fluid;
|
||||
|
||||
protected RemoveElemental(ItemStack stack, Fluid fluid) {
|
||||
super("ReactantDynamo");
|
||||
this.stack = stack;
|
||||
this.fluid = fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
ReactantManager.removeElementalReaction(stack, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack) + " " + LogHelper.getStackDescription(fluid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.blamejared.compat.thermalexpansion.dynamos;
|
||||
|
||||
import cofh.thermalexpansion.util.managers.dynamo.SteamManager;
|
||||
import com.blamejared.ModTweaker;
|
||||
import com.blamejared.mtlib.helpers.*;
|
||||
import com.blamejared.mtlib.utils.BaseAction;
|
||||
import crafttweaker.annotations.*;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
@ZenClass("mods.thermalexpansion.SteamDynamo")
|
||||
@ModOnly("thermalexpansion")
|
||||
@ZenRegister
|
||||
public class SteamDynamo {
|
||||
|
||||
@ZenMethod
|
||||
public static void addFuel(IItemStack stack, int energy) {
|
||||
ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(stack), energy));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeFuel(IItemStack stack) {
|
||||
ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(stack)));
|
||||
}
|
||||
|
||||
|
||||
private static class Add extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
private int energy;
|
||||
|
||||
protected Add(ItemStack stack, int energy) {
|
||||
super("SteamDynamo");
|
||||
this.stack = stack;
|
||||
this.energy = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
SteamManager.addFuel(stack, energy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove extends BaseAction {
|
||||
|
||||
private ItemStack stack;
|
||||
|
||||
protected Remove(ItemStack stack) {
|
||||
super("SteamDynamo");
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
SteamManager.removeFuel(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRecipeInfo() {
|
||||
return LogHelper.getStackDescription(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue