Skip to content

Commit

Permalink
Add Integration Table Recipe API
Browse files Browse the repository at this point in the history
  • Loading branch information
CovertJaguar committed Dec 28, 2013
1 parent 4356c10 commit edf8f17
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/buildcraft/BuildCraftCore.java
Expand Up @@ -66,6 +66,7 @@
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;
Expand Down Expand Up @@ -156,6 +157,7 @@ public void loadConfiguration(FMLPreInitializationEvent evt) {
BCLog.initLog();

BuildcraftRecipes.assemblyTable = AssemblyRecipeManager.INSTANCE;
BuildcraftRecipes.integrationTable = IntegrationRecipeManager.INSTANCE;
BuildcraftRecipes.refinery = RefineryRecipeManager.INSTANCE;

mainConfiguration = new BuildCraftConfiguration(new File(evt.getModConfigurationDirectory(), "buildcraft/main.conf"));
Expand Down
1 change: 1 addition & 0 deletions common/buildcraft/api/recipes/BuildcraftRecipes.java
Expand Up @@ -15,6 +15,7 @@
public final class BuildcraftRecipes {

public static IAssemblyRecipeManager assemblyTable;
public static IIntegrationRecipeManager integrationTable;
public static IRefineryRecipeManager refinery;

private BuildcraftRecipes() {
Expand Down
41 changes: 41 additions & 0 deletions common/buildcraft/api/recipes/IIntegrationRecipeManager.java
@@ -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();
}
22 changes: 22 additions & 0 deletions common/buildcraft/core/recipes/IntegrationRecipeManager.java
@@ -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;
}
}
26 changes: 26 additions & 0 deletions common/buildcraft/silicon/TileIntegrationTable.java
@@ -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.");
}
}

0 comments on commit edf8f17

Please sign in to comment.