use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class GregTech6RecipeExtractor method getInputIngredients.
@Override
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs) {
this.removeMachine(rawInputs);
List<PositionedStack> compressed = compress(rawInputs);
List<OrderStack<?>> tmp = new LinkedList<>();
for (int i = 0; i < compressed.size(); i++) {
if (compressed.get(i) == null)
continue;
ItemStack item = compressed.get(i).items[0];
OrderStack<?> stack;
if (item.getItem() instanceof ItemFluidDisplay) {
FluidStack fluid = ((ItemFluidDisplay) item.getItem()).getFluid(item);
if (fluid == null || fluid.amount <= 0)
continue;
stack = new OrderStack<>(fluid, i);
tmp.add(stack);
} else {
stack = OrderStack.pack(compressed.get(i), i);
if (stack != null)
tmp.add(stack);
}
}
return tmp;
}
use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class FluidPatternTerminalRecipeTransferHandler method overlayRecipe.
@Override
public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift) {
if (isCorrectGui(firstGui)) {
List<OrderStack<?>> in = FluidRecipe.getPackageInputs(recipe, recipeIndex);
List<OrderStack<?>> out = FluidRecipe.getPackageOutputs(recipe, recipeIndex, !notUseOther(recipe));
boolean craft = shouldCraft(recipe);
FluidCraft.proxy.netHandler.sendToServer(new CPacketTransferRecipe(in, out, craft));
}
}
use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class EnderIORecipeExtractor method getOutputIngredients.
@Override
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs, IRecipeHandler recipe, int index) {
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
List<OrderStack<?>> tmp = new LinkedList<>();
if (tRecipe.arecipes.get(index) instanceof VatRecipeHandler.InnerVatRecipe) {
VatRecipeHandler.InnerVatRecipe vatRecipe = (VatRecipeHandler.InnerVatRecipe) tRecipe.arecipes.get(index);
FluidStack result = ReflectEIO.getResult(vatRecipe);
if (result != null) {
tmp.add(new OrderStack<>(result, 0));
}
return tmp;
} else {
return getOutputIngredients(rawOutputs);
}
}
use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class GregTech6RecipeExtractor method getOutputIngredients.
@Override
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs) {
List<PositionedStack> compressed = compress(rawOutputs);
List<OrderStack<?>> tmp = new LinkedList<>();
for (int i = 0; i < compressed.size(); i++) {
if (compressed.get(i) == null)
continue;
ItemStack item = compressed.get(i).items[0];
OrderStack<?> stack;
if (item.getItem() instanceof ItemFluidDisplay) {
FluidStack fluid = ((ItemFluidDisplay) item.getItem()).getFluid(item);
if (fluid == null || fluid.amount <= 0)
continue;
stack = new OrderStack<>(fluid, i);
tmp.add(stack);
} else {
stack = OrderStack.pack(compressed.get(i), i);
if (stack != null)
tmp.add(stack);
}
}
return tmp;
}
Aggregations