Skip to content

Commit 08826c7

Browse files
committed
Use Class.forName(...).getMethod(...)
Also, fix typo
1 parent dbd017b commit 08826c7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/com/extendedclip/papi/expansion/server/ServerUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public final class ServerUtils {
2424
private boolean hasTpsMethod = false;
2525

2626
public ServerUtils() {
27-
variants.put("Spigot", "org.spigotnc.SpigotConfig");
27+
variants.put("Spigot", "org.spigotmc.SpigotConfig");
2828
variants.put("Paper", "com.destroystokyo.paper.PaperConfig");
2929
variants.put("Tuinity", "com.tuinity.tuinity.config.TuinityConfig");
3030
variants.put("Airplane", "gg.airplane.AirplaneConfig");
@@ -106,9 +106,9 @@ public double[] getTps() {
106106
private void resolveTPSHandler() {
107107
try {
108108
// If this throws is the server not a fork...
109-
Bukkit.getTPS();
109+
Class.forName("org.bukkit.Bukkit").getMethod("getTPS");
110110
hasTpsMethod = true;
111-
} catch (Exception ignored) {
111+
} catch (ClassNotFoundException | NoSuchMethodException ignored) {
112112
final String mcVersion = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
113113

114114
try {

0 commit comments

Comments
 (0)