use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class EnderIORecipeExtractor method getInputIngredients.
@Override
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs, 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);
ArrayList<PositionedStack> inputs = ReflectEIO.getInputs(vatRecipe);
for (int i = 0; i < inputs.size(); i++) {
if (inputs.get(i) == null)
continue;
OrderStack<?> stack = OrderStack.pack(rawInputs.get(i), i);
if (stack != null)
tmp.add(stack);
}
FluidStack in = ReflectEIO.getInputFluid(vatRecipe);
if (in != null) {
tmp.add(new OrderStack<>(in, inputs.size()));
}
return tmp;
} else if (tRecipe.getOverlayIdentifier().equals("EnderIOSagMill")) {
for (int i = rawInputs.size() - 1; i >= 0; i--) {
PositionedStack stack = rawInputs.get(i);
if (stack != null && CrusherRecipeManager.getInstance().isValidSagBall(stack.items[0])) {
rawInputs.remove(i);
break;
}
}
return getInputIngredients(rawInputs);
} else {
return getInputIngredients(rawInputs);
}
}
use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class ForestryRecipeExtractor method getOutputIngredients.
@Override
public List<OrderStack<?>> getOutputIngredients(List<PositionedStack> rawOutputs, IRecipeHandler recipe, int index) {
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
removeGlass(rawOutputs);
List<OrderStack<?>> tmp = new ArrayList<>();
List<PositionedStack> compressed = compress(rawOutputs);
if (tRecipe.arecipes.get(index) instanceof RecipeHandlerBase.CachedBaseRecipe) {
tmp = getOutputIngredients(compressed);
List<PositionedFluidTank> tanks = ((RecipeHandlerBase.CachedBaseRecipe) tRecipe.arecipes.get(index)).getFluidTanks();
if (tanks.size() > 0 && handler instanceof NEIHandlerSqueezer) {
FluidStack fluid = tanks.get(0).tank.getFluid();
if (fluid != null) {
tmp.add(new OrderStack<>(fluid, compressed.size()));
}
} else if (tanks.size() > 1) {
FluidStack fluid = tanks.get(1).tank.getFluid();
if (fluid != null) {
tmp.add(new OrderStack<>(fluid, compressed.size()));
}
}
}
return tmp;
}
use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class ForestryRecipeExtractor method getInputIngredients.
@Override
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs, IRecipeHandler recipe, int index) {
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipe;
List<OrderStack<?>> tmp = new ArrayList<>();
List<PositionedStack> compressed = compress(rawInputs);
if (tRecipe.arecipes.get(index) instanceof RecipeHandlerBase.CachedBaseRecipe) {
tmp = getInputIngredients(compressed);
List<PositionedFluidTank> tanks = ((RecipeHandlerBase.CachedBaseRecipe) tRecipe.arecipes.get(index)).getFluidTanks();
if (tanks.size() > 0 && !(handler instanceof NEIHandlerSqueezer)) {
FluidStack fluid = tanks.get(0).tank.getFluid();
if (fluid != null) {
tmp.add(new OrderStack<>(fluid, compressed.size()));
}
}
}
return tmp;
}
use of com.glodblock.github.nei.object.OrderStack in project AE2FluidCraft-Rework by GlodBlock.
the class GregTech5RecipeExtractor 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 GT_FluidDisplayItem) {
NBTTagCompound aNBT = item.getTagCompound();
int amt = (int) aNBT.getLong("mFluidDisplayAmount");
if (amt <= 0)
continue;
stack = new OrderStack<>(new FluidStack(FluidRegistry.getFluid(item.getItemDamage()), amt), 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 GregTech5RecipeExtractor method getInputIngredients.
@Override
public List<OrderStack<?>> getInputIngredients(List<PositionedStack> rawInputs) {
if (r)
removeSpecial(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 GT_FluidDisplayItem) {
NBTTagCompound aNBT = item.getTagCompound();
int amt = (int) aNBT.getLong("mFluidDisplayAmount");
if (amt <= 0)
continue;
stack = new OrderStack<>(new FluidStack(FluidRegistry.getFluid(item.getItemDamage()), amt), i);
tmp.add(stack);
} else {
stack = OrderStack.pack(compressed.get(i), i);
if (stack != null)
tmp.add(stack);
}
}
return tmp;
}
Aggregations