From 9f6e0ebd5c2032b87f9ddfecf66b067029f332fc Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Thu, 11 Jun 2020 12:22:54 -0400 Subject: [PATCH] Minor changes to NMS logic --- .../adapter/mc1_14/BukkitGetBlocks_1_14.java | 2 ++ .../implementation/lighting/NMSRelighter.java | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java index 848d127c5..eace17737 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java @@ -128,6 +128,7 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks { public int getSkyLight(int x, int y, int z) { int layer = y >> 4; if (skyLight[layer] == null) { + //getDataLayerData skyLight[layer] = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(SectionPosition.a(nmsChunk.getPos(), layer)); } long l = BlockPosition.a(x, y, z); @@ -138,6 +139,7 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks { public int getEmmittedLight(int x, int y, int z) { int layer = y >> 4; if (blockLight[layer] == null) { + //getDataLayerData blockLight[layer] = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.BLOCK).a(SectionPosition.a(nmsChunk.getPos(), layer)); } long l = BlockPosition.a(x, y, z); 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 505ae5f20..15284cbbb 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 @@ -428,7 +428,7 @@ public class NMSRelighter implements Relighter { } } for (int y = 255; y > 0; y--) { - for (RelightSkyEntry chunk : chunks) { // Propogate skylight + for (RelightSkyEntry chunk : chunks) { // Propagate skylight int layer = y >> 4; byte[] mask = chunk.mask; if ((y & 15) == 15 && chunk.fix[layer] != SkipReason.NONE) { @@ -596,7 +596,7 @@ public class NMSRelighter implements Relighter { } } - private class RelightSkyEntry implements Comparable { + private class RelightSkyEntry implements Comparable { public final int x; public final int z; public final byte[] mask; @@ -625,18 +625,17 @@ public class NMSRelighter implements Relighter { } @Override - public int compareTo(Object o) { - RelightSkyEntry other = (RelightSkyEntry) o; - if (other.x < x) { + public int compareTo(RelightSkyEntry o) { + if (o.x < x) { return 1; } - if (other.x > x) { + if (o.x > x) { return -1; } - if (other.z < z) { + if (o.z < z) { return 1; } - if (other.z > z) { + if (o.z > z) { return -1; } return 0;