mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2025-09-01 11:26:56 +00:00
@ -17,6 +17,7 @@ import pw.yumc.YumCore.engine.MiaoScriptEngine;
|
||||
import javax.script.ScriptException;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
@ -234,7 +235,11 @@ public class Statistics {
|
||||
try {
|
||||
return Bukkit.getOnlinePlayers().size();
|
||||
} catch (Exception ex) {
|
||||
return ((Player[]) getOnlinePlayers.invoke(Bukkit.getServer())).length;
|
||||
try {
|
||||
return ((Player[]) getOnlinePlayers.invoke(Bukkit.getServer())).length;
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user