From 2ab207cfe975be2f20116e87ca10f4972e51987d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 5 Feb 2021 16:05:53 +0000 Subject: [PATCH] Fix occasional NPE when removing section lighting --- .../fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java | 2 +- .../fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java | 2 +- .../fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java | 2 +- .../fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java index 33e200737..6dc7e81f5 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java @@ -191,7 +191,7 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java index 20182af7b..9288ff4c9 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java @@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java index 23d47d3f4..9a16e1b73 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java @@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java index 3d28eedcc..0d1d84c02 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java @@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_5 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();