use of minechem.utils.MapKey in project Minechem by iopleke.
the class ChemicalTurtlePeripheral method keyListToStacks.
private ArrayList<ItemStack> keyListToStacks(List<MapKey> keys) {
ArrayList<ItemStack> result = new ArrayList<ItemStack>();
for (MapKey key : keys) {
if (key != null) {
ItemStack add = null;
DecomposerRecipe decomp = DecomposerRecipe.get(key);
if (decomp != null) {
add = decomp.getInput();
} else {
SynthesisRecipe synth = SynthesisRecipe.get(key);
if (synth != null) {
add = synth.getOutput();
}
}
if (add != null) {
result.add(add);
}
}
}
return result;
}
use of minechem.utils.MapKey in project Minechem by iopleke.
the class ChemicalTurtlePeripheral method addStackToKnown.
protected boolean addStackToKnown(ItemStack add) {
MapKey addString = MapKey.getKey(add);
for (MapKey key : known) {
if (key.equals(addString)) {
return false;
}
}
known.add(addString);
return true;
}
use of minechem.utils.MapKey in project Minechem by iopleke.
the class DecomposerRecipe method addChemicals.
public void addChemicals(PotionChemical... chemicals) {
for (PotionChemical potionChemical : chemicals) {
PotionChemical current = this.output.get(new MapKey(potionChemical));
if (current != null) {
current.amount += potionChemical.amount;
continue;
}
this.output.put(new MapKey(potionChemical), potionChemical.copy());
}
}
use of minechem.utils.MapKey in project Minechem by iopleke.
the class DecomposerRecipeHandler method resetRecursiveRecipes.
public static void resetRecursiveRecipes() {
for (MapKey key : DecomposerRecipe.recipes.keySet()) {
if (DecomposerRecipe.get(key) instanceof DecomposerRecipeSuper) {
DecomposerRecipe.remove(key);
}
}
Recipe.init();
recursiveRecipes();
}
use of minechem.utils.MapKey in project Minechem by iopleke.
the class DecomposerRecipeSuper method outputContains.
@Override
public boolean outputContains(PotionChemical potionChemical) {
boolean contains;
contains = super.outputContains(potionChemical);
if (!contains) {
for (MapKey key : recipes.keySet()) {
DecomposerRecipe dr = DecomposerRecipe.get(key);
LogHelper.debug("outputContains: " + key);
if (dr == null) {
continue;
}
contains = dr.outputContains(potionChemical);
if (contains) {
break;
}
}
}
return contains;
}
Aggregations