private static Supplier<double[]> getSupplier() {
        try {
            Method spigotMethod = Bukkit.getServer().getClass().getMethod("spigot");
            Method getTPSMethod = Class.forName("org.bukkit.Server$Spigot").getMethod("getTPS");
            Object spigot = spigotMethod.invoke(Bukkit.getServer());
            return () -> {
                try {
                    return (double[]) getTPSMethod.invoke(spigot);
                } catch (IllegalAccessException | InvocationTargetException e) {
                    throw new RuntimeException(e);
                }
            };
        } catch (Exception e) {
            // ignore
        }

        try {
            Method getTPSMethod = Bukkit.class.getMethod("getTPS");
            return () -> {
                try {
                    return (double[]) getTPSMethod.invoke(null);
                } catch (IllegalAccessException | InvocationTargetException e) {
                    throw new RuntimeException(e);
                }
            };
        } catch (Exception e) {
            // ignore
        }

        return null;
    }
Encapsulates the servers "ticks per second" (TPS) reading.
helper/src/main/java/me/lucko/helper/utils/Tps.java