3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-03 01:50:07 +01:00

Ignore datapacks on 1.15

Dieser Commit ist enthalten in:
NotMyFault 2021-08-26 10:47:00 +02:00
Ursprung ee14f7ebb1
Commit 81534b3476
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 158F5701A6AAD00C

Datei anzeigen

@ -26,8 +26,10 @@ import com.fastasyncworldedit.core.util.TaskManager;
import com.fastasyncworldedit.core.util.WEManager; import com.fastasyncworldedit.core.util.WEManager;
import com.fastasyncworldedit.core.util.image.ImageViewer; import com.fastasyncworldedit.core.util.image.ImageViewer;
import com.plotsquared.core.PlotSquared; import com.plotsquared.core.PlotSquared;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.internal.util.LogManagerCompat; import com.sk89q.worldedit.internal.util.LogManagerCompat;
import io.papermc.lib.PaperLib; import io.papermc.lib.PaperLib;
import io.papermc.paper.datapack.Datapack; import io.papermc.paper.datapack.Datapack;
@ -53,12 +55,12 @@ public class FaweBukkit implements IFawe, Listener {
private static final Logger LOGGER = LogManagerCompat.getLogger(); private static final Logger LOGGER = LogManagerCompat.getLogger();
private final Plugin plugin; private final Plugin plugin;
private ItemUtil itemUtil;
private boolean listeningImages;
private final boolean chunksStretched; private final boolean chunksStretched;
private final FAWEPlatformAdapterImpl platformAdapter; private final FAWEPlatformAdapterImpl platformAdapter;
private ItemUtil itemUtil;
private boolean listeningImages;
private Preloader preloader; private Preloader preloader;
private volatile boolean keepUnloaded;
public FaweBukkit(Plugin plugin) { public FaweBukkit(Plugin plugin) {
this.plugin = plugin; this.plugin = plugin;
@ -130,7 +132,6 @@ public class FaweBukkit implements IFawe, Listener {
return plugin.getDataFolder(); return plugin.getDataFolder();
} }
public ItemUtil getItemUtil() { public ItemUtil getItemUtil() {
ItemUtil tmp = itemUtil; ItemUtil tmp = itemUtil;
if (tmp == null) { if (tmp == null) {
@ -161,7 +162,8 @@ public class FaweBukkit implements IFawe, Listener {
.append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n") .append(" • Soft Dependencies: ").append(p.getDescription().getSoftDepend()).append("\n")
.append(" • Provides: ").append(p.getDescription().getProvides()).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<Datapack> datapacks = Bukkit.getServer().getDatapackManager().getEnabledPacks(); Collection<Datapack> datapacks = Bukkit.getServer().getDatapackManager().getEnabledPacks();
msg.append("Enabled Datapacks (").append(datapacks.size()).append("):\n"); msg.append("Enabled Datapacks (").append(datapacks.size()).append("):\n");
for (Datapack dp : datapacks) { for (Datapack dp : datapacks) {
@ -236,8 +238,6 @@ public class FaweBukkit implements IFawe, Listener {
return managers; return managers;
} }
private volatile boolean keepUnloaded;
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onWorldLoad(WorldLoadEvent event) { public void onWorldLoad(WorldLoadEvent event) {
if (keepUnloaded) { if (keepUnloaded) {