count items picked up

This commit is contained in:
RedSparr0w
2019-10-21 12:06:34 +13:00
parent 780b5e963c
commit 60d30afebd
2 changed files with 5 additions and 2 deletions
@@ -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(){