From be0e33746c7e60965c74bb8246e7b1557ace6e0c Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 19 Sep 2020 16:54:42 +0100 Subject: [PATCH] Ensure the block actually can be waterlogged when checking for waterlogged status. Fixes #632 Fixed #633 --- .../fawe/beta/implementation/lighting/NMSRelighter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/lighting/NMSRelighter.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/lighting/NMSRelighter.java index d2bc73b40..f30fa0383 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/lighting/NMSRelighter.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/implementation/lighting/NMSRelighter.java @@ -950,11 +950,13 @@ public class NMSRelighter implements Relighter { if (heightMapList.get(HeightMapType.OCEAN_FLOOR)[j] == 0 && material.isSolid()) { heightMapList.get(HeightMapType.OCEAN_FLOOR)[j] = y + 1; } - if (heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] == 0 && (material.isSolid() || material.isLiquid() || state.getState(waterLogged))) { + if (heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] == 0 && (material.isSolid() || material.isLiquid() || ( + state.getStates().containsKey(waterLogged) && state.getState(waterLogged)))) { heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] = y + 1; } - if (heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] == 0 && (material.isSolid() || material.isLiquid() || state - .getState(waterLogged)) && !state.getBlockType().getId().toLowerCase().contains("leaves")) { + if (heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] == 0 && (material.isSolid() || material.isLiquid() || ( + state.getStates().containsKey(waterLogged) && state.getState(waterLogged))) && !state.getBlockType().getId().toLowerCase() + .contains("leaves")) { heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] = y + 1; } }