public static boolean canInteractWithFluid( DockingStation station, IFluidFilter filter, Class<?> actionClass) { boolean actionFound = false; for (StatementSlot s : station.getActiveActions()) { if (actionClass.isAssignableFrom(s.statement.getClass())) { StatementParameterStackFilter param = new StatementParameterStackFilter(s.parameters); if (!param.hasFilter()) { actionFound = true; break; } else { for (ItemStack stack : param.getStacks()) { if (stack != null) { FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(stack); if (fluid != null && filter.matches(fluid.getFluid())) { actionFound = true; break; } } } } } } return actionFound; }
public static boolean canInteractWithItem( DockingStation station, IStackFilter filter, Class<?> actionClass) { boolean actionFound = false; for (StatementSlot s : station.getActiveActions()) { if (actionClass.isAssignableFrom(s.statement.getClass())) { StatementParameterStackFilter param = new StatementParameterStackFilter(s.parameters); if (!param.hasFilter() || param.matches(filter)) { actionFound = true; break; } } } return actionFound; }