timetracking: add compost bin time trackers (#12619)

This commit is contained in:
SirGirion
2020-10-19 21:46:14 -04:00
committed by GitHub
parent 91417aca98
commit 274df60d3c
8 changed files with 216 additions and 11 deletions

View File

@@ -52,7 +52,7 @@ public class PatchImplementationTest
collector.checkThat(pfx + ": produce", s.getProduce(), notNullValue());
collector.checkThat(pfx + ": negative stage", s.getStage(), greaterThanOrEqualTo(0));
int stages = s.getProduce().getStages();
if (s.getCropState() == CropState.HARVESTABLE)
if (s.getCropState() == CropState.HARVESTABLE || s.getCropState() == CropState.FILLING)
{
stages = s.getProduce().getHarvestStages();
}
@@ -63,7 +63,8 @@ public class PatchImplementationTest
}
if (s.getCropState() == CropState.GROWING && s.getProduce() != Produce.WEEDS && s.getStage() < stages)
{
harvestStages.computeIfAbsent(s.getProduce(), k -> new boolean[s.getProduce().getStages()])[s.getStage()] = true;
final int realStages = stages;
harvestStages.computeIfAbsent(s.getProduce(), k -> new boolean[realStages])[s.getStage()] = true;
}
}
}