summaryrefslogtreecommitdiff
path: root/ihl/recipes/RecipeOutputItemStack.java
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2016-04-11 19:44:54 +0300
committerFoghrye4 <foghrye4@gmail.com>2016-04-11 19:44:54 +0300
commit05c78126859231a68e199dc34613689bd0978e2f (patch)
tree050bea104a18c72905095d29f31bec2935a27a24 /ihl/recipes/RecipeOutputItemStack.java
Initial commit
Diffstat (limited to 'ihl/recipes/RecipeOutputItemStack.java')
-rw-r--r--ihl/recipes/RecipeOutputItemStack.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/ihl/recipes/RecipeOutputItemStack.java b/ihl/recipes/RecipeOutputItemStack.java
new file mode 100644
index 0000000..c765b1d
--- /dev/null
+++ b/ihl/recipes/RecipeOutputItemStack.java
@@ -0,0 +1,65 @@
+package ihl.recipes;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class RecipeOutputItemStack
+{
+ public final ItemStack itemStack;
+ public final float quantity;
+ public RecipeOutputItemStack(ItemStack itemStack1, float quantity1)
+ {
+ itemStack=itemStack1;
+ quantity=quantity1;
+ itemStack.stackSize=1;
+ }
+
+ public RecipeOutputItemStack(ItemStack itemStack1)
+ {
+ this(itemStack1, itemStack1.stackSize);
+ }
+
+ public boolean matches(RecipeOutputItemStack is1)
+ {
+ if(is1==null||(itemStack.getItem()!=is1.itemStack.getItem()))
+ {
+ return false;
+ }
+ else if(is1.itemStack.getItemDamage()!=OreDictionary.WILDCARD_VALUE &&
+ itemStack.getItemDamage()!=is1.itemStack.getItemDamage())
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public RecipeOutputItemStack copy(int mulipier)
+ {
+ return new RecipeOutputItemStack(itemStack, quantity*mulipier);
+ }
+
+ public RecipeOutputItemStack copy()
+ {
+ return new RecipeOutputItemStack(itemStack, quantity);
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.itemStack.getUnlocalizedName()+":"+this.quantity;
+ }
+
+ public boolean matches(ItemStack is1)
+ {
+ if(is1==null||(itemStack.getItem()!=is1.getItem()))
+ {
+ return false;
+ }
+ else if(is1.getItemDamage()!=OreDictionary.WILDCARD_VALUE &&
+ itemStack.getItemDamage()!=is1.getItemDamage())
+ {
+ return false;
+ }
+ return false;
+ }
+}