use of crazypants.enderio.base.recipe.MachineRecipeInput in project EnderIO by SleepyTrousers.
the class VatRecipe method matchRecipe.
private RecipeMatch matchRecipe(NNList<MachineRecipeInput> recipeInputs) {
if (!isValid() || recipeInputs == null || recipeInputs.size() < requiredItems + 1) {
return null;
}
FluidStack inputFluid = null;
RecipeMatch m = new RecipeMatch();
for (MachineRecipeInput in : recipeInputs) {
if (in.isFluid()) {
inputFluid = in.fluid;
} else {
m.setRecipeInput(getRecipeInput(in.slotNumber, in.item));
}
}
if (requiredItems == 1) {
m.r1 = m.r0;
}
m.in = inputFluidStacks.get(m.r0, m.r1);
m.out = outputFluidStacks.get(m.r0, m.r1);
if (inputFluid != null && inputFluid.containsFluid(m.in)) {
return m;
} else {
return null;
}
}
use of crazypants.enderio.base.recipe.MachineRecipeInput in project EnderIO by SleepyTrousers.
the class VanillaSmeltingRecipe method getCompletedResult.
@Override
@Nonnull
public ResultStack[] getCompletedResult(long nextSeed, float chanceMultiplier, @Nonnull NNList<MachineRecipeInput> inputs) {
ItemStack output = null;
for (MachineRecipeInput ri : inputs) {
if (ri != null && Prep.isValid(ri.item) && output == null) {
output = FurnaceRecipes.instance().getSmeltingResult(ri.item);
}
}
if (output == null) {
return new ResultStack[0];
}
int stackSize = output.getCount();
ItemStack result = output.copy();
result.setCount(stackSize * getNumInputs(inputs));
return new ResultStack[] { new ResultStack(result) };
}
use of crazypants.enderio.base.recipe.MachineRecipeInput in project EnderIO by SleepyTrousers.
the class VanillaSmeltingRecipe method getQuantitiesConsumed.
@Override
@Nonnull
public List<MachineRecipeInput> getQuantitiesConsumed(@Nonnull NNList<MachineRecipeInput> inputs) {
int consumed = 0;
List<MachineRecipeInput> result = new ArrayList<MachineRecipeInput>();
for (MachineRecipeInput ri : inputs) {
if (ri != null && Prep.isValid(ri.item) && isValidInput(new MachineRecipeInput(ri.slotNumber, ri.item)) && consumed < 3) {
int available = ri.item.getCount();
int canUse = 3 - consumed;
int use = Math.min(canUse, available);
if (use > 0) {
ItemStack st = ri.item.copy();
st.setCount(use);
result.add(new MachineRecipeInput(ri.slotNumber, st));
consumed += use;
}
}
}
return result;
}
use of crazypants.enderio.base.recipe.MachineRecipeInput in project EnderIO by SleepyTrousers.
the class EnchanterRecipe method getQuantitiesConsumed.
@Override
@Nonnull
public NNList<MachineRecipeInput> getQuantitiesConsumed(@Nonnull NNList<MachineRecipeInput> inputs) {
ItemStack slot0 = MachineRecipeInput.getInputForSlot(0, inputs).copy();
ItemStack slot1 = MachineRecipeInput.getInputForSlot(1, inputs).copy();
ItemStack slot2 = MachineRecipeInput.getInputForSlot(2, inputs).copy();
int level = getLevelForStackSize(slot1.getCount());
slot0.setCount(1);
slot1.setCount(stackSizePerLevel * level);
slot2.setCount(getLapizForLevel(level));
NNList<MachineRecipeInput> result = new NNList<MachineRecipeInput>();
result.add(new MachineRecipeInput(0, slot0));
result.add(new MachineRecipeInput(1, slot1));
result.add(new MachineRecipeInput(2, slot2));
return result;
}
Aggregations