From eba927e4af1907911ccff35b0dbf840f59d4bbdb Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 1 Jun 2015 11:19:17 +0200 Subject: [PATCH] sanitize BC API versions, add IIntegrationRecipe documentation --- .../api/blueprints/package-info.java | 2 +- api/buildcraft/api/boards/package-info.java | 2 +- .../api/recipes/IIntegrationRecipe.java | 44 +++++++++++++++++++ api/buildcraft/api/recipes/package-info.java | 2 +- api/buildcraft/api/robots/package-info.java | 2 +- .../api/transport/IStripesHandler.java | 2 +- .../api/transport/package-info.java | 2 +- 7 files changed, 50 insertions(+), 6 deletions(-) diff --git a/api/buildcraft/api/blueprints/package-info.java b/api/buildcraft/api/blueprints/package-info.java index a9b38269..c9d924b7 100644 --- a/api/buildcraft/api/blueprints/package-info.java +++ b/api/buildcraft/api/blueprints/package-info.java @@ -6,7 +6,7 @@ * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.2", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|blueprints") +@API(apiVersion = "1.3", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|blueprints") package buildcraft.api.blueprints; import cpw.mods.fml.common.API; diff --git a/api/buildcraft/api/boards/package-info.java b/api/buildcraft/api/boards/package-info.java index 6b71e38e..439475c5 100644 --- a/api/buildcraft/api/boards/package-info.java +++ b/api/buildcraft/api/boards/package-info.java @@ -6,7 +6,7 @@ * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|boards") +@API(apiVersion = "2.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|boards") package buildcraft.api.boards; import cpw.mods.fml.common.API; diff --git a/api/buildcraft/api/recipes/IIntegrationRecipe.java b/api/buildcraft/api/recipes/IIntegrationRecipe.java index b29e42c0..db542dbe 100644 --- a/api/buildcraft/api/recipes/IIntegrationRecipe.java +++ b/api/buildcraft/api/recipes/IIntegrationRecipe.java @@ -13,15 +13,59 @@ import java.util.List; import net.minecraft.item.ItemStack; public interface IIntegrationRecipe { + /** + * Get the energy cost (in RF) of the recipe. + * @return The energy cost of the recipe. + */ int getEnergyCost(); + + /** + * Get a list of example inputs. This is used for recipe preview. + * @return A list of example inputs. + */ List getExampleInput(); + + /** + * Get a list of example expansions. This is used for recipe preview. + * If the amount of lists of expansions is smaller than the maximum + * expansion count, the lists will be repeated. + * @return A list of every slot's list of example expansions. + */ List> getExampleExpansions(); + + /** + * Get a list of example outputs. This is used for recipe preview. + * @return A list of example outputs. + */ List getExampleOutput(); + + /** + * Check if an input is valid. + * @param input The input. + * @return Whether the input is valid. + */ boolean isValidInput(ItemStack input); + + /** + * Check if an expansion is valid. + * @param input The input currently in. + * @param expansion The expansion. + * @return Whether the expansion can be fitted to a given input. + */ boolean isValidExpansion(ItemStack input, ItemStack expansion); + + /** + * Craft the recipe. Keep in mind that you need to decrease the amount of + * expansions yourself - the amount of inputs is decreased for you. + * @param input The input. + * @param expansions All inserted expansions. + * @param preview If true, do not decrease the amount of expansions. + * @return The output stack. + */ ItemStack craft(ItemStack input, List expansions, boolean preview); /** + * Returns the maximum count of expansions this recipe can have. * @return -1 for no limit, a different number otherwise */ int getMaximumExpansionCount(ItemStack input); diff --git a/api/buildcraft/api/recipes/package-info.java b/api/buildcraft/api/recipes/package-info.java index 7591ac6f..943004f7 100644 --- a/api/buildcraft/api/recipes/package-info.java +++ b/api/buildcraft/api/recipes/package-info.java @@ -6,7 +6,7 @@ * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "2.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|recipes") +@API(apiVersion = "3.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|recipes") package buildcraft.api.recipes; import cpw.mods.fml.common.API; diff --git a/api/buildcraft/api/robots/package-info.java b/api/buildcraft/api/robots/package-info.java index 3713a724..1a8a429e 100644 --- a/api/buildcraft/api/robots/package-info.java +++ b/api/buildcraft/api/robots/package-info.java @@ -6,7 +6,7 @@ * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "1.2", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|robotics") +@API(apiVersion = "2.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|robotics") package buildcraft.api.robots; import cpw.mods.fml.common.API; diff --git a/api/buildcraft/api/transport/IStripesHandler.java b/api/buildcraft/api/transport/IStripesHandler.java index f9042f4f..a9cc011f 100644 --- a/api/buildcraft/api/transport/IStripesHandler.java +++ b/api/buildcraft/api/transport/IStripesHandler.java @@ -14,7 +14,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; public interface IStripesHandler { - public static enum StripesHandlerType { + enum StripesHandlerType { ITEM_USE, BLOCK_BREAK } diff --git a/api/buildcraft/api/transport/package-info.java b/api/buildcraft/api/transport/package-info.java index dda1f6d0..b670143c 100644 --- a/api/buildcraft/api/transport/package-info.java +++ b/api/buildcraft/api/transport/package-info.java @@ -6,7 +6,7 @@ * Please check the contents of the license, which should be located * as "LICENSE.API" in the BuildCraft source code distribution. */ -@API(apiVersion = "4.0", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|transport") +@API(apiVersion = "4.1", owner = "BuildCraftAPI|core", provides = "BuildCraftAPI|transport") package buildcraft.api.transport; import cpw.mods.fml.common.API;