diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:50:56 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:50:56 +0300 |
| commit | 877312184c472d9845e5ef1008bc538f4634059f (patch) | |
| tree | 4e098cc94296cc11f3b87e8ef64c3c568b6aeb51 /main/java/ihl/recipes/RecipeOutputItemStack.java | |
| parent | 939d2ea16679ce64d98b98c716b85f851aa576e2 (diff) | |
fix missing source folder
Diffstat (limited to 'main/java/ihl/recipes/RecipeOutputItemStack.java')
| -rw-r--r-- | main/java/ihl/recipes/RecipeOutputItemStack.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/main/java/ihl/recipes/RecipeOutputItemStack.java b/main/java/ihl/recipes/RecipeOutputItemStack.java new file mode 100644 index 0000000..480d1f8 --- /dev/null +++ b/main/java/ihl/recipes/RecipeOutputItemStack.java @@ -0,0 +1,52 @@ +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 true;
+ }
+}
|
