- Refactored code into different packages

- Fixed some non-static expansion methods
- Fixed scripts not reloading properly
- Implemented mod support build system
- Fixed recipe removal breaking on recipes without predefined output
- Fixed NPE on parsing a bracket expression that doesn't exist - now prints an appropriate error
This commit is contained in:
Stan Hebben committed 2014-06-21 18:51:11 +02:00
1 parent 1789aa74b5
commit 2de467d7d8
93 files changed
+321 -262

No files matched your search

@@ -0,0 +1,89 @@
package minetweaker.api.recipes;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.Optional;
import stanhebben.zenscript.annotations.ZenMethod;
/**
* The RecipeManager adds and removes crafting recipes. The IRecipeManager
* instance is available throug the recipes global variable.
*
* @author Stan Hebben
*/
@ZenClass("minetweaker.recipes.IRecipeManager")
public interface IRecipeManager {
/**
* Removes all crafting recipes crafting the specified item.
*
* @param output recipe output pattern
* @return number of removed recipes
*/
@ZenMethod
public int remove(IIngredient output);
/**
* Adds a shaped recipe.
*
* @param output recipe output
* @param ingredients recipe ingredients
* @param function recipe function (optional)
* @param mirrored indicates if the mirrored recipe should be valid too (optional)
*/
@ZenMethod
public void addShaped(
IItemStack output,
IIngredient[][] ingredients,
@Optional IRecipeFunction function,
@Optional boolean mirrored);
/**
* Adds a shapeless recipe.
*
* @param output recipe output
* @param ingredients recipe ingredients
* @param function recipe function (optional)
*/
@ZenMethod
public void addShapeless(
IItemStack output,
IIngredient[] ingredients,
@Optional IRecipeFunction function);
/**
* Removes shaped recipes.
*
* @param output recipe output
* @param ingredients recipe ingredients
* @return number of removed recipes
*/
@ZenMethod
public int removeShaped(
IIngredient output,
@Optional IIngredient[][] ingredients);
/**
* Removes shapeless recipes.
*
* @param output recipe output
* @param ingredients recipe ingredients
* @param wildcard if the recipe may contain other ingredients too, besides the ones specified
* @return number of removed recipes
*/
@ZenMethod
public int removeShapeless(
IIngredient output,
@Optional IIngredient[] ingredients,
@Optional boolean wildcard);
/**
* Performs a crafting with the specified ingredients. Returns null if no
* crafting recipe exists.
*
* @param contents crafting inventory contents
* @return crafting result, or null
*/
@ZenMethod
public IItemStack craft(IItemStack[][] contents);
}