count items picked up

This commit is contained in:
RedSparr0w committed 2019-10-21 12:06:34 +13:00
1 parent 780b5e963c
commit 60d30afebd
2 files changed
+5 -2

No files matched your search

@@ -29,17 +29,19 @@ public class PickupItems implements Strategy {
@Override
public void execute() {
int currentItemAmount = Inventory.getCount(true);
try {
for (GroundItem item : items) {
item.take();
Time.sleep(() -> item.distanceTo() < 1, 2000);
if (Inventory.isFull()){
return;
break;
}
}
} catch (Exception err){
System.out.println("Pickup items error: ¯\\_(ツ)_/¯");
}
Variables.addItemGained(Inventory.getCount(true) - currentItemAmount);
}
private GroundItem[] getItems(){