Skip to content

Commit

Permalink
fix(Metrics): Added config value for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeV220 committed Nov 30, 2022
1 parent d680ac3 commit 74f2615
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/georgev22/voterewards/VoteReward.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.georgev22.library.utilities.Utils;
import com.georgev22.library.yaml.configmanager.CFG;
import com.georgev22.library.yaml.file.FileConfiguration;
import com.georgev22.library.yaml.file.YamlConfiguration;
import com.georgev22.library.yaml.serialization.ConfigurationSerialization;
import com.georgev22.voterewards.commands.*;
import com.georgev22.voterewards.hooks.*;
Expand All @@ -39,7 +40,6 @@
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -181,8 +181,8 @@ public void onEnable() throws Exception {
commandManager = new PaperCommandManager(plugin);

if (!MinecraftUtils.MinecraftVersion.getCurrentVersion().isAboveOrEqual(MinecraftUtils.MinecraftVersion.UNKNOWN)) {
new Metrics(plugin, 3179);
if (YamlConfiguration.loadConfiguration(new File(new File(this.getDataFolder().getParentFile(), "bStats"), "config.yml")).getBoolean("enabled", true)) {
if (YamlConfiguration.loadConfiguration(new File(new File(this.getDataFolder().getParentFile(), "bStats"), "config.yml")).getBoolean("enabled", true) & OptionsUtil.METRICS.getBooleanValue()) {
new Metrics(plugin, 3179);
MinecraftUtils.debug(getName(), getVersion(), "Metrics are enabled!");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public enum OptionsUtil {

EXPERIMENTAL_FEATURES("experimental features", false, Optional.empty()),

METRICS("metrics", true, Optional.empty()),

DISCORD("discord", false, Optional.empty()),

HOLOGRAMS_ENABLED("hologram.enabled", false, Optional.empty()),
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Options:
experimental features: false #Turn on experimental features
metrics: true
debug: #Shows debug message
vote:
preVote: false
Expand Down

0 comments on commit 74f2615

Please sign in to comment.