From 6839d5531fb2ce20493fd086d4c112296c990029 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 2 May 2018 09:03:00 +1000 Subject: [PATCH] Prevent incompatibility with BetterShutdown --- .../java/com/boydti/fawe/bukkit/BukkitMain.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitMain.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitMain.java index 1983b388..de74d77f 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitMain.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitMain.java @@ -29,10 +29,12 @@ public class BukkitMain extends JavaPlugin { pluginsField.set(manager, new ArrayList(plugins) { @Override public boolean add(Plugin plugin) { - if (!plugin.getName().startsWith("AsyncWorldEdit")) { - return super.add(plugin); - } else { + if (plugin.getName().startsWith("AsyncWorldEdit")) { Fawe.debug("Disabling `" + plugin.getName() + "` as it is incompatible"); + } else if (plugin.getName().startsWith("BetterShutdown")) { + Fawe.debug("Disabling `" + plugin.getName() + "` as it is incompatible (Improperly shaded classes from com.sk89q.minecraft.util.commands)"); + } else { + return super.add(plugin); } return false; } @@ -40,10 +42,11 @@ public class BukkitMain extends JavaPlugin { lookupNamesField.set(manager, new ConcurrentHashMap(lookupNames) { @Override public Plugin put(String key, Plugin plugin) { - if (!plugin.getName().startsWith("AsyncWorldEdit")) { - return super.put(key, plugin); + if (plugin.getName().startsWith("AsyncWorldEdit") || plugin.getName().startsWith("BetterShutdown")) { + return null; } - return null; + return super.put(key, plugin); + } }); } catch (Throwable ignore) {}