Handle when PE plugin is missing

This commit is contained in:
libraryaddict 2024-08-22 19:09:39 +12:00
parent 31fdb53f01
commit 30a7a848fe

View File

@ -407,7 +407,8 @@ public class LibsDisguises extends JavaPlugin {
private void startOutdatedPacketevents() {
if (!DisguiseConfig.isNeverUpdatePacketEvents() && PacketEventsUpdater.isPacketEventsOutdated()) {
String requiredPacketEvents = PacketEventsUpdater.getMinimumPacketEventsVersion();
String version = Bukkit.getPluginManager().getPlugin("packetevents").getDescription().getVersion();
Plugin plugin = Bukkit.getPluginManager().getPlugin("packetevents");
String version = plugin == null ? "[PacketEvents Plugin Missing]" : plugin.getDescription().getVersion();
BukkitRunnable runnable = createPacketEventsOutdatedRunnable(version, requiredPacketEvents);
runnable.run();