if (!(container instanceof IGate)) {
return false;
}
Pipe<?> pipe = (Pipe<?>) ((IGate) container).getPipe();
IStatementParameter parameter = parameters[0];
if (pipe.transport instanceof PipeTransportItems) {
PipeTransportItems transportItems = (PipeTransportItems) pipe.transport;
if (kind == PipeContents.empty) {
return transportItems.items.isEmpty();
} else if (kind == PipeContents.containsItems) {
if (parameter != null && parameter.getItemStack() != null) {
for (TravelingItem item : transportItems.items) {
if (StackHelper.isMatchingItemOrList(parameter.getItemStack(), item.getItemStack())) {
return true;
}
}
} else {
return !transportItems.items.isEmpty();
}
}
} else if (pipe.transport instanceof PipeTransportFluids) {
PipeTransportFluids transportFluids = (PipeTransportFluids) pipe.transport;
FluidStack searchedFluid = null;
if (parameter != null && parameter.getItemStack() != null) {
searchedFluid = FluidContainerRegistry.getFluidForFilledItem(parameter.getItemStack());
}
if (kind == PipeContents.empty) {
for (FluidTankInfo b : transportFluids.getTankInfo(ForgeDirection.UNKNOWN)) {
if (b.fluid != null && b.fluid.amount != 0) {