When sending items to a hopper farms will now stop sending items when there is no more room for the item.

This commit is contained in:
Brianna O'Keefe 2018-05-17 17:37:24 -04:00
parent c3a6c92f22
commit b65a678d0d

View File

@ -96,27 +96,11 @@ public class FarmingHandler {
}
private boolean canHop(Inventory i, ItemStack item) {
try {
if (i.firstEmpty() != -1) {
if (i.firstEmpty() != -1) return true;
for (ItemStack it : i.getContents()) {
if (it == null || it.isSimilar(item) && (it.getAmount() + item.getAmount()) <= it.getMaxStackSize()) {
return true;
}
boolean can = false;
for (ItemStack it : i.getContents()) {
if (it == null) {
can = true;
break;
} else {
if (it.isSimilar(item)) {
if (it.getAmount() <= it.getMaxStackSize()) {
can = true;
break;
}
}
}
}
return can;
} catch (Exception e) {
Debugger.runReport(e);
}
return false;
}