1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-22 01:48:50 +00:00

fix: compile error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2022-04-12 23:55:21 +08:00
parent 881bd610a4
commit 616f499f91

View File

@ -17,6 +17,7 @@ import pw.yumc.YumCore.engine.MiaoScriptEngine;
import javax.script.ScriptException; import javax.script.ScriptException;
import java.io.*; import java.io.*;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
@ -234,7 +235,11 @@ public class Statistics {
try { try {
return Bukkit.getOnlinePlayers().size(); return Bukkit.getOnlinePlayers().size();
} catch (Exception ex) { } catch (Exception ex) {
try {
return ((Player[]) getOnlinePlayers.invoke(Bukkit.getServer())).length; return ((Player[]) getOnlinePlayers.invoke(Bukkit.getServer())).length;
} catch (IllegalAccessException | InvocationTargetException e) {
return 0;
}
} }
} }