Skip to content

Commit 396fb50

Browse files
committed
Support removal of isBackwardsCompatible
1 parent 1b6223f commit 396fb50

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/dev/walshy/sfmetrics/charts/CompatibilityModeChart.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import org.bstats.json.JsonObjectBuilder;
77
import org.bukkit.Server;
88

9+
import java.lang.reflect.Method;
10+
911
import javax.annotation.Nonnull;
1012

1113
/**
@@ -18,7 +20,14 @@ public class CompatibilityModeChart extends SimplePie implements SlimefunMetrics
1820

1921
public CompatibilityModeChart() {
2022
super("compatibility_mode", () -> {
21-
boolean enabled = Slimefun.getRegistry().isBackwardsCompatible();
23+
boolean enabled;
24+
try {
25+
final Method method = Slimefun.getRegistry().getClass().getDeclaredMethod("isBackwardsCompatible");
26+
enabled = (boolean) method.invoke(Slimefun.getRegistry());
27+
} catch(Exception e) {
28+
enabled = false;
29+
}
30+
2231
return enabled ? "enabled" : "disabled";
2332
});
2433
}

0 commit comments

Comments
 (0)