don't break blocks if hopper doesn't have an open slot

This commit is contained in:
jascotty2 2019-08-12 09:07:56 -05:00
parent 02e129a6b0
commit 623c048f9c

View File

@ -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);