From 270b7986ac61c368642d7f4a932af85f62ef8e09 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 31 Dec 2016 17:22:20 +1100 Subject: [PATCH] Fix air count calculation error --- .../boydti/fawe/example/CharFaweChunk.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java b/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java index daf5b4eb..7437c2a9 100644 --- a/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java +++ b/core/src/main/java/com/boydti/fawe/example/CharFaweChunk.java @@ -192,8 +192,15 @@ public abstract class CharFaweChunk extends FaweChunk if (vs == null) { vs = this.ids[i] = new char[4096]; this.count[i]++; - } else if (vs[j] == 0) { - this.count[i]++; + } else { + switch (vs[j]) { + case 0: + this.count[i]++; + break; + case 1: + this.air[i]--; + break; + } } switch (id) { case 0: @@ -231,8 +238,15 @@ public abstract class CharFaweChunk extends FaweChunk if (vs == null) { vs = this.ids[i] = new char[4096]; this.count[i]++; - } else if (vs[j] == 0) { - this.count[i]++; + } else { + switch (vs[j]) { + case 0: + this.count[i]++; + break; + case 1: + this.air[i]--; + break; + } } switch (id) { case 0: