Fix removing section lighting

- Paper and spigot differ in methods
 - Also don't clone it as we're trying to fill the actual data...
Dieser Commit ist enthalten in:
dordsor21 2021-01-14 17:03:32 +00:00
Ursprung b18c646bce
Commit bad3d31d90
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
4 geänderte Dateien mit 20 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -27,6 +27,7 @@ import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import io.papermc.lib.PaperLib;
import net.minecraft.server.v1_15_R1.BiomeBase; import net.minecraft.server.v1_15_R1.BiomeBase;
import net.minecraft.server.v1_15_R1.BiomeStorage; import net.minecraft.server.v1_15_R1.BiomeStorage;
import net.minecraft.server.v1_15_R1.BlockPosition; import net.minecraft.server.v1_15_R1.BlockPosition;
@ -181,8 +182,8 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibble) { synchronized (nibble) {
byte[] bytes = nibble.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibble.getIfSet() : nibble.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }
@ -193,8 +194,8 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibbleSky) { synchronized (nibbleSky) {
byte[] bytes = nibbleSky.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }

Datei anzeigen

@ -27,6 +27,7 @@ import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import io.papermc.lib.PaperLib;
import net.minecraft.server.v1_16_R1.BiomeBase; import net.minecraft.server.v1_16_R1.BiomeBase;
import net.minecraft.server.v1_16_R1.BiomeStorage; import net.minecraft.server.v1_16_R1.BiomeStorage;
import net.minecraft.server.v1_16_R1.BlockPosition; import net.minecraft.server.v1_16_R1.BlockPosition;
@ -182,8 +183,8 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibble) { synchronized (nibble) {
byte[] bytes = nibble.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibble.getIfSet() : nibble.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }
@ -194,8 +195,8 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibbleSky) { synchronized (nibbleSky) {
byte[] bytes = nibbleSky.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }

Datei anzeigen

@ -27,6 +27,7 @@ import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import io.papermc.lib.PaperLib;
import net.minecraft.server.v1_16_R2.BiomeBase; import net.minecraft.server.v1_16_R2.BiomeBase;
import net.minecraft.server.v1_16_R2.BiomeStorage; import net.minecraft.server.v1_16_R2.BiomeStorage;
import net.minecraft.server.v1_16_R2.BlockPosition; import net.minecraft.server.v1_16_R2.BlockPosition;
@ -182,8 +183,8 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibble) { synchronized (nibble) {
byte[] bytes = nibble.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibble.getIfSet() : nibble.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }
@ -194,8 +195,8 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibbleSky) { synchronized (nibbleSky) {
byte[] bytes = nibbleSky.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }

Datei anzeigen

@ -27,6 +27,7 @@ import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import io.papermc.lib.PaperLib;
import net.minecraft.server.v1_16_R3.BiomeBase; import net.minecraft.server.v1_16_R3.BiomeBase;
import net.minecraft.server.v1_16_R3.BiomeStorage; import net.minecraft.server.v1_16_R3.BiomeStorage;
import net.minecraft.server.v1_16_R3.BlockPosition; import net.minecraft.server.v1_16_R3.BlockPosition;
@ -182,8 +183,8 @@ public class BukkitGetBlocks_1_16_4 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibble) { synchronized (nibble) {
byte[] bytes = nibble.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibble.getIfSet() : nibble.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }
@ -194,8 +195,8 @@ public class BukkitGetBlocks_1_16_4 extends CharGetBlocks implements BukkitGetBl
if (nibble != null) { if (nibble != null) {
lightUpdate = true; lightUpdate = true;
synchronized (nibbleSky) { synchronized (nibbleSky) {
byte[] bytes = nibbleSky.getCloneIfSet(); byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes();
if (bytes != NibbleArray.EMPTY_NIBBLE) { if (!PaperLib.isPaper() || bytes != NibbleArray.EMPTY_NIBBLE) {
Arrays.fill(bytes, (byte) 0); Arrays.fill(bytes, (byte) 0);
} }
} }