use of crazypants.enderio.conduits.conduit.item.NetworkedInventory.Target in project EnderIO by SleepyTrousers.
the class ItemConduitNetwork method getTargetsForExtraction.
public List<String> getTargetsForExtraction(@Nonnull BlockPos extractFrom, @Nonnull IItemConduit con, @Nonnull ItemStack input) {
List<String> result = new ArrayList<String>();
List<NetworkedInventory> invs = getOrCreate(extractFrom);
for (NetworkedInventory source : invs) {
if (source.getCon().getBundle().getLocation().equals(con.getBundle().getLocation())) {
List<Target> sendPriority = source.getSendPriority();
if (sendPriority != null) {
for (Target t : sendPriority) {
IItemFilter f = t.inv.getCon().getOutputFilter(t.inv.getConDir());
if (input.isEmpty() || f == null || f.doesItemPassFilter(getTargetInventory(t), input)) {
String s = t.inv.getLocalizedInventoryName() + " " + t.inv.getLocation().toString() + " Distance [" + t.distance + "] ";
result.add(s);
}
}
}
}
}
return result;
}
Aggregations