From 16d647ddf64e64e0bac0dc18bd3201f298e8d3be Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Mon, 1 Jan 2018 08:27:51 -0500 Subject: [PATCH] Edited plugin.yml, made some changes --- plugin.yml | 4 +++- .../research/questions/PluginFilePath.java | 22 +++++++++++-------- target/classes/plugin.yml | 4 +++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/plugin.yml b/plugin.yml index 49a3468..106b62a 100644 --- a/plugin.yml +++ b/plugin.yml @@ -10,4 +10,6 @@ commands: spawn: description: A set of commands designed to be used in spawn magic: - description: A set of fun commands designed for cheaty stuff \ No newline at end of file + description: A set of fun commands designed for cheaty stuff + research: + description: A set of commands designed for R and D \ No newline at end of file diff --git a/src/main/java/buttondevteam/presents/components/research/questions/PluginFilePath.java b/src/main/java/buttondevteam/presents/components/research/questions/PluginFilePath.java index 63b10dd..9f49fb1 100644 --- a/src/main/java/buttondevteam/presents/components/research/questions/PluginFilePath.java +++ b/src/main/java/buttondevteam/presents/components/research/questions/PluginFilePath.java @@ -30,7 +30,9 @@ public class PluginFilePath extends Question { player.sendMessage("---Plugin's Data Folder Information---"); File dataFolder = this.getPlugin().getDataFolder(); - if (dataFolder.exists()){ + if (dataFolder == null) player.sendMessage("Data Folder is null"); + else if (!dataFolder.exists()) player.sendMessage("Data Folder does not exist"); + else{ player.sendMessage("Absolute path: "); player.sendMessage(dataFolder.getAbsolutePath()); @@ -38,32 +40,34 @@ public class PluginFilePath extends Question { try { player.sendMessage(dataFolder.getCanonicalPath()); } catch (IOException e) { - player.sendMessage("I/O Exception!"); + player.sendMessage("I/O Exception when getting Canonical Path!"); player.sendMessage(e.getMessage()); e.printStackTrace(); + } catch (SecurityException e){ + player.sendMessage("Security exception when getting Canonical Path!"); + player.sendMessage(e.getMessage()); + e.printStackTrace(); } - }else{ //!dataFolder.exists() - player.sendMessage("Data Folder does not exist"); } player.sendMessage("---Plugin's Config Information---"); FileConfiguration config = this.getPlugin().getConfig(); player.sendMessage("Name:"); - player.sendMessage(config.getName()); + player.sendMessage(" - " + config.getName()); player.sendMessage("Current Path:"); - config.getCurrentPath(); + player.sendMessage(" - " + config.getCurrentPath()); player.sendMessage("Name of Root:"); - player.sendMessage(config.getRoot().getName()); + player.sendMessage(" - " + config.getRoot().getName()); player.sendMessage("Path of Root:"); - player.sendMessage(config.getRoot().getCurrentPath()); + player.sendMessage(" - " + config.getRoot().getCurrentPath()); player.sendMessage("Keys of Root (Deep = true)"); - player.sendMessage(config.getRoot().getKeys(true).toString()); + player.sendMessage(" - " + config.getRoot().getKeys(true).toString()); player.sendMessage("[A]:" + this.answer()); return false; diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml index 49a3468..106b62a 100644 --- a/target/classes/plugin.yml +++ b/target/classes/plugin.yml @@ -10,4 +10,6 @@ commands: spawn: description: A set of commands designed to be used in spawn magic: - description: A set of fun commands designed for cheaty stuff \ No newline at end of file + description: A set of fun commands designed for cheaty stuff + research: + description: A set of commands designed for R and D \ No newline at end of file