|
12 | 12 | import com.github.games647.fastlogin.core.PremiumStatus; |
13 | 13 | import com.github.games647.fastlogin.core.shared.FastLoginCore; |
14 | 14 | import com.github.games647.fastlogin.core.shared.PlatformPlugin; |
| 15 | + |
15 | 16 | import io.papermc.lib.PaperLib; |
16 | | -import org.bukkit.command.CommandSender; |
17 | | -import org.bukkit.entity.Player; |
18 | | -import org.bukkit.plugin.PluginManager; |
19 | | -import org.bukkit.plugin.java.JavaPlugin; |
20 | | -import org.slf4j.Logger; |
21 | 17 |
|
22 | 18 | import java.net.InetSocketAddress; |
23 | 19 | import java.nio.file.Path; |
|
26 | 22 | import java.util.concurrent.ConcurrentHashMap; |
27 | 23 | import java.util.concurrent.ConcurrentMap; |
28 | 24 |
|
| 25 | +import org.bukkit.command.CommandSender; |
| 26 | +import org.bukkit.entity.Player; |
| 27 | +import org.bukkit.plugin.PluginManager; |
| 28 | +import org.bukkit.plugin.java.JavaPlugin; |
| 29 | +import org.slf4j.Logger; |
| 30 | + |
29 | 31 | /** |
30 | 32 | * This plugin checks if a player has a paid account and if so tries to skip offline mode authentication. |
31 | 33 | */ |
@@ -116,8 +118,12 @@ public void onDisable() { |
116 | 118 | } |
117 | 119 |
|
118 | 120 | bungeeManager.cleanup(); |
119 | | - if (getServer().getPluginManager().isPluginEnabled("PlaceholderAPI") && premiumPlaceholder != null) { |
120 | | - premiumPlaceholder.unregister(); |
| 121 | + if (premiumPlaceholder != null && getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) { |
| 122 | + try { |
| 123 | + premiumPlaceholder.unregister(); |
| 124 | + } catch (Exception | NoSuchMethodError exception) { |
| 125 | + logger.error("Failed to unregister placeholder", exception); |
| 126 | + } |
121 | 127 | } |
122 | 128 | } |
123 | 129 |
|
|
0 commit comments