diff options
Diffstat (limited to 'ihl/recipes')
| -rw-r--r-- | ihl/recipes/RecipeInputOreDictionaryList.java | 241 | ||||
| -rw-r--r-- | ihl/recipes/RecipeInputWire.java | 113 | ||||
| -rw-r--r-- | ihl/recipes/UniversalRecipeInput.java | 2 | ||||
| -rw-r--r-- | ihl/recipes/UniversalRecipeManager.java | 337 |
4 files changed, 301 insertions, 392 deletions
diff --git a/ihl/recipes/RecipeInputOreDictionaryList.java b/ihl/recipes/RecipeInputOreDictionaryList.java index 572f15b..e438d98 100644 --- a/ihl/recipes/RecipeInputOreDictionaryList.java +++ b/ihl/recipes/RecipeInputOreDictionaryList.java @@ -10,140 +10,113 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
-public class RecipeInputOreDictionaryList implements IRecipeInput
-{
-
- public final String[] input;
- public final int amount;
- public final Integer meta;
- private List<ItemStack> ores;
-
- public RecipeInputOreDictionaryList(String[] input1)
- {
- this(input1, 1);
- }
-
- public RecipeInputOreDictionaryList(String[] input1, int amount1)
- {
- this(input1, amount1, (Integer)null);
- }
-
- public RecipeInputOreDictionaryList(String[] input1, int amount1, Integer meta)
- {
- this.input = input1;
- this.amount = amount1;
- this.meta = meta;
- }
+public class RecipeInputOreDictionaryList implements IRecipeInput {
+
+ public final String[] input;
+ public final int amount;
+ public final Integer meta;
+ private List<ItemStack> ores;
+
+ public RecipeInputOreDictionaryList(String[] input1) {
+ this(input1, 1);
+ }
+
+ public RecipeInputOreDictionaryList(String[] input1, int amount1) {
+ this(input1, amount1, (Integer) null);
+ }
+
+ public RecipeInputOreDictionaryList(String[] input1, int amount1, Integer meta) {
+ this.input = input1;
+ this.amount = amount1;
+ this.meta = meta;
+ }
+
+ @Override
+ public boolean matches(ItemStack subject) {
+ List<ItemStack> inputs = this.getOres();
+ boolean useOreStackMeta = this.meta == null;
+ Item subjectItem = subject.getItem();
+ int subjectMeta = subject.getItemDamage();
+ Iterator<ItemStack> i$ = inputs.iterator();
+ Item oreItem;
+ int metaRequired;
+
+ do {
+ do {
+ ItemStack oreStack;
+
+ do {
+ if (!i$.hasNext()) {
+ return false;
+ }
+
+ oreStack = i$.next();
+ oreItem = oreStack.getItem();
+ } while (oreItem == null);
+
+ metaRequired = useOreStackMeta ? oreStack.getItemDamage() : this.meta.intValue();
+ } while (subjectItem != oreItem);
+ } while (subjectMeta != metaRequired && metaRequired != 32767);
+
+ return true;
+ }
+
+ @Override
+ public int getAmount() {
+ return this.amount;
+ }
+
+ @Override
+ public List<ItemStack> getInputs() {
+ List<ItemStack> ores = this.getOres();
+ boolean hasInvalidEntries = false;
+ Iterator<ItemStack> ret = ores.iterator();
+
+ while (ret.hasNext()) {
+ ItemStack i$ = ret.next();
+
+ if (i$.getItem() == null) {
+ hasInvalidEntries = true;
+ break;
+ }
+ }
+
+ if (!hasInvalidEntries) {
+ return ores;
+ } else {
+ ArrayList<ItemStack> ret1 = new ArrayList<ItemStack>(ores.size());
+ Iterator<ItemStack> i$1 = ores.iterator();
+
+ while (i$1.hasNext()) {
+ ItemStack stack = i$1.next();
+
+ if (stack.getItem() != null) {
+ ret1.add(stack);
+ }
+ }
+
+ return Collections.unmodifiableList(ret1);
+ }
+ }
@Override
- public boolean matches(ItemStack subject)
- {
- List<ItemStack> inputs = this.getOres();
- boolean useOreStackMeta = this.meta == null;
- Item subjectItem = subject.getItem();
- int subjectMeta = subject.getItemDamage();
- Iterator<ItemStack> i$ = inputs.iterator();
- Item oreItem;
- int metaRequired;
-
- do
- {
- do
- {
- ItemStack oreStack;
-
- do
- {
- if (!i$.hasNext())
- {
- return false;
- }
-
- oreStack = i$.next();
- oreItem = oreStack.getItem();
- }
- while (oreItem == null);
-
- metaRequired = useOreStackMeta ? oreStack.getItemDamage() : this.meta.intValue();
- }
- while (subjectItem != oreItem);
- }
- while (subjectMeta != metaRequired && metaRequired != 32767);
-
- return true;
- }
-
- @Override
- public int getAmount()
- {
- return this.amount;
- }
-
- @Override
- public List<ItemStack> getInputs()
- {
- List<ItemStack> ores = this.getOres();
- boolean hasInvalidEntries = false;
- Iterator<ItemStack> ret = ores.iterator();
-
- while (ret.hasNext())
- {
- ItemStack i$ = ret.next();
-
- if (i$.getItem() == null)
- {
- hasInvalidEntries = true;
- break;
- }
- }
-
- if (!hasInvalidEntries)
- {
- return ores;
- }
- else
- {
- ArrayList<ItemStack> ret1 = new ArrayList<ItemStack>(ores.size());
- Iterator<ItemStack> i$1 = ores.iterator();
-
- while (i$1.hasNext())
- {
- ItemStack stack = i$1.next();
-
- if (stack.getItem() != null)
- {
- ret1.add(stack);
- }
- }
-
- return Collections.unmodifiableList(ret1);
- }
- }
-
- @Override
- public String toString()
- {
- return this.meta == null ? "RInputOreDict<" + this.amount + "x" + this.input + ">" : "RInputOreDict<" + this.amount + "x" + this.input + "@" + this.meta + ">";
- }
-
- private List<ItemStack> getOres()
- {
- if (this.ores != null)
- {
- return this.ores;
- }
- else
- {
- this.ores = new ArrayList<ItemStack>();
- for(int i=0;i<this.input.length;i++)
- {
- ArrayList<ItemStack> ret = OreDictionary.getOres(this.input[i]);
- if (ret != OreDictionary.EMPTY_LIST)
- {
- this.ores.addAll(ret);
- }
- }
- return this.ores;
- }
- }
+ public String toString() {
+ return this.meta == null ? "RInputOreDict<" + this.amount + "x" + this.input + ">"
+ : "RInputOreDict<" + this.amount + "x" + this.input + "@" + this.meta + ">";
+ }
+
+ private List<ItemStack> getOres() {
+ if (this.ores != null) {
+ return this.ores;
+ } else {
+ this.ores = new ArrayList<ItemStack>();
+ for (int i = 0; i < this.input.length; i++) {
+ ArrayList<ItemStack> ret = OreDictionary.getOres(this.input[i]);
+ if (ret != OreDictionary.EMPTY_LIST) {
+ this.ores.addAll(ret);
+ }
+ }
+ return this.ores;
+ }
+ }
}
diff --git a/ihl/recipes/RecipeInputWire.java b/ihl/recipes/RecipeInputWire.java index 0bf2855..a7d5310 100644 --- a/ihl/recipes/RecipeInputWire.java +++ b/ihl/recipes/RecipeInputWire.java @@ -9,79 +9,64 @@ import ihl.items_blocks.FlexibleCableItem; import ihl.utils.IHLUtils;
import net.minecraft.item.ItemStack;
-public class RecipeInputWire implements IRecipeInput
-{
- public final ItemStack input;
- public final int amount;
+public class RecipeInputWire implements IRecipeInput {
+ public final ItemStack input;
+ public final int amount;
- public RecipeInputWire(final ItemStack aInput)
- {
- this(aInput, IHLUtils.getWireLength(aInput));
- }
+ public RecipeInputWire(final ItemStack aInput) {
+ this(aInput, IHLUtils.getWireLength(aInput));
+ }
- public RecipeInputWire(final ItemStack aInput, int aAmount)
- {
- if (aInput.getItem() == null || !(aInput.getItem() instanceof IWire))
- {
- throw new IllegalArgumentException("Invalid item stack specfied");
- }
- else
- {
- this.input = aInput;
- this.amount = aAmount;
- }
- }
+ public RecipeInputWire(final ItemStack aInput, int aAmount) {
+ if (aInput.getItem() == null || !(aInput.getItem() instanceof IWire)) {
+ throw new IllegalArgumentException("Invalid item stack specfied");
+ } else {
+ this.input = aInput;
+ this.amount = aAmount;
+ }
+ }
- public RecipeInputWire(String string, int i)
- {
- this(IHLUtils.getThisModWireItemStackWithLength(string, i),i);
+ public RecipeInputWire(String string, int i) {
+ this(IHLUtils.getThisModWireItemStackWithLength(string, i), i);
}
-
- public RecipeInputWire(String material, int length, int transverseSection)
- {
- this(IHLUtils.getUninsulatedWire(material, length, transverseSection),length);
+
+ public RecipeInputWire(String material, int length, int transverseSection) {
+ this(IHLUtils.getUninsulatedWire(material, length, transverseSection), length);
}
-
- public RecipeInputWire(String material, int length, int transverseSection, String insulationMaterial, int insulationThickness, int insulationBreakdownVoltage)
- {
- this(IHLUtils.getInsulatedWire(material, length, transverseSection, insulationMaterial, insulationThickness),length);
+
+ public RecipeInputWire(String material, int length, int transverseSection, String insulationMaterial,
+ int insulationThickness, int insulationBreakdownVoltage) {
+ this(IHLUtils.getInsulatedWire(material, length, transverseSection, insulationMaterial, insulationThickness),
+ length);
}
@Override
- public boolean matches(ItemStack subject)
- {
- if(subject.getItem() == this.input.getItem() && (subject.getItemDamage() == this.input.getItemDamage() || this.input.getItemDamage() == 32767))
- {
- if(subject.getItem() instanceof FlexibleCableItem)
- {
- FlexibleCableItem item = (FlexibleCableItem) subject.getItem();
- return item.isSameWire(this.input, subject);
- }
- else
- {
- return true;
- }
- }
- return false;
- }
+ public boolean matches(ItemStack subject) {
+ if (subject.getItem() == this.input.getItem()
+ && (subject.getItemDamage() == this.input.getItemDamage() || this.input.getItemDamage() == 32767)) {
+ if (subject.getItem() instanceof FlexibleCableItem) {
+ FlexibleCableItem item = (FlexibleCableItem) subject.getItem();
+ return item.isSameWire(this.input, subject);
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
- @Override
- public int getAmount()
- {
- return this.amount;
- }
+ @Override
+ public int getAmount() {
+ return this.amount;
+ }
- @Override
- public List<ItemStack> getInputs()
- {
- return Arrays.asList(new ItemStack[] {this.input});
- }
+ @Override
+ public List<ItemStack> getInputs() {
+ return Arrays.asList(new ItemStack[] { this.input });
+ }
- @Override
- public String toString()
- {
- ItemStack stack = this.input.copy();
- return "RInputWireItemStack<" + stack + ">";
- }
+ @Override
+ public String toString() {
+ ItemStack stack = this.input.copy();
+ return "RInputWireItemStack<" + stack + ">";
+ }
}
-
diff --git a/ihl/recipes/UniversalRecipeInput.java b/ihl/recipes/UniversalRecipeInput.java index 62d6c87..a654c2e 100644 --- a/ihl/recipes/UniversalRecipeInput.java +++ b/ihl/recipes/UniversalRecipeInput.java @@ -132,7 +132,7 @@ public class UniversalRecipeInput { multiplier = multiplier1;
}
}
- if (IHLUtils.reduceItemStackAmountUsingIRecipeInput(is, is1)) {
+ if (IHLUtils.reduceItemStackAmountUsingIRecipeInput(is, is1, multiplier)) {
is1 = null;
}
}
diff --git a/ihl/recipes/UniversalRecipeManager.java b/ihl/recipes/UniversalRecipeManager.java index 99f43bc..169d6f6 100644 --- a/ihl/recipes/UniversalRecipeManager.java +++ b/ihl/recipes/UniversalRecipeManager.java @@ -12,237 +12,188 @@ import net.minecraftforge.fluids.FluidStack; import ihl.utils.IHLUtils;
public class UniversalRecipeManager {
-
- public static Map<String,UniversalRecipeManager> machineRecipeManagers = new HashMap<String,UniversalRecipeManager>();
+
+ public static Map<String, UniversalRecipeManager> machineRecipeManagers = new HashMap<String, UniversalRecipeManager>();
public final String machine;
- public UniversalRecipeManager(String machine1)
- {
- machine=machine1;
- if(machineRecipeManagers.containsKey(machine1))
- {
- throw new IllegalArgumentException("Recipe manager for "+machine1+" already exist!");
+
+ public UniversalRecipeManager(String machine1) {
+ machine = machine1;
+ if (machineRecipeManagers.containsKey(machine1)) {
+ throw new IllegalArgumentException("Recipe manager for " + machine1 + " already exist!");
}
machineRecipeManagers.put(machine1, this);
}
private final Map<UniversalRecipeInput, UniversalRecipeOutput> recipes = new HashMap<UniversalRecipeInput, UniversalRecipeOutput>();
private final Map<String, UniversalRecipeInput> keywordMap = new HashMap<String, UniversalRecipeInput>();
-
- public void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output)
- {
- if (input == null)
- {
- throw new NullPointerException("The recipe input is null");
- }
- else
- {
- if (output.getFluidOutputs() == null || output.getItemOutputs() == null ||(output.getFluidOutputs().size()==0 && output.getItemOutputs().size()==0))
- {
- throw new NullPointerException("The output is empty");
- }
- }
-
- Iterator<UniversalRecipeInput> var8 = this.recipes.keySet().iterator();
-
- while (var8.hasNext())
- {
- UniversalRecipeInput existingInput = (UniversalRecipeInput)var8.next();
- if (existingInput.matches(input))
- {
- StringBuffer ssError =new StringBuffer(255);
- ssError.append("Ambiguous recipe. \n");
- ssError.append("Existing input: \n");
- Iterator<IRecipeInput> iii1 = existingInput.getItemInputs().iterator();
- Iterator<IRecipeInputFluid> fii1 = existingInput.getFluidInputs().iterator();
- while(iii1!=null && iii1.hasNext())
- {
- ssError.append(iii1.next().toString());
- ssError.append(" \n");
- }
- while(fii1!=null && fii1.hasNext())
- {
- ssError.append(fii1.next().toString());
- ssError.append(" \n");
- }
- ssError.append("New input: \n");
- Iterator<IRecipeInput> iii2 = input.getItemInputs().iterator();
- Iterator<IRecipeInputFluid> fii2 = input.getFluidInputs().iterator();
- while(iii2!=null && iii2.hasNext())
- {
- ssError.append(iii2.next().toString());
- ssError.append(" \n");
- }
- while(fii2!=null && fii2.hasNext())
- {
- ssError.append(fii2.next().toString());
- ssError.append(" \n");
- }
- throw new RuntimeException(ssError.toString());
- }
- }
-
- this.recipes.put(input, output);
- }
-
- public void addRecipe(String keyword, UniversalRecipeInput input, UniversalRecipeOutput output)
- {
- this.addRecipe(input, output);
- this.keywordMap.put(keyword, input);
- }
-
- public UniversalRecipeOutput getOutputFor(List<FluidStack> fluidInputs, List<ItemStack> itemInputs, boolean adjustInput, boolean inputAffectOutput)
- {
- if (fluidInputs == null && itemInputs == null)
- {
- return null;
- }
- else
- {
- Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
-
- while (true)
- {
- if (i$.hasNext())
- {
- Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
- UniversalRecipeInput recipeInput = entry.getKey();
-
- if (!recipeInput.matches(fluidInputs, itemInputs))
- {
- continue;
- }
-
- if (recipeInput.adjustAmounts(fluidInputs, itemInputs,true, false))
- {
- UniversalRecipeOutput output = entry.getValue();
- if (adjustInput)
- {
- if(inputAffectOutput)
- {
- int multiplier = recipeInput.getMultiplierAndAdjustAmounts(fluidInputs, itemInputs);
- return output.copyWithMultiplier(multiplier);
- }
- else
- {
- recipeInput.adjustAmounts(fluidInputs, itemInputs,true, true);
- }
- }
- return output;
- }
- }
-
- return null;
- }
- }
- }
-
- public Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipes()
- {
- return this.recipes;
- }
+ public void addRecipe(UniversalRecipeInput input, UniversalRecipeOutput output) {
+ if (input == null) {
+ throw new NullPointerException("The recipe input is null");
+ } else {
+ if (output.getFluidOutputs() == null || output.getItemOutputs() == null
+ || (output.getFluidOutputs().size() == 0 && output.getItemOutputs().size() == 0)) {
+ throw new NullPointerException("The output is empty");
+ }
+ }
- public UniversalRecipeInput getRecipeInput(List<FluidStack> fluidInputs1, List<ItemStack> itemInputs1) {
- {
- Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
-
- while (true)
- {
- if (i$.hasNext())
- {
- Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
- UniversalRecipeInput recipeInput = entry.getKey();
-
- if (!recipeInput.matches(fluidInputs1,itemInputs1))
- {
- continue;
- }
-
- if (recipeInput.adjustAmounts(fluidInputs1,itemInputs1,true, false))
- {
- return recipeInput;
- }
- }
-
- return null;
- }
- }
+ Iterator<UniversalRecipeInput> var8 = this.recipes.keySet().iterator();
+
+ while (var8.hasNext()) {
+ UniversalRecipeInput existingInput = (UniversalRecipeInput) var8.next();
+ if (existingInput.matches(input)) {
+ StringBuffer ssError = new StringBuffer(255);
+ ssError.append("Ambiguous recipe. \n");
+ ssError.append("Existing input: \n");
+ Iterator<IRecipeInput> iii1 = existingInput.getItemInputs().iterator();
+ Iterator<IRecipeInputFluid> fii1 = existingInput.getFluidInputs().iterator();
+ while (iii1 != null && iii1.hasNext()) {
+ ssError.append(iii1.next().toString());
+ ssError.append(" \n");
+ }
+ while (fii1 != null && fii1.hasNext()) {
+ ssError.append(fii1.next().toString());
+ ssError.append(" \n");
+ }
+ ssError.append("New input: \n");
+ Iterator<IRecipeInput> iii2 = input.getItemInputs().iterator();
+ Iterator<IRecipeInputFluid> fii2 = input.getFluidInputs().iterator();
+ while (iii2 != null && iii2.hasNext()) {
+ ssError.append(iii2.next().toString());
+ ssError.append(" \n");
+ }
+ while (fii2 != null && fii2.hasNext()) {
+ ssError.append(fii2.next().toString());
+ ssError.append(" \n");
+ }
+ throw new RuntimeException(ssError.toString());
+ }
+ }
+
+ this.recipes.put(input, output);
+ }
+
+ public void addRecipe(String keyword, UniversalRecipeInput input, UniversalRecipeOutput output) {
+ this.addRecipe(input, output);
+ this.keywordMap.put(keyword, input);
+ }
+
+ public UniversalRecipeOutput getOutputFor(List<FluidStack> fluidInputs, List<ItemStack> itemInputs,
+ boolean adjustInput, boolean inputAffectOutput) {
+ if (fluidInputs == null && itemInputs == null) {
+ return null;
+ } else {
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
+
+ while (true) {
+ if (i$.hasNext()) {
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeInput recipeInput = entry.getKey();
+
+ if (!recipeInput.matches(fluidInputs, itemInputs)) {
+ continue;
+ }
+
+ if (recipeInput.adjustAmounts(fluidInputs, itemInputs, true, false)) {
+ UniversalRecipeOutput output = entry.getValue();
+ if (inputAffectOutput) {
+ int multiplier = recipeInput.getMultiplierAndAdjustAmounts(fluidInputs, itemInputs);
+ return output.copyWithMultiplier(multiplier);
+ } else if (adjustInput) {
+ recipeInput.adjustAmounts(fluidInputs, itemInputs, true, true);
+ }
+ return output;
+ }
+ }
+
+ return null;
+ }
+ }
+ }
+
+ public Map<UniversalRecipeInput, UniversalRecipeOutput> getRecipes() {
+ return this.recipes;
}
+ public UniversalRecipeInput getRecipeInput(List<FluidStack> fluidInputs1, List<ItemStack> itemInputs1) {
+ {
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
+
+ while (true) {
+ if (i$.hasNext()) {
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeInput recipeInput = entry.getKey();
+
+ if (!recipeInput.matches(fluidInputs1, itemInputs1)) {
+ continue;
+ }
+
+ if (recipeInput.adjustAmounts(fluidInputs1, itemInputs1, true, false)) {
+ return recipeInput;
+ }
+ }
+
+ return null;
+ }
+ }
+ }
@SuppressWarnings({ "unchecked", "rawtypes" })
- public UniversalRecipeOutput getOutputFor(List[] input, boolean adjustInput, boolean inputAffectOutput)
- {
+ public UniversalRecipeOutput getOutputFor(List[] input, boolean adjustInput, boolean inputAffectOutput) {
return this.getOutputFor(input[0], input[1], adjustInput, inputAffectOutput);
}
-
@SuppressWarnings({ "unchecked", "rawtypes" })
- public UniversalRecipeInput getRecipeInput(List[] input)
- {
+ public UniversalRecipeInput getRecipeInput(List[] input) {
return this.getRecipeInput(input[0], input[1]);
}
-
- public void removeRecipeByInput(UniversalRecipeInput uRecipeInput)
- {
+ public void removeRecipeByInput(UniversalRecipeInput uRecipeInput) {
List<FluidStack> fluidInputs = IHLUtils.convertRecipeInputToFluidStackList(uRecipeInput.getFluidInputs());
List<ItemStack> itemInputs = IHLUtils.convertRecipeInputToItemStackList(uRecipeInput.getItemInputs());
- {
- Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
- while (i$.hasNext())
- {
- Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
- UniversalRecipeInput recipeInput = entry.getKey();
- if (recipeInput.matches(fluidInputs, itemInputs))
- {
- i$.remove();
- break;
- }
- }
- }
+ {
+ Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
+ while (i$.hasNext()) {
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeInput recipeInput = entry.getKey();
+ if (recipeInput.matches(fluidInputs, itemInputs)) {
+ i$.remove();
+ break;
+ }
+ }
+ }
}
- public void removeRecipeByOutput(UniversalRecipeOutput uRecipeOutput)
- {
+ public void removeRecipeByOutput(UniversalRecipeOutput uRecipeOutput) {
Iterator<Entry<UniversalRecipeInput, UniversalRecipeOutput>> i$ = this.recipes.entrySet().iterator();
- while (i$.hasNext())
- {
- Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
- UniversalRecipeOutput recipeOutput = entry.getValue();
- if (recipeOutputHasCommonEntries(recipeOutput,uRecipeOutput))
- {
- i$.remove();
- }
- }
+ while (i$.hasNext()) {
+ Entry<UniversalRecipeInput, UniversalRecipeOutput> entry = i$.next();
+ UniversalRecipeOutput recipeOutput = entry.getValue();
+ if (recipeOutputHasCommonEntries(recipeOutput, uRecipeOutput)) {
+ i$.remove();
+ }
+ }
}
-
- public boolean recipeOutputHasCommonEntries(UniversalRecipeOutput out, UniversalRecipeOutput out1)
- {
+
+ public boolean recipeOutputHasCommonEntries(UniversalRecipeOutput out, UniversalRecipeOutput out1) {
List<FluidStack> fluidOutputs = out.getFluidOutputs();
List<RecipeOutputItemStack> itemOutputs = out.getItemOutputs();
- if(!fluidOutputs.isEmpty() && !out1.getFluidOutputs().isEmpty())
- {
+ if (!fluidOutputs.isEmpty() && !out1.getFluidOutputs().isEmpty()) {
FluidStack fs1 = out1.getFluidOutputs().get(0);
Iterator<FluidStack> fi = fluidOutputs.iterator();
- while(fi.hasNext())
- {
+ while (fi.hasNext()) {
FluidStack fs = fi.next();
- if(fs.getFluid()==fs1.getFluid())
- {
+ if (fs.getFluid() == fs1.getFluid()) {
return true;
}
}
}
- if(!itemOutputs.isEmpty() && !out1.getItemOutputs().isEmpty())
- {
+ if (!itemOutputs.isEmpty() && !out1.getItemOutputs().isEmpty()) {
RecipeOutputItemStack is1 = out1.getItemOutputs().get(0);
Iterator<RecipeOutputItemStack> ii = itemOutputs.iterator();
- while(ii.hasNext())
- {
+ while (ii.hasNext()) {
RecipeOutputItemStack is = ii.next();
- if(is.matches(is1))
- {
+ if (is.matches(is1)) {
return true;
}
}
|
