Skip to content

Commit

Permalink
Loads chunks async if supported before growing a tree.
Browse files Browse the repository at this point in the history
#12

With low view distances, chunks on the other side of the island may not
be loaded so they need loading to grow a tree. This is now done async.
  • Loading branch information
tastybento committed Mar 7, 2020
1 parent 096655f commit 9b673a7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ protected void runChecker() {
.stream()
.filter(e -> isTwerking.contains(e.getValue()))
.map(Map.Entry::getKey)
.forEach(this::growTree)
.forEach(b -> Util.getChunkAtAsync(b.getLocation()).thenRun(() -> growTree(b)))
, 10L, 400L);
}

protected void growTree(Block b) {
protected void growTree(Block b) {
Material t = b.getType();
if (!Tag.SAPLINGS.isTagged(t)) {
return;
Expand Down

0 comments on commit 9b673a7

Please sign in to comment.