Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bstats - Fix trying to compare enum value to string value for verbosity and event priority #7027

Merged
merged 4 commits into from
Sep 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/main/java/org/skriptlang/skript/bukkit/SkriptMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ public static void setupMetrics(Metrics metrics) {

metrics.addCustomChart(new DrilldownPie("drilldownLogVerbosity", () -> {
String verbosity = SkriptConfig.verbosity.value().name().toLowerCase(Locale.ENGLISH).replace('_', ' ');
return isDefaultMap(verbosity, SkriptConfig.verbosity.defaultValue());
String defaultValue = SkriptConfig.verbosity.defaultValue().name().toLowerCase(Locale.ENGLISH).replace('_', ' ');
return isDefaultMap(verbosity, defaultValue);
}));

metrics.addCustomChart(new DrilldownPie("drilldownPluginPriority", () -> {
String priority = SkriptConfig.defaultEventPriority.value().name().toLowerCase(Locale.ENGLISH).replace('_', ' ');
return isDefaultMap(priority, SkriptConfig.defaultEventPriority.defaultValue());
String defaultValue = SkriptConfig.defaultEventPriority.defaultValue().name().toLowerCase(Locale.ENGLISH).replace('_', ' ');
return isDefaultMap(priority, defaultValue);
}));
metrics.addCustomChart(new SimplePie("cancelledByDefault", () ->
SkriptConfig.listenCancelledByDefault.value().toString()
Expand All @@ -143,10 +145,10 @@ public static void setupMetrics(Metrics metrics) {
SkriptConfig.caseSensitive.value().toString()
));
metrics.addCustomChart(new SimplePie("caseSensitiveVariables", () ->
SkriptConfig.caseInsensitiveVariables.value().toString()
String.valueOf(!SkriptConfig.caseInsensitiveVariables.value())
));
metrics.addCustomChart(new SimplePie("caseSensitiveCommands", () ->
SkriptConfig.caseInsensitiveCommands.value().toString()
String.valueOf(!SkriptConfig.caseInsensitiveCommands.value())
));

metrics.addCustomChart(new SimplePie("disableSaveWarnings", () ->
Expand Down