leftovers.add(ItemUtil.addToStack(f.getInventory().getResult(), item));
}
} else f.getInventory().setResult(null);
} else if (fac.getType() == Material.JUKEBOX) {
Jukebox juke = (Jukebox) fac.getState();
items.add(new ItemStack(juke.getPlaying()));
PipeSuckEvent event = new PipeSuckEvent(block, new ArrayList<ItemStack>(items), fac);
Bukkit.getPluginManager().callEvent(event);
items.clear();
items.addAll(event.getItems());
if(!event.isCancelled()) {
visitedPipes.add(fac.getLocation());
searchNearbyPipes(block, visitedPipes, items, filters, exceptions);
}
if (!items.isEmpty()) {
for (ItemStack item : items) {
if (item == null) continue;
block.getWorld().dropItem(BlockUtil.getBlockCentre(block), item);
}
} else juke.setPlaying(null);
} else {
PipeSuckEvent event = new PipeSuckEvent(block, new ArrayList<ItemStack>(items), fac);
Bukkit.getPluginManager().callEvent(event);
items.clear();
items.addAll(event.getItems());