use of crazypants.enderio.base.recipe.RecipeInput in project EnderIO by SleepyTrousers.
the class PaintSourceParser method startElement.
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (ELEMENT_WHITELIST.equals(localName)) {
isWhitelist = true;
isBlacklist = false;
return;
}
if (ELEMENT_BLACKLIST.equals(localName)) {
isWhitelist = false;
isBlacklist = true;
return;
}
if (ELEMENT_ITEM_STACK.equals(localName)) {
if (!isWhitelist && !isBlacklist) {
Log.warn("PaintSourceParser: Item stack found outside of whitlist/blacklist elements. It will be ignored");
return;
}
RecipeInput stack = RecipeConfigParser.getItemStack(attributes);
if (stack == null) {
return;
}
boolean isRemove = RecipeConfigParser.getBooleanValue(AT_REMOVE, attributes, false);
if (isBlacklist) {
if (isRemove) {
PaintSourceValidator.instance.removeFromBlackList(stack);
} else {
PaintSourceValidator.instance.addToBlacklist(stack);
}
} else {
if (isRemove) {
PaintSourceValidator.instance.removeFromWhitelist(stack);
} else {
PaintSourceValidator.instance.addToWhitelist(stack);
}
}
}
}
use of crazypants.enderio.base.recipe.RecipeInput in project EnderIO by SleepyTrousers.
the class VanillaSmeltingRecipe method getAllRecipes.
public List<IRecipe> getAllRecipes() {
List<IRecipe> result = new ArrayList<IRecipe>();
Map<ItemStack, ItemStack> metaList = FurnaceRecipes.instance().getSmeltingList();
for (Entry<ItemStack, ItemStack> entry : metaList.entrySet()) {
ItemStack output = entry.getValue();
int stackSize = output.getCount();
output.setCount(stackSize);
final ItemStack key = NullHelper.notnullM(entry.getKey(), "null item stack in furnace recipes");
result.add(new Recipe(new RecipeInput(key), RF_PER_ITEM, RecipeBonusType.NONE, new RecipeOutput(output)));
}
return result;
}
use of crazypants.enderio.base.recipe.RecipeInput in project EnderIO by SleepyTrousers.
the class Fermenting method register.
@Override
public void register(@Nonnull String recipeName) {
if (isValid() && isActive()) {
NNList<IRecipeInput> inputStacks = new NNList<>();
int slot = 0;
for (NNIterator<Inputgroup> itr = inputgroup.fastIterator(); itr.hasNext(); ) {
for (NNIterator<ItemMultiplier> itr2 = itr.next().getItems().fastIterator(); itr2.hasNext(); ) {
ItemMultiplier item = itr2.next();
inputStacks.add(new ThingsRecipeInput(item.getThing(), slot, item.multiplier));
}
slot++;
}
inputStacks.add(new RecipeInput(inputfluid.getFluidStack(), inputfluid.multiplier));
RecipeOutput recipeOutput = new RecipeOutput(outputfluid.getFluidStack());
VatRecipeManager.getInstance().addRecipe(new Recipe(recipeOutput, energy, RecipeBonusType.NONE, inputStacks.toArray(new IRecipeInput[inputStacks.size()])));
}
}
Aggregations