From 737606a791f436b4d893efaddfafdbf5b2008e57 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Wed, 14 Apr 2021 22:32:44 +0200 Subject: [PATCH] Dirty workaround for CharBlocks blocks NPE --- .../beta/implementation/processors/HeightmapProcessor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/processors/HeightmapProcessor.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/processors/HeightmapProcessor.java index 769aac96e..b51f9c5c8 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/processors/HeightmapProcessor.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/processors/HeightmapProcessor.java @@ -4,6 +4,7 @@ import com.boydti.fawe.beta.IBatchProcessor; import com.boydti.fawe.beta.IChunk; import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkSet; +import com.boydti.fawe.beta.implementation.blocks.CharBlocks; import com.boydti.fawe.beta.implementation.lighting.HeightMapType; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.World; @@ -55,6 +56,10 @@ public class HeightmapProcessor implements IBatchProcessor { } if (block == null || block.getBlockType() == RESERVED) { if (!hasSectionGet) continue; + // TODO this is only a workaround to avoid large stacktraces + // and needs to be fixed in CharBlocks/BukkitGetBlocks + if (((CharBlocks) get).blocks[y >> 4] == null) continue; + block = get.getBlock(x, y, z); } // fast skip if block isn't relevant for any height map