Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ use when screen sharing or live-streaming gameplay.
**Added in version 1.4.0.**

For us to better understand how many servers are using AdminToolbox, by default we collect anonymized analytics via
bStats. Server administrators can disable this functionality by setting `enable-stats: false` in config.yml.
bStats. Server administrators can disable this functionality on their servers by setting `enabled: false` in
`plugins/bStats/config.yml`.

The anonymized collected data is viewable publicly at https://bstats.org/plugin/bukkit/AdminToolbox/26406.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,8 @@ public void onEnable() {
getLogger().warning("BlueMap API not found! Some features will be unavailable.");
}

if (getConfig().getBoolean("enable-stats")) {
getLogger().info("Enabling bStats for plugin statistics.");
// bStats - plugin analytics
new Metrics(this, BSTATS_PLUGIN_ID);
}
// bStats - plugin analytics. Toggleable in server-level bStats config.
new Metrics(this, BSTATS_PLUGIN_ID);

getLogger().info(String.format("Enabled %s", getPluginMeta().getDisplayName()));
}
Expand Down Expand Up @@ -173,9 +170,6 @@ public void reloadConfig() {
public Configuration getConfigDefaults() {
Configuration defaults = new YamlConfiguration();

defaults.set("enable-stats", true);
defaults.setComments("enable-stats", List.of("'false' entirely disables sending statistics via bStats."));

{
ConfigurationSection streamerMode = defaults.createSection("streamer-mode");
streamerMode.set("allow", true);
Expand All @@ -198,6 +192,11 @@ private void initializeConfig() {
config.setDefaults(defaults);
config.options().copyDefaults(true);

// Remove `enable-stats` option, it's toggleable at the server level.
if (config.isSet("enable-stats")) {
getConfig().set("enable-stats", null);
}

saveConfig();
reloadConfig();
}
Expand Down