Moved recipe handlers to Api
This commit is contained in:
parent
1f9600b33c
commit
cfaabab37a
12 changed files with 24 additions and 19 deletions
|
@ -0,0 +1,18 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class AlloySmelterRecipe extends BaseRecipe {
|
||||
|
||||
public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super("alloySmelterRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(input2 != null)
|
||||
inputs.add(input2);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class AssemblingMachineRecipe extends BaseRecipe {
|
||||
|
||||
public AssemblingMachineRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super("assemblingMachineRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(input2 != null)
|
||||
inputs.add(input2);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class CentrifugeRecipe extends BaseRecipe {
|
||||
|
||||
public CentrifugeRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick)
|
||||
{
|
||||
super("centrifugeRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(input2 != null)
|
||||
inputs.add(input2);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
if(output2 != null)
|
||||
outputs.add(output2);
|
||||
if(output3 != null)
|
||||
outputs.add(output3);
|
||||
if(output4 != null)
|
||||
outputs.add(output4);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class ChemicalReactorRecipe extends BaseRecipe {
|
||||
|
||||
public ChemicalReactorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super("chemicalReactorRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(input2 != null)
|
||||
inputs.add(input2);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.tiles.TileGrinder;
|
||||
|
||||
public class GrinderRecipe extends BaseRecipe {
|
||||
|
||||
public FluidStack fluidStack;
|
||||
|
||||
public GrinderRecipe(ItemStack input1, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick)
|
||||
{
|
||||
super("grinderRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
if(output2 != null)
|
||||
outputs.add(output2);
|
||||
if(output3 != null)
|
||||
outputs.add(output3);
|
||||
if(output4 != null)
|
||||
outputs.add(output4);
|
||||
this.fluidStack = fluidStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
if(tile instanceof TileGrinder){
|
||||
TileGrinder grinder = (TileGrinder) tile;
|
||||
if(grinder.tank.getFluid() == null){
|
||||
return false;
|
||||
}
|
||||
if(grinder.tank.getFluid().getFluidID() == fluidStack.getFluidID()){
|
||||
if(grinder.tank.getFluidAmount() >= fluidStack.amount){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile) {
|
||||
if(tile instanceof TileGrinder) {
|
||||
TileGrinder grinder = (TileGrinder) tile;
|
||||
if(grinder.tank.getFluid() == null){
|
||||
return false;
|
||||
}
|
||||
if(grinder.tank.getFluid().getFluidID() == fluidStack.getFluidID()){
|
||||
if(grinder.tank.getFluidAmount() >= fluidStack.amount){
|
||||
if(grinder.tank.getFluidAmount() > 0){
|
||||
grinder.tank.setFluid(new FluidStack(fluidStack.getFluid(), grinder.tank.getFluidAmount() - fluidStack.amount));
|
||||
} else {
|
||||
grinder.tank.setFluid(null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class ImplosionCompressorRecipe extends BaseRecipe {
|
||||
|
||||
public ImplosionCompressorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime, int euPerTick) {
|
||||
super("implosionCompressorRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(input2 != null)
|
||||
inputs.add(input2);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
if(output2 != null)
|
||||
outputs.add(output2);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class IndustrialSawmillRecipe extends BaseRecipe {
|
||||
|
||||
public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, int tickTime, int euPerTick)
|
||||
{
|
||||
super("industrialSawmillRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(input2 != null)
|
||||
inputs.add(input2);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
if(output2 != null)
|
||||
outputs.add(output2);
|
||||
if(output3 != null)
|
||||
outputs.add(output3);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class LatheRecipe extends BaseRecipe {
|
||||
|
||||
public LatheRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super("latheRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package techreborn.api.recipe.machines;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
|
||||
public class PlateCuttingMachineRecipe extends BaseRecipe {
|
||||
|
||||
public PlateCuttingMachineRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick)
|
||||
{
|
||||
super("plateCuttingMachineRecipe", tickTime, euPerTick);
|
||||
if(input1 != null)
|
||||
inputs.add(input1);
|
||||
if(output1 != null)
|
||||
outputs.add(output1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI")
|
||||
package techreborn.api.recipe.machines;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue