Skip to content

Commit e079096

Browse files
author
games647
committed
Catch NoSuchMethodError
Fixes #499
1 parent 4bc328c commit e079096

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
1212
import com.github.games647.fastlogin.core.PremiumStatus;
1313
import com.github.games647.fastlogin.core.shared.FastLoginCore;
1414
import com.github.games647.fastlogin.core.shared.PlatformPlugin;
15+
1516
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;
2117

2218
import java.net.InetSocketAddress;
2319
import java.nio.file.Path;
@@ -26,6 +22,12 @@
2622
import java.util.concurrent.ConcurrentHashMap;
2723
import java.util.concurrent.ConcurrentMap;
2824

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+
2931
/**
3032
* This plugin checks if a player has a paid account and if so tries to skip offline mode authentication.
3133
*/
@@ -116,8 +118,12 @@ public void onDisable() {
116118
}
117119

118120
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+
}
121127
}
122128
}
123129

0 commit comments

Comments
 (0)