for(Block bl : searchQueue) {
if (bl.getType() == Material.GLASS || bl.getType() == Material.STAINED_GLASS)
searchNearbyPipes(bl, visitedPipes, items, filters, exceptions);
else if (bl.getType() == Material.PISTON_BASE) {
PistonBaseMaterial p = (PistonBaseMaterial) bl.getState().getData();
ChangedSign sign = getSignOnPiston(bl);
HashSet<ItemStack> pFilters = new HashSet<ItemStack>();
HashSet<ItemStack> pExceptions = new HashSet<ItemStack>();
if(sign != null) {
for(String line3 : RegexUtil.COMMA_PATTERN.split(sign.getLine(2))) {
pFilters.add(ItemSyntax.getItem(line3.trim()));
}
for(String line4 : RegexUtil.COMMA_PATTERN.split(sign.getLine(3))) {
pExceptions.add(ItemSyntax.getItem(line4.trim()));
}
pFilters.removeAll(Collections.singleton(null));
pExceptions.removeAll(Collections.singleton(null));
}
List<ItemStack> filteredItems = new ArrayList<ItemStack>(VerifyUtil.withoutNulls(ItemUtil.filterItems(items, pFilters, pExceptions)));
if(filteredItems.isEmpty())
continue;
List<ItemStack> newItems = new ArrayList<ItemStack>();
Block fac = bl.getRelative(p.getFacing());
if (InventoryUtil.doesBlockHaveInventory(fac)) {
newItems.addAll(InventoryUtil.addItemsToInventory((InventoryHolder) fac.getState(), filteredItems.toArray(new ItemStack[filteredItems.size()])));
} else if(fac.getType() == Material.JUKEBOX) {
Jukebox juke = (Jukebox) fac.getState();
List<ItemStack> its = new ArrayList<ItemStack>(filteredItems);