@@ -0,0 +1,1209 @@
+package net.teamio.taam.piping;%0A%0Aimport net.minecraft.util.EnumFacing;%0Aimport net.minecraftforge.fluids.FluidStack;%0A%0A/**%0A * A pipe end that only allows one fluid at a time.%0A * Useful for recipe-based processing machines.%0A * %0A * @author Oliver Kahrmann%0A *%0A */%0Apublic class PipeEndRestricted extends PipeEnd %7B%0A%0A%09public PipeEndRestricted(EnumFacing side, int capacity, boolean active) %7B%0A%09%09super(side, capacity, active);%0A%09%7D%0A%0A%09public PipeEndRestricted(EnumFacing side, PipeInfo info, boolean active) %7B%0A%09%09super(side, info, active);%0A%09%7D%0A%0A%09@Override%0A%09public int addFluid(FluidStack stack) %7B%0A%09%09FluidStack inside = null;%0A%09%09if(info.content.size() %3E 0) %7B%0A%09%09%09inside = info.content.get(0);%0A%09%09%09%0A%09%09%09// Clean up 0-amount-stacks, fail-safe for any %22stupid%22 cases%0A%09%09%09while (inside != null && inside.amount == 0) %7B%0A%09%09%09%09info.content.remove(0);%0A%09%09%09%09if(info.content.size() %3E 0) %7B%0A%09%09%09%09%09inside = info.content.get(0);%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09inside = null;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09if(inside == null %7C%7C inside.isFluidEqual(stack)) %7B%0A%09%09%09return info.addFluid(stack);%0A%09%09%7D else %7B%0A%09%09%09return 0;%0A%09%09%7D%0A%09%7D%0A%0A%09public FluidStack getFluid() %7B%0A%09%09FluidStack inside = null;%0A%09%09if(info.content.size() %3E 0) %7B%0A%09%09%09inside = info.content.get(0);%0A%09%09%7D%0A%09%09return inside;%0A%09%7D%0A%09%0A%7D%0A

Implement restricted pipe end