From bdc565492bb8fcf35022b78e6938a91bdb727fa1 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Thu, 17 Nov 2016 19:07:55 -0500 Subject: [PATCH] Attempted to fix error: Internal error: Command not registered to command caller --- .../components/metrics/MetricsComponent.java | 16 +++++----------- .../metrics/commands/GetLoginMetrics.java | 4 ++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 078b649..387734c 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -1,20 +1,14 @@ package alisolarflare.components.metrics; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.components.Component; import alisolarflare.components.metrics.commands.GetLoginMetrics; import alisolarflare.components.metrics.listeners.PlayerJoinListener; -import buttondevteam.lib.TBMCCoreAPI; public class MetricsComponent extends Component{ @@ -25,19 +19,19 @@ public class MetricsComponent extends Component{ public void register(JavaPlugin plugin){ registerCommand(plugin, new GetLoginMetrics(this)); registerListener(plugin, new PlayerJoinListener(this)); - - metricsList = new ArrayList(); + metricsList = new ArrayList(); + /* try { metricsYml = loadFileConfiguration(plugin, "metrics.yml"); metricsList = metricsYml.getStringList("playerLogins"); } catch (IOException | InvalidConfigurationException e) { TBMCCoreAPI.SendException("metrics.yml in AliPresents could not be created!", e); return; - } + }*/ } - + /* private FileConfiguration loadFileConfiguration(JavaPlugin plugin, String fileName) throws FileNotFoundException, IOException, InvalidConfigurationException { File file = new File(plugin.getDataFolder(), fileName); @@ -52,5 +46,5 @@ public class MetricsComponent extends Component{ config.load(file); return config; - } + }*/ } diff --git a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java index 49d6bc2..0722cad 100644 --- a/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/commands/GetLoginMetrics.java @@ -23,5 +23,9 @@ public class GetLoginMetrics extends ModCommand{ } return true; } + @Override + public String GetCommandPath(){ + return "getLoginMetrics"; + } }