From dc3df3edd5843bde0c1335d6a8e460b2c832aa48 Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Sat, 17 Jun 2017 08:12:18 +0300 Subject: full project files --- ihl/recipes/RecipeInputDie.java | 97 ----------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 ihl/recipes/RecipeInputDie.java (limited to 'ihl/recipes/RecipeInputDie.java') diff --git a/ihl/recipes/RecipeInputDie.java b/ihl/recipes/RecipeInputDie.java deleted file mode 100644 index 8fbd4db..0000000 --- a/ihl/recipes/RecipeInputDie.java +++ /dev/null @@ -1,97 +0,0 @@ -package ihl.recipes; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import ic2.api.recipe.IRecipeInput; -import ihl.interfaces.IWire; -import ihl.utils.IHLUtils; -import net.minecraft.item.ItemStack; - -public class RecipeInputDie implements IRecipeInput -{ - public final ItemStack input; - public final int transverseSection; - - public RecipeInputDie(String string, int transverseSection) - { - this(IHLUtils.getItemStackWithTag(string, "transverseSection", transverseSection)); - } - - public RecipeInputDie(ItemStack itemStack) - { - input=itemStack; - transverseSection=itemStack.stackTagCompound.getInteger("transverseSection"); - } - - @Override - public boolean matches(ItemStack subject) - { - return subject.getItem() == this.input.getItem() && (subject.getItemDamage() == this.input.getItemDamage() || this.input.getItemDamage() == 32767); - } - - @Override - public int getAmount() - { - return 1; - } - - @Override - public List getInputs() - { - return Arrays.asList(new ItemStack[] {this.input}); - } - - @Override - public String toString() - { - ItemStack stack = this.input.copy(); - return "RInputDice<" + stack + ">"; - } - - public List transformOutput(ItemStack matchedItemStack, List outputs) - { - List newOutputs = new ArrayList(); - int misTS = matchedItemStack.stackTagCompound.getInteger("transverseSection"); - ItemStack material; - for(ItemStack material1:outputs) - { - if(material1.getItem() instanceof IWire) - { - material=material1.copy(); - int length = material.stackTagCompound.getInteger("length"); - length = length * transverseSection / misTS; - material.stackTagCompound.setInteger("length", length); - material.stackTagCompound.setInteger("fullLength", length); - material.stackTagCompound.setInteger("transverseSection", misTS); - newOutputs.add(material); - } - else - { - newOutputs.add(material1); - } - } - return newOutputs; - } - - public int transformOutput(ItemStack matchedItemStack, ItemStack material) - { - int consumeAmountMultiplier=1; - int misTS = matchedItemStack.stackTagCompound.getInteger("transverseSection"); - if(misTS<=transverseSection) - { - int length = material.stackTagCompound.getInteger("length"); - length = length * transverseSection / misTS; - material.stackTagCompound.setInteger("length", length); - material.stackTagCompound.setInteger("fullLength", length); - } - else - { - consumeAmountMultiplier=misTS/transverseSection+1; - } - material.stackTagCompound.setInteger("transverseSection", misTS); - return consumeAmountMultiplier; - } -} - -- cgit v1.2.3