mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-08 20:10:45 +01:00
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:
parent
c3a6c92f22
commit
b65a678d0d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user