mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-19 11:49:05 +00:00
potential fix for #23
This commit is contained in:
1 parent
54c9d48b2a
commit
8baddf0ea5
8 files changed
+693
-617
No files matched your search
@@ -1,22 +1,19 @@
|
||||
package minetweaker.api.item;
|
||||
|
||||
import java.util.List;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import stanhebben.zenscript.annotations.OperatorType;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import stanhebben.zenscript.annotations.ZenOperator;
|
||||
import stanhebben.zenscript.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a recipe ingredient. An ingredient can be an item, an ore
|
||||
* dictionary entry, an item stack, an ore dictionary entry multiplied with an
|
||||
* amount, or other kinds of ingredients as offered by the API.
|
||||
*
|
||||
*
|
||||
* There is no guarantee that every mod will respect the conditions or
|
||||
* transformations, or that every mod will support every kind of ingredient.
|
||||
*
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("minetweaker.item.IIngredient")
|
||||
@@ -24,7 +21,7 @@ public interface IIngredient {
|
||||
/**
|
||||
* Gets the mark of the ingredient. Ingredients can be marked so they can be
|
||||
* used in crafting functions.
|
||||
*
|
||||
*
|
||||
* @return ingredient mark
|
||||
*/
|
||||
@ZenGetter("mark")
|
||||
@@ -32,10 +29,10 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Gets the amount.
|
||||
*
|
||||
*
|
||||
* Should return -1 if no amount is available and 1 for a single item.
|
||||
* Stacks return the stack size.
|
||||
*
|
||||
*
|
||||
* @return stack size
|
||||
*/
|
||||
@ZenGetter("amount")
|
||||
@@ -43,10 +40,10 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Gets all possible items for this ingredient.
|
||||
*
|
||||
*
|
||||
* If there is no item list (for example, it is the <*> wildcard item)
|
||||
* null should be returned.
|
||||
*
|
||||
*
|
||||
* @return the items for this ingredient, or null
|
||||
*/
|
||||
@ZenGetter("items")
|
||||
@@ -54,10 +51,10 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Gets all possible liquids for this ingredient.
|
||||
*
|
||||
*
|
||||
* If there is no liquid list (for example, it is the <*&ft; wildcard
|
||||
* item) null should be returned.
|
||||
*
|
||||
*
|
||||
* @return the liquids for this ingredient, or null
|
||||
*/
|
||||
@ZenGetter("liquids")
|
||||
@@ -65,7 +62,7 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Returns a new ingredient with the given stack size.
|
||||
*
|
||||
*
|
||||
* @param amount new stack size
|
||||
* @return modified ingredient
|
||||
*/
|
||||
@@ -76,7 +73,7 @@ public interface IIngredient {
|
||||
/**
|
||||
* Combines multiple ingredients into a single one. Note that ore dictionary
|
||||
* entries are preferred to or statements.
|
||||
*
|
||||
*
|
||||
* @param ingredient ingredient to combine with
|
||||
* @return or-ed ingredient
|
||||
*/
|
||||
@@ -86,7 +83,7 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Returns a new ingredient with the given transform added to it.
|
||||
*
|
||||
*
|
||||
* @param transformer transformer to add
|
||||
* @return modified ingredient
|
||||
*/
|
||||
@@ -95,7 +92,7 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Returns a new ingredient with the given condition added to it.
|
||||
*
|
||||
*
|
||||
* @param condition condition to add
|
||||
* @return modified ingredient
|
||||
*/
|
||||
@@ -104,7 +101,7 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Returns a new ingredient marked with the given name.
|
||||
*
|
||||
*
|
||||
* @param mark mark to apply
|
||||
* @return modified ingredient
|
||||
*/
|
||||
@@ -114,16 +111,27 @@ public interface IIngredient {
|
||||
/**
|
||||
* Checks if this ingredient matches the given item. For liquids, will match
|
||||
* the item if it is a valid container.
|
||||
*
|
||||
*
|
||||
* @param item item to check
|
||||
* @return true if the item matches
|
||||
*/
|
||||
@ZenMethod
|
||||
public boolean matches(IItemStack item);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Checks if this ingredient matches the given item. For liquids, will match
|
||||
* the item if it is a valid container.
|
||||
*
|
||||
* @param item item to check
|
||||
* @return true if the item matches
|
||||
*/
|
||||
@ZenMethod
|
||||
public boolean matchesExact(IItemStack item);
|
||||
|
||||
|
||||
/**
|
||||
* Checks if this ingredient matches the given liquid.
|
||||
*
|
||||
*
|
||||
* @param liquid
|
||||
* @return
|
||||
*/
|
||||
@@ -133,7 +141,7 @@ public interface IIngredient {
|
||||
/**
|
||||
* Check if this ingredient contains all possible values for the given
|
||||
* ingredient.
|
||||
*
|
||||
*
|
||||
* @param ingredient ingredient to check
|
||||
* @return true if the ingredient contains the given one
|
||||
*/
|
||||
@@ -142,7 +150,7 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Applies transformations after crafting, if any, to the given item.
|
||||
*
|
||||
*
|
||||
* @param item item to transform
|
||||
* @param byPlayer player performing the crafting operation
|
||||
* @return transformed item
|
||||
@@ -152,7 +160,7 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Checks if this ingredient has (or could have) any transformatiosns.
|
||||
*
|
||||
*
|
||||
* @return true if there are (or could be) any transformations false
|
||||
* otherwise.
|
||||
*/
|
||||
@@ -161,11 +169,11 @@ public interface IIngredient {
|
||||
|
||||
/**
|
||||
* Gets the internal item backing this ingredient.
|
||||
*
|
||||
*
|
||||
* The value is implementation-dependent and should only be handled by the
|
||||
* internal code. Don't use this value - instead, use the version-specific
|
||||
* helper methods.
|
||||
*
|
||||
*
|
||||
* @return internal item
|
||||
*/
|
||||
public Object getInternal();
|
||||
|
||||
@@ -42,7 +42,7 @@ public interface IRecipeManager {
|
||||
* @return number of removed recipes
|
||||
*/
|
||||
@ZenMethod
|
||||
public int remove(IIngredient output);
|
||||
public int remove(IIngredient output, @Optional boolean nbtMatch);
|
||||
|
||||
/**
|
||||
* Adds a shaped recipe.
|
||||
|
||||
Reference in new issue
Block a user