From 4ab140f6a13e892097e4c2ff5c9feb6956a1897a Mon Sep 17 00:00:00 2001 From: SirYwell Date: Sun, 26 Dec 2021 10:37:32 +0100 Subject: [PATCH] use spigot-compatible packet constructor --- .../v1_18_R1/PaperweightPlatformAdapter.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/worldedit-bukkit/adapters/adapter-1_18/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R1/PaperweightPlatformAdapter.java b/worldedit-bukkit/adapters/adapter-1_18/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R1/PaperweightPlatformAdapter.java index abb0a1ab8..78ad00245 100644 --- a/worldedit-bukkit/adapters/adapter-1_18/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R1/PaperweightPlatformAdapter.java +++ b/worldedit-bukkit/adapters/adapter-1_18/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R1/PaperweightPlatformAdapter.java @@ -269,9 +269,27 @@ public final class PaperweightPlatformAdapter extends NMSAdapter { } LevelChunk levelChunk = optional.get(); TaskManager.taskManager().task(() -> { - ClientboundLevelChunkWithLightPacket packet = - new ClientboundLevelChunkWithLightPacket(levelChunk, nmsWorld.getChunkSource().getLightEngine(), null, null - , true, false); // last false is to not bother with x-ray + ClientboundLevelChunkWithLightPacket packet; + if (PaperLib.isPaper()) { + packet = new ClientboundLevelChunkWithLightPacket( + levelChunk, + nmsWorld.getChunkSource().getLightEngine(), + null, + null, + true, + false // last false is to not bother with x-ray + ); + } else { + // deprecated on paper + //noinspection deprecation + packet = new ClientboundLevelChunkWithLightPacket( + levelChunk, + nmsWorld.getChunkSource().getLightEngine(), + null, + null, + true + ); + } nearbyPlayers(nmsWorld, coordIntPair).forEach(p -> p.connection.send(packet)); }); }