mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-09 20:21:41 +01:00
don't break blocks if hopper doesn't have an open slot
This commit is contained in:
parent
02e129a6b0
commit
623c048f9c
@ -21,6 +21,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ModuleBlockBreak extends Module {
|
||||
|
||||
@ -56,6 +57,12 @@ public class ModuleBlockBreak extends Module {
|
||||
if (!isEnabled(hopper))
|
||||
return;
|
||||
|
||||
// don't try to break stuff if we can't grab stuff
|
||||
// (for simplicity, just assume that no empty slots mean there's a good chance we won't be able to pick something new up)
|
||||
if(Stream.of(hopperCache.cachedInventory)
|
||||
.allMatch(item -> item != null && item.getAmount() > 0))
|
||||
return;
|
||||
|
||||
Integer tick = blockTick.get(hopper);
|
||||
if (tick == null) {
|
||||
blockTick.put(hopper, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user