Add mStats toggle
All checks were successful
/ deploy (push) Successful in 1m21s

This commit is contained in:
Minecon724 2024-12-08 13:49:54 +01:00
parent 736b6df730
commit 9e7dcea54b
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
3 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,8 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
public record TweaksConfig( public record TweaksConfig(
boolean metrics,
boolean worldborderExpand, boolean worldborderExpand,
boolean worldborderHide, boolean worldborderHide,
@ -69,6 +71,8 @@ public record TweaksConfig(
throw new RuntimeException("Did you downgrade the plugin? Remove config.yml and let the plugin re-create it", exception); throw new RuntimeException("Did you downgrade the plugin? Remove config.yml and let the plugin re-create it", exception);
} }
boolean metrics = config.getBoolean("metrics");
boolean worldborderExpand = config.getBoolean("worldborder.expand"); boolean worldborderExpand = config.getBoolean("worldborder.expand");
boolean worldborderHide = config.getBoolean("worldborder.hide"); boolean worldborderHide = config.getBoolean("worldborder.hide");
@ -108,6 +112,7 @@ public record TweaksConfig(
String authHostname = config.getString("auth.domain"); String authHostname = config.getString("auth.domain");
TweaksConfig.config = new TweaksConfig( TweaksConfig.config = new TweaksConfig(
metrics,
worldborderExpand, worldborderHide, worldborderExpand, worldborderHide,
brandEnabled, brandText, brandShowPing, brandShowMspt, brandEnabled, brandText, brandShowPing, brandShowMspt,
doorEnabled, doorDoubleOpen, doorKnocking, doorEnabled, doorDoubleOpen, doorKnocking,

View file

@ -99,7 +99,8 @@ public class TweaksPlugin extends MStatsPlugin {
new AuthManager(this).init(getCommand("tauth")); new AuthManager(this).init(getCommand("tauth"));
} }
mStats(1); if (config.metrics())
mStats(1);
getLogger().info("Took %.3f milliseconds".formatted((System.nanoTime() - start) / 1000000.0)); getLogger().info("Took %.3f milliseconds".formatted((System.nanoTime() - start) / 1000000.0));
} }

View file

@ -5,6 +5,9 @@
# - https://discord.gg/86X4Z5JUeq # - https://discord.gg/86X4Z5JUeq
# - https://www.spigotmc.org/threads/tweaks724.670906/ # - https://www.spigotmc.org/threads/tweaks724.670906/
# Metrics toggle. Ideally opt-in, but the system is very new and it needs testing.
metrics: true
# Warning: Don't use /worldborder while this is on # Warning: Don't use /worldborder while this is on
worldborder: worldborder:
# Expands the worldborder to 30,000,000 # Expands the worldborder to 30,000,000