From 81534b3476b12d3b1007ad54e73f4becd457b575 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 26 Aug 2021 10:47:00 +0200 Subject: [PATCH] Ignore datapacks on 1.15 --- .../com/fastasyncworldedit/bukkit/FaweBukkit.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java index ea40b7882..5b860b29a 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/FaweBukkit.java @@ -26,8 +26,10 @@ import com.fastasyncworldedit.core.util.TaskManager; import com.fastasyncworldedit.core.util.WEManager; import com.fastasyncworldedit.core.util.image.ImageViewer; import com.plotsquared.core.PlotSquared; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitPlayer; +import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.internal.util.LogManagerCompat; import io.papermc.lib.PaperLib; import io.papermc.paper.datapack.Datapack; @@ -53,12 +55,12 @@ public class FaweBukkit implements IFawe, Listener { private static final Logger LOGGER = LogManagerCompat.getLogger(); private final Plugin plugin; - private ItemUtil itemUtil; - - private boolean listeningImages; private final boolean chunksStretched; private final FAWEPlatformAdapterImpl platformAdapter; + private ItemUtil itemUtil; + private boolean listeningImages; private Preloader preloader; + private volatile boolean keepUnloaded; public FaweBukkit(Plugin plugin) { this.plugin = plugin; @@ -130,7 +132,6 @@ public class FaweBukkit implements IFawe, Listener { return plugin.getDataFolder(); } - public ItemUtil getItemUtil() { ItemUtil tmp = itemUtil; if (tmp == null) { @@ -161,7 +162,8 @@ public class FaweBukkit implements IFawe, Listener { .append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n") .append(" • Provides: ").append(p.getDescription().getProvides()).append("\n"); } - if (PaperLib.isPaper()) { + int dataVersion = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getDataVersion(); + if (dataVersion >= 2586 && PaperLib.isPaper()) { Collection datapacks = Bukkit.getServer().getDatapackManager().getEnabledPacks(); msg.append("Enabled Datapacks (").append(datapacks.size()).append("):\n"); for (Datapack dp : datapacks) { @@ -236,8 +238,6 @@ public class FaweBukkit implements IFawe, Listener { return managers; } - private volatile boolean keepUnloaded; - @EventHandler(priority = EventPriority.MONITOR) public void onWorldLoad(WorldLoadEvent event) { if (keepUnloaded) {