mirror of
https://github.com/songoda/EpicFarming.git
synced 2025-01-09 17:57:44 +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) {
|
private boolean canHop(Inventory i, ItemStack item) {
|
||||||
try {
|
if (i.firstEmpty() != -1) return true;
|
||||||
if (i.firstEmpty() != -1) {
|
for (ItemStack it : i.getContents()) {
|
||||||
|
if (it == null || it.isSimilar(item) && (it.getAmount() + item.getAmount()) <= it.getMaxStackSize()) {
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user