package appeng.util.item; import java.util.Iterator; import appeng.api.storage.data.IAEStack; public class MeanfulIterator implements Iterator { final Iterator parent; private StackType next; public MeanfulIterator(Iterator iterator) { parent = iterator; } @Override public boolean hasNext() { while (parent.hasNext()) { next = parent.next(); if ( next.isMeaninful() ) return true; else parent.remove(); // self cleaning :3 } return false; } @Override public Object next() { return next; } @Override public void remove() { parent.remove(); } }