File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
bukkit/src/main/java/org/faststats Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,25 @@ public BukkitMetrics(Plugin plugin, int projectId) {
2626 startSubmitting ();
2727 }
2828
29+ @ SuppressWarnings ("removal" )
2930 private boolean checkOnlineMode () {
30- return plugin .getServer ().getOnlineMode ();
31+ try {
32+ if (plugin .getServer ().getOnlineMode ()) return true ;
33+
34+ // waiting for https://github.com/PaperMC/Paper/pull/12273
35+
36+ var proxies = plugin .getServer ().spigot ().getPaperConfig ().getConfigurationSection ("proxies" );
37+ if (proxies == null ) return false ;
38+
39+ if (proxies .getBoolean ("velocity.enabled" ) && proxies .getBoolean ("velocity.online-mode" )) return true ;
40+
41+ var settings = plugin .getServer ().spigot ().getSpigotConfig ().getConfigurationSection ("settings" );
42+ if (settings == null ) return false ;
43+
44+ return settings .getBoolean ("bungeecord" ) && proxies .getBoolean ("bungee-cord.online-mode" );
45+ } catch (NoSuchMethodError e ) {
46+ return plugin .getServer ().getOnlineMode ();
47+ }
3148 }
3249
3350 @ Override
You can’t perform that action at this time.
0 commit comments