mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-18 01:46:11 +00:00
Fix occasional NPE when removing section lighting
This commit is contained in:
parent
3df080abe4
commit
2ab207cfe9
@ -191,7 +191,7 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks implements BukkitGetBl
|
|||||||
if (sky) {
|
if (sky) {
|
||||||
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
||||||
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
||||||
if (nibble != null) {
|
if (nibbleSky != null) {
|
||||||
lightUpdate = true;
|
lightUpdate = true;
|
||||||
synchronized (nibbleSky) {
|
synchronized (nibbleSky) {
|
||||||
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
||||||
|
@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks implements BukkitGetBl
|
|||||||
if (sky) {
|
if (sky) {
|
||||||
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
||||||
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
||||||
if (nibble != null) {
|
if (nibbleSky != null) {
|
||||||
lightUpdate = true;
|
lightUpdate = true;
|
||||||
synchronized (nibbleSky) {
|
synchronized (nibbleSky) {
|
||||||
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
||||||
|
@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks implements BukkitGetBl
|
|||||||
if (sky) {
|
if (sky) {
|
||||||
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
||||||
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
||||||
if (nibble != null) {
|
if (nibbleSky != null) {
|
||||||
lightUpdate = true;
|
lightUpdate = true;
|
||||||
synchronized (nibbleSky) {
|
synchronized (nibbleSky) {
|
||||||
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
||||||
|
@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_5 extends CharGetBlocks implements BukkitGetBl
|
|||||||
if (sky) {
|
if (sky) {
|
||||||
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer);
|
||||||
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky);
|
||||||
if (nibble != null) {
|
if (nibbleSky != null) {
|
||||||
lightUpdate = true;
|
lightUpdate = true;
|
||||||
synchronized (nibbleSky) {
|
synchronized (nibbleSky) {
|
||||||
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
|
||||||
|
Loading…
Reference in New Issue
Block a user