Add Integration Table Recipe API

This commit is contained in:
CovertJaguar 2013-12-28 01:24:18 -08:00
parent 4356c1098b
commit edf8f17a6f
5 changed files with 92 additions and 0 deletions

View file

@ -66,6 +66,7 @@ import buildcraft.core.triggers.TriggerMachine;
import buildcraft.core.utils.BCLog;
import buildcraft.core.utils.Localization;
import buildcraft.core.recipes.AssemblyRecipeManager;
import buildcraft.core.recipes.IntegrationRecipeManager;
import buildcraft.core.triggers.TriggerRedstoneInput;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -156,6 +157,7 @@ public class BuildCraftCore {
BCLog.initLog();
BuildcraftRecipes.assemblyTable = AssemblyRecipeManager.INSTANCE;
BuildcraftRecipes.integrationTable = IntegrationRecipeManager.INSTANCE;
BuildcraftRecipes.refinery = RefineryRecipeManager.INSTANCE;
mainConfiguration = new BuildCraftConfiguration(new File(evt.getModConfigurationDirectory(), "buildcraft/main.conf"));

View file

@ -15,6 +15,7 @@ package buildcraft.api.recipes;
public final class BuildcraftRecipes {
public static IAssemblyRecipeManager assemblyTable;
public static IIntegrationRecipeManager integrationTable;
public static IRefineryRecipeManager refinery;
private BuildcraftRecipes() {

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) SpaceToad, 2011-2012
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.recipes;
import java.util.List;
import net.minecraft.item.ItemStack;
/**
* The Integration Table's primary purpose is to modify an input item's NBT
* data. As such its not a "traditional" type of recipe. Rather than predefined
* inputs and outputs, it takes an input and transforms it.
*
* @author CovertJaguar <http://www.railcraft.info/>
*/
public interface IIntegrationRecipeManager {
public static interface IIntegrationRecipe {
double getEnergyCost();
boolean isValidInput(ItemStack stack);
ItemStack getOutputForInput(ItemStack stack);
ItemStack[] getExampleInputs();
}
/**
* Add an Integration Table recipe.
*
*/
void addRecipe(IIntegrationRecipe recipe);
List<? extends IIntegrationRecipe> getRecipes();
}

View file

@ -0,0 +1,22 @@
package buildcraft.core.recipes;
import buildcraft.api.recipes.IIntegrationRecipeManager;
import buildcraft.api.recipes.IIntegrationRecipeManager.IIntegrationRecipe;
import java.util.LinkedList;
import java.util.List;
public class IntegrationRecipeManager implements IIntegrationRecipeManager {
public static final IntegrationRecipeManager INSTANCE = new IntegrationRecipeManager();
private List<IIntegrationRecipe> integrationRecipes = new LinkedList<IIntegrationRecipe>();
@Override
public void addRecipe(IIntegrationRecipe recipe) {
integrationRecipes.add(recipe);
}
@Override
public List<IIntegrationRecipe> getRecipes() {
return integrationRecipes;
}
}

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) SpaceToad, 2011-2012
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.silicon;
/**
*
* @author CovertJaguar <http://www.railcraft.info/>
*/
public class TileIntegrationTable extends TileLaserTableBase {
@Override
public double getRequiredEnergy() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public boolean canCraft() {
throw new UnsupportedOperationException("Not supported yet.");
}
}