use of crazypants.enderio.base.recipe.Recipe in project EnderIO by SleepyTrousers.
the class Sagmilling method register.
@Override
public void register(@Nonnull String recipeName) {
if (isValid() && isActive()) {
ThingsRecipeInput recipeInput = new ThingsRecipeInput(input.getThing());
NNList<RecipeOutput> recipeOutputs = new NNList<>();
for (Output output : getOutputs()) {
if (output instanceof OutputWithChance) {
recipeOutputs.add(new RecipeOutput(output.getItemStack(), ((OutputWithChance) output).getChance()));
} else {
recipeOutputs.add(new RecipeOutput(output.getItemStack(), 1));
}
}
Recipe recipe = new Recipe(recipeInput, energy, bonus, recipeOutputs.toArray(new RecipeOutput[0]));
SagMillRecipeManager.getInstance().addRecipe(recipe);
}
}
use of crazypants.enderio.base.recipe.Recipe 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.Recipe 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()])));
}
}
use of crazypants.enderio.base.recipe.Recipe in project EnderIO by SleepyTrousers.
the class Slicing method register.
@Override
public void register(@Nonnull String recipeName) {
if (isValid() && isActive()) {
NNList<IRecipeInput> inputStacks = new NNList<>();
for (NNIterator<Item> itr = inputs.fastIterator(); itr.hasNext(); ) {
final Item item = itr.next();
inputStacks.add(new ThingsRecipeInput(item.getThing(), inputStacks.size()));
}
RecipeOutput recipeOutput = new RecipeOutput(getOutput().getItemStack());
SliceAndSpliceRecipeManager.getInstance().addRecipe(new Recipe(recipeOutput, energy, RecipeBonusType.NONE, inputStacks.toArray(new IRecipeInput[inputStacks.size()])));
}
}
use of crazypants.enderio.base.recipe.Recipe in project EnderIO by SleepyTrousers.
the class AlloyRecipeManager method addRecipe.
public void addRecipe(@Nonnull NNList<IRecipeInput> input, @Nonnull ItemStack output, int energyCost, float xpChance) {
RecipeOutput recipeOutput = new RecipeOutput(output, 1, xpChance);
addRecipe(new Recipe(recipeOutput, energyCost, RecipeBonusType.NONE, input.toArray(new IRecipeInput[input.size()])));
}
Aggregations