From 630d8ee23e24fa2974d18f147a7e7c56f302de73 Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 25 Nov 2016 19:23:34 -0500 Subject: [PATCH] Saved Player Metrics to .txt file --- metrics/playerLogins.txt | 1 + pom.xml | 174 +++++++++--------- .../flairdoor/FlairDoorComponent.java | 54 +++--- .../PlayerProximityTaskLauncher.java | 12 -- .../PlayerProximityLoop.java} | 8 +- .../SetProximityLocation.java | 2 +- .../components/gpowers/GPowerComponent.java | 4 +- .../{Enchanter.java => EnchantingLoop.java} | 150 +++++++-------- .../components/metrics/MetricsComponent.java | 41 +---- .../collection/PlayerJoinListener.java | 24 +-- .../components/metrics/files/MetricsFile.java | 50 +++++ .../metrics/output/GetLoginMetrics.java | 5 +- 12 files changed, 267 insertions(+), 258 deletions(-) create mode 100644 metrics/playerLogins.txt delete mode 100644 src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java rename src/alisolarflare/components/flairdoor/{playerproximity/PlayerProximityTask.java => proximitydetector/PlayerProximityLoop.java} (84%) rename src/alisolarflare/components/flairdoor/{playerproximity => proximitydetector}/SetProximityLocation.java (94%) rename src/alisolarflare/components/gpowers/enchant/{Enchanter.java => EnchantingLoop.java} (94%) create mode 100644 src/alisolarflare/components/metrics/files/MetricsFile.java diff --git a/metrics/playerLogins.txt b/metrics/playerLogins.txt new file mode 100644 index 0000000..b710586 --- /dev/null +++ b/metrics/playerLogins.txt @@ -0,0 +1 @@ +Login List: diff --git a/pom.xml b/pom.xml index e753309..b182c38 100644 --- a/pom.xml +++ b/pom.xml @@ -1,82 +1,92 @@ - - 4.0.0 - com.github.tbmcplugins - AliPresents - 0.0.1-SNAPSHOT - AliPresents - A bucket of aaall the stuff Ali makes. It's a bit smelly. - - src - - - src - - **/*.java - - - - . - - *.yml - - - - - - maven-compiler-plugin - 3.3 - - 1.8 - 1.8 - - - - - - UTF-8 - - - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - jcenter - http://jcenter.bintray.com - - - jitpack.io - https://jitpack.io - - - ess-repo - http://repo.ess3.net/content/groups/essentials - - - - - - org.spigotmc - spigot-api - 1.11-R0.1-SNAPSHOT - - - - org.apache.commons - commons-lang3 - 3.4 - - - com.github.TBMCPlugins.ButtonCore - ButtonCore - master-SNAPSHOT - - - net.ess3 - Essentials - 2.13.1 - - - + + 4.0.0 + com.github.tbmcplugins + AliPresents + 0.0.1-SNAPSHOT + AliPresents + A bucket of aaall the stuff Ali makes. It's a bit smelly. + + src + + + src + + **/*.java + + + + . + + *.yml + + + + + + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + + + UTF-8 + + + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + jcenter + http://jcenter.bintray.com + + + jitpack.io + https://jitpack.io + + + ess-repo + http://repo.ess3.net/content/groups/essentials + + + + + + org.spigotmc + spigot-api + 1.11-R0.1-SNAPSHOT + + + + org.apache.commons + commons-lang3 + 3.4 + + + com.github.TBMCPlugins.ButtonCore + ButtonCore + master-SNAPSHOT + + + net.ess3 + Essentials + 2.13.1 + + + org.apache.logging.log4j + log4j-api + 2.7 + + + org.apache.logging.log4j + log4j-core + 2.7 + + + diff --git a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java index 9b2901c..b7886f6 100644 --- a/src/alisolarflare/components/flairdoor/FlairDoorComponent.java +++ b/src/alisolarflare/components/flairdoor/FlairDoorComponent.java @@ -1,27 +1,27 @@ -package alisolarflare.components.flairdoor; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.architecture.Component; -import alisolarflare.components.flairdoor.flairme.FlairMe; -import alisolarflare.components.flairdoor.listeners.PortalListener; -import alisolarflare.components.flairdoor.playerproximity.PlayerProximityTaskLauncher; -import alisolarflare.components.flairdoor.playerproximity.SetProximityLocation; - -public class FlairDoorComponent extends Component { - public List playersToBeFlaired = new ArrayList(); - public Location startLocation = null; - public Location endLocation = null; - @Override - public void register(JavaPlugin plugin) { - registerCommand(plugin, new FlairMe(this)); - registerCommand(plugin, new SetProximityLocation(this)); - registerListener(plugin, new PortalListener(plugin, this)); - registerListener(plugin, new PlayerProximityTaskLauncher(plugin, this)); - } -} +package alisolarflare.components.flairdoor; + +import java.util.ArrayList; +import java.util.List; + +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; + +import alisolarflare.architecture.Component; +import alisolarflare.components.flairdoor.flairme.FlairMe; +import alisolarflare.components.flairdoor.listeners.PortalListener; +import alisolarflare.components.flairdoor.proximitydetector.PlayerProximityLoop; +import alisolarflare.components.flairdoor.proximitydetector.SetProximityLocation; + +public class FlairDoorComponent extends Component { + public List playersToBeFlaired = new ArrayList(); + public Location startLocation = null; + public Location endLocation = null; + @Override + public void register(JavaPlugin plugin) { + registerCommand(plugin, new FlairMe(this)); + registerCommand(plugin, new SetProximityLocation(this)); + registerListener(plugin, new PortalListener(plugin, this)); + registerListener(plugin, new PlayerProximityLoop(plugin, this)); + } +} diff --git a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java b/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java deleted file mode 100644 index 2a4edd7..0000000 --- a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTaskLauncher.java +++ /dev/null @@ -1,12 +0,0 @@ -package alisolarflare.components.flairdoor.playerproximity; - -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; - -import alisolarflare.components.flairdoor.FlairDoorComponent; - -public class PlayerProximityTaskLauncher implements Listener{ - public PlayerProximityTaskLauncher(JavaPlugin plugin, FlairDoorComponent component){ - new PlayerProximityTask(plugin, component).runTaskTimer(plugin, 0, 20); - } -} diff --git a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java similarity index 84% rename from src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java rename to src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java index 864aa0f..b8a3a8a 100644 --- a/src/alisolarflare/components/flairdoor/playerproximity/PlayerProximityTask.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/PlayerProximityLoop.java @@ -1,23 +1,25 @@ -package alisolarflare.components.flairdoor.playerproximity; +package alisolarflare.components.flairdoor.proximitydetector; import org.bukkit.Location; import org.bukkit.entity.Player; +import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; import alisolarflare.components.flairdoor.FlairDoorComponent; -public class PlayerProximityTask extends BukkitRunnable{ +public class PlayerProximityLoop extends BukkitRunnable implements Listener{ private JavaPlugin plugin; private FlairDoorComponent component; private Location startLocation; private Location endLocation; - public PlayerProximityTask(JavaPlugin plugin, FlairDoorComponent component) { + public PlayerProximityLoop(JavaPlugin plugin, FlairDoorComponent component) { this.plugin = plugin; this.component = component; this.startLocation = component.startLocation; this.endLocation = component.endLocation; + this.runTaskTimer(plugin, 0, 20); } @Override diff --git a/src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java b/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java similarity index 94% rename from src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java rename to src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java index 41a3704..f19ce48 100644 --- a/src/alisolarflare/components/flairdoor/playerproximity/SetProximityLocation.java +++ b/src/alisolarflare/components/flairdoor/proximitydetector/SetProximityLocation.java @@ -1,4 +1,4 @@ -package alisolarflare.components.flairdoor.playerproximity; +package alisolarflare.components.flairdoor.proximitydetector; import org.bukkit.entity.Player; diff --git a/src/alisolarflare/components/gpowers/GPowerComponent.java b/src/alisolarflare/components/gpowers/GPowerComponent.java index 51aae3e..978c30b 100644 --- a/src/alisolarflare/components/gpowers/GPowerComponent.java +++ b/src/alisolarflare/components/gpowers/GPowerComponent.java @@ -4,7 +4,7 @@ import org.bukkit.plugin.java.JavaPlugin; import alisolarflare.architecture.Component; import alisolarflare.components.gpowers.commands.GPower; -import alisolarflare.components.gpowers.enchant.Enchanter; +import alisolarflare.components.gpowers.enchant.EnchantingLoop; import alisolarflare.components.gpowers.powerstate.PowerDown; import alisolarflare.components.gpowers.powerstate.PowerUp; @@ -17,7 +17,7 @@ public class GPowerComponent extends Component { registerCommand(plugin, new PowerUp(gPowerMemory)); registerCommand(plugin, new PowerDown(gPowerMemory)); - registerListener(plugin, new Enchanter(plugin, gPowerMemory)); + registerListener(plugin, new EnchantingLoop(plugin, gPowerMemory)); } diff --git a/src/alisolarflare/components/gpowers/enchant/Enchanter.java b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java similarity index 94% rename from src/alisolarflare/components/gpowers/enchant/Enchanter.java rename to src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java index 9f68877..2f22b0f 100644 --- a/src/alisolarflare/components/gpowers/enchant/Enchanter.java +++ b/src/alisolarflare/components/gpowers/enchant/EnchantingLoop.java @@ -1,75 +1,75 @@ -package alisolarflare.components.gpowers.enchant; - -import java.util.Map; -import java.util.UUID; - -import org.bukkit.Color; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import alisolarflare.components.gpowers.GPowerMemory; -import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; - -public class Enchanter extends BukkitRunnable implements Listener{ - private int powerLength = 300; - private Server server; - private Map poweredPlayerList; - - - public Enchanter(JavaPlugin plugin, GPowerMemory gPowerMemory){ - this.server = plugin.getServer(); - this.poweredPlayerList = gPowerMemory.poweredPlayerList; - this.runTaskTimer(plugin, 0, 190); - } - - //REPEATS EVERY 5 SECONDS - @Override - public void run() { - //server.broadcastMessage("ping!"); - for (Player player : server.getOnlinePlayers()){ - if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ - activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); - } - } - } - - private void activatePower(Player player, String colour) { - //GREY - for (PotionEffect potionEffect : player.getActivePotionEffects()){ - player.removePotionEffect(potionEffect.getType()); - } - if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); - //RED - }else if (colour.startsWith("r")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); - //ORANGE - }else if (colour.startsWith("o")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); - //YELLOW - }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ - player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); - //GREEN - }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); - //BLUE - }else if (colour.startsWith("b")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); - player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); - //PURPLE - }else if (colour.startsWith("p")){ - player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); - //NULL - }else{ - } - } - -} +package alisolarflare.components.gpowers.enchant; + +import java.util.Map; +import java.util.UUID; + +import org.bukkit.Color; +import org.bukkit.Server; +import org.bukkit.entity.Player; +import org.bukkit.event.Listener; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +import alisolarflare.components.gpowers.GPowerMemory; +import alisolarflare.components.gpowers.GPowerMemory.poweredPlayer; + +public class EnchantingLoop extends BukkitRunnable implements Listener{ + private int powerLength = 300; + private Server server; + private Map poweredPlayerList; + + + public EnchantingLoop(JavaPlugin plugin, GPowerMemory gPowerMemory){ + this.server = plugin.getServer(); + this.poweredPlayerList = gPowerMemory.poweredPlayerList; + this.runTaskTimer(plugin, 0, 190); + } + + //REPEATS EVERY 5 SECONDS + @Override + public void run() { + //server.broadcastMessage("ping!"); + for (Player player : server.getOnlinePlayers()){ + if(poweredPlayerList.containsKey(player.getUniqueId()) && poweredPlayerList.get(player.getUniqueId()).isPowersActive){ + activatePower(player, poweredPlayerList.get(player.getUniqueId()).colour); + } + } + } + + private void activatePower(Player player, String colour) { + //GREY + for (PotionEffect potionEffect : player.getActivePotionEffects()){ + player.removePotionEffect(potionEffect.getType()); + } + if ((colour.startsWith("grey") || colour.startsWith("gra")) && (player.getWorld().getTime() > 12575 && player.getWorld().getTime() < 22925)){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.GRAY), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, powerLength+100, 0, true, false, Color.GRAY), true); + //RED + }else if (colour.startsWith("r")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, powerLength, 0, true, false, Color.RED), true); + //ORANGE + }else if (colour.startsWith("o")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, powerLength, 0, true, false, Color.ORANGE), true); + //YELLOW + }else if (colour.startsWith("y") && player.getLocation().getBlock().getLightFromSky() == 15 && player.getLocation().getBlock().getLightFromBlocks() == 15){ + player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, powerLength, 0, true, false, Color.YELLOW), true); + //GREEN + }else if (colour.startsWith("g") && !colour.startsWith("gra") && !colour.startsWith("grey")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.LUCK, powerLength, 1, true, false, Color.GREEN), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, powerLength, 0, true, false, Color.GREEN), true); + //BLUE + }else if (colour.startsWith("b")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, powerLength, 1, true, false, Color.BLUE), true); + player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, powerLength, 0, true, false, Color.BLUE), true); + //PURPLE + }else if (colour.startsWith("p")){ + player.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, powerLength, 0, true, false, Color.PURPLE), true); + //NULL + }else{ + } + } + +} diff --git a/src/alisolarflare/components/metrics/MetricsComponent.java b/src/alisolarflare/components/metrics/MetricsComponent.java index 2706f66..3bb855f 100644 --- a/src/alisolarflare/components/metrics/MetricsComponent.java +++ b/src/alisolarflare/components/metrics/MetricsComponent.java @@ -1,54 +1,29 @@ 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.architecture.Component; import alisolarflare.components.metrics.collection.PlayerJoinListener; +import alisolarflare.components.metrics.files.MetricsFile; import alisolarflare.components.metrics.output.GetLoginMetrics; -import buttondevteam.lib.TBMCCoreAPI; public class MetricsComponent extends Component{ - - public FileConfiguration metricsYml; // DATA - STRING + String defaultPath = "metrics"; + String defaultFilePath = (defaultPath + "/metrics.txt"); + String playerLoginsFilePath = (defaultPath + "/playerLogins.txt"); + + public MetricsFile playerLoginsFile; // DATA - STRING public List metricsList; @Override public void register(JavaPlugin plugin){ + playerLoginsFile = new MetricsFile(playerLoginsFilePath); registerCommand(plugin, new GetLoginMetrics(this)); - registerListener(plugin, new PlayerJoinListener(this)); + registerListener(plugin, new PlayerJoinListener(this, playerLoginsFile)); 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); - - if (!file.exists()) { - file.getParentFile().mkdirs(); - plugin.saveResource(fileName, false); - } - - FileConfiguration config = new YamlConfiguration(); - - config.load(file); - - return config; } } diff --git a/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java b/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java index 7744389..d997d32 100644 --- a/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java +++ b/src/alisolarflare/components/metrics/collection/PlayerJoinListener.java @@ -5,33 +5,19 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import alisolarflare.components.metrics.MetricsComponent; -import buttondevteam.lib.DebugPotato; +import alisolarflare.components.metrics.files.MetricsFile; public class PlayerJoinListener implements Listener{ private MetricsComponent module; - public PlayerJoinListener(MetricsComponent module){ + private MetricsFile playerLoginsFile; + public PlayerJoinListener(MetricsComponent module, MetricsFile playerLoginsFile){ this.module = module; + this.playerLoginsFile = playerLoginsFile; } @EventHandler public void onPlayerJoin(PlayerJoinEvent event){ - try{ - module.saveData(module.metricsYml, "loginlog."+System.currentTimeMillis()+event.getPlayer().getName(), event.getPlayer().getName()); - }catch(NullPointerException e){ - try{ - DebugPotato potato = new DebugPotato(); - potato.setMessage(new String[]{ - "Module: "+ module.toString(), - "Time: " + System.currentTimeMillis(), - "MetricsYML: " + module.metricsYml.toString() - }); - potato.Send(event.getPlayer()); - }catch (Exception ex){ - DebugPotato potato = new DebugPotato(); - potato.setMessage("Something went REALLLY wrong"); - potato.Send(event.getPlayer()); - } - } + playerLoginsFile.AddLine("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); module.metricsList.add("loginlog."+System.currentTimeMillis()+event.getPlayer().getName()); } diff --git a/src/alisolarflare/components/metrics/files/MetricsFile.java b/src/alisolarflare/components/metrics/files/MetricsFile.java new file mode 100644 index 0000000..bc55b13 --- /dev/null +++ b/src/alisolarflare/components/metrics/files/MetricsFile.java @@ -0,0 +1,50 @@ +package alisolarflare.components.metrics.files; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import buttondevteam.lib.TBMCCoreAPI; + +public class MetricsFile { + private String fileName = "metrics/playerLogins.txt"; + public MetricsFile(String directory){ + this.fileName = directory; + } + public void AddLine(String string){ + BufferedWriter outputStream = null; + try { + outputStream = new BufferedWriter(new FileWriter(fileName, true)); + outputStream.write(string); + outputStream.newLine(); + outputStream.close(); + } catch (IOException e) { + TBMCCoreAPI.SendException(fileName +" Output Stream could not be created!", e); + } + } + public List toArrayList(){ + BufferedReader inputStream = null; + try { + inputStream = new BufferedReader(new FileReader(fileName)); + + List outputList = new ArrayList(); + String currentLine; + + while ((currentLine = inputStream.readLine()) != null){ + outputList.add(currentLine); + } + inputStream.close(); + return outputList; + } catch (FileNotFoundException e) { + TBMCCoreAPI.SendException(" could not be found", e); + } catch (IOException e1) { + TBMCCoreAPI.SendException("encountered an I/O Exception!", e1); + } + return new ArrayList(); + } +} diff --git a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java index 045f14a..7fc8f78 100644 --- a/src/alisolarflare/components/metrics/output/GetLoginMetrics.java +++ b/src/alisolarflare/components/metrics/output/GetLoginMetrics.java @@ -15,12 +15,9 @@ public class GetLoginMetrics extends ModCommand{ @Override public boolean OnCommand(Player player, String alias, String[] args) { - for (String metric : module.metricsList){ + for (String metric : module.playerLoginsFile.toArrayList()){ player.sendMessage(metric); } - if (args.length < 1){ - return true; - } return true; } }