Skip to content

Commit

Permalink
check minimum required BungeeCord version
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeCrafter47 committed Nov 5, 2023
1 parent 8a864d8 commit aa5ccb9
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
import lombok.val;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.connection.Connection;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.protocol.packet.PlayerListHeaderFooter;
import org.bstats.bungeecord.Metrics;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
Expand Down Expand Up @@ -185,19 +187,25 @@ public void onLoad() {
try {
Class.forName("net.md_5.bungee.api.Title");
} catch (ClassNotFoundException ex) {
throw new RuntimeException("You need to run at least BungeeCord version #1671");
throw new RuntimeException("You need to run at least BungeeCord version #1760");
}

try {
Connection.class.getMethod("isConnected");
} catch (NoSuchMethodException ex) {
throw new RuntimeException("You need to run at least BungeeCord version #1671");
throw new RuntimeException("You need to run at least BungeeCord version #1760");
}

try {
Class.forName("net.md_5.bungee.protocol.packet.PlayerListItemUpdate");
} catch (ClassNotFoundException ex) {
throw new RuntimeException("You need to run at least BungeeCord version #1671");
throw new RuntimeException("You need to run at least BungeeCord version #1760");
}

try {
PlayerListHeaderFooter.class.getMethod("setHeader", BaseComponent.class);
} catch (NoSuchMethodException ex) {
throw new RuntimeException("You need to run at least BungeeCord version #1760");
}

INSTANCE = this;
Expand Down

0 comments on commit aa5ccb9

Please sign in to comment.