From febf598aa320e1fd3aeeacd55ebac0089a586232 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 8 Dec 2020 10:28:17 -0600 Subject: [PATCH] Support other WorldEdit versions. --- .../com/songoda/skyblock/utils/structure/SchematicUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/skyblock/utils/structure/SchematicUtil.java b/src/main/java/com/songoda/skyblock/utils/structure/SchematicUtil.java index 697668a4..a74cb0b8 100644 --- a/src/main/java/com/songoda/skyblock/utils/structure/SchematicUtil.java +++ b/src/main/java/com/songoda/skyblock/utils/structure/SchematicUtil.java @@ -4,6 +4,7 @@ import com.songoda.skyblock.SkyBlock; import com.songoda.skyblock.utils.version.NMSUtil; import org.bukkit.Bukkit; import org.bukkit.World; +import org.bukkit.plugin.PluginManager; import java.io.File; import java.io.FileInputStream; @@ -14,7 +15,8 @@ import java.lang.reflect.Method; public class SchematicUtil { public static Float[] pasteSchematic(File schematicFile, org.bukkit.Location location) { - if (!Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) + PluginManager pluginManager = Bukkit.getPluginManager(); + if (!pluginManager.isPluginEnabled("WorldEdit") && !pluginManager.isPluginEnabled("AsyncWorldEdit") && !pluginManager.isPluginEnabled("FastAsyncWorldEdit")) throw new IllegalStateException("Tried to generate an island using a schematic file without WorldEdit installed!"); Runnable pasteTask = () -> {