Search in sources :

Example 1 with RecipeInput

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);
            }
        }
    }
}
Also used : RecipeInput(crazypants.enderio.base.recipe.RecipeInput)

Example 2 with RecipeInput

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;
}
Also used : IRecipe(crazypants.enderio.base.recipe.IRecipe) IMachineRecipe(crazypants.enderio.base.recipe.IMachineRecipe) Recipe(crazypants.enderio.base.recipe.Recipe) IRecipe(crazypants.enderio.base.recipe.IRecipe) MachineRecipeInput(crazypants.enderio.base.recipe.MachineRecipeInput) RecipeInput(crazypants.enderio.base.recipe.RecipeInput) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack)

Example 3 with RecipeInput

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()])));
    }
}
Also used : IRecipeInput(crazypants.enderio.base.recipe.IRecipeInput) RecipeInput(crazypants.enderio.base.recipe.RecipeInput) IRecipeInput(crazypants.enderio.base.recipe.IRecipeInput) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput) Recipe(crazypants.enderio.base.recipe.Recipe) NNList(com.enderio.core.common.util.NNList) RecipeOutput(crazypants.enderio.base.recipe.RecipeOutput) ThingsRecipeInput(crazypants.enderio.base.recipe.ThingsRecipeInput)

Aggregations

RecipeInput (crazypants.enderio.base.recipe.RecipeInput)3 Recipe (crazypants.enderio.base.recipe.Recipe)2 RecipeOutput (crazypants.enderio.base.recipe.RecipeOutput)2 NNList (com.enderio.core.common.util.NNList)1 IMachineRecipe (crazypants.enderio.base.recipe.IMachineRecipe)1 IRecipe (crazypants.enderio.base.recipe.IRecipe)1 IRecipeInput (crazypants.enderio.base.recipe.IRecipeInput)1 MachineRecipeInput (crazypants.enderio.base.recipe.MachineRecipeInput)1 ThingsRecipeInput (crazypants.enderio.base.recipe.ThingsRecipeInput)1 ArrayList (java.util.ArrayList)1 ItemStack (net.minecraft.item.ItemStack)1