mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2026-01-06 15:42:03 +00:00
Added platform fork to metrics. Improved MC version detector in Bungee
This commit is contained in:
@@ -40,6 +40,8 @@ public abstract class PlatformUtils {
|
||||
*/
|
||||
public abstract String minecraftVersion();
|
||||
|
||||
public abstract String serverImplementationName();
|
||||
|
||||
public enum AuthType {
|
||||
ONLINE,
|
||||
PROXIED,
|
||||
|
||||
@@ -96,7 +96,11 @@ public final class Metrics {
|
||||
new SimplePie("floodgate_version", () -> Constants.VERSION)
|
||||
);
|
||||
|
||||
metricsBase.addCustomChart(new SimplePie("platform", () -> implementationName));
|
||||
metricsBase.addCustomChart(
|
||||
new DrilldownPie("platform", () -> Collections.singletonMap(
|
||||
implementationName,
|
||||
Collections.singletonMap(platformUtils.serverImplementationName(), 1)
|
||||
)));
|
||||
|
||||
metricsBase.addCustomChart(
|
||||
new DrilldownPie("minecraft_version", () -> {
|
||||
|
||||
@@ -269,6 +269,11 @@ public final class ReflectionUtils {
|
||||
return (T) getValue(instance, getField(instance.getClass(), fieldName));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static <T> T castedStaticValue(Field field) {
|
||||
return getCastedValue(null, field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of a field. This method make the field accessible and then sets the value.<br>
|
||||
* This method doesn't throw an exception when failed, but it'll log the error to the console.
|
||||
|
||||
Reference in New Issue
Block a user