diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2021-09-13 15:31:29 -0600 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2021-09-13 15:31:29 -0600 |
commit | 2a6465534d7d652f1adb694c9e688ad3ce87fa11 (patch) | |
tree | a322e344102566ea0ad5bcaafdf744b69e532f66 /src | |
parent | ddb4587eb810e4af760068666353dff7a9962352 (diff) | |
download | resurrection-2a6465534d7d652f1adb694c9e688ad3ce87fa11.tar resurrection-2a6465534d7d652f1adb694c9e688ad3ce87fa11.tar.gz resurrection-2a6465534d7d652f1adb694c9e688ad3ce87fa11.tar.bz2 |
found parsesettings bug
Diffstat (limited to 'src')
-rw-r--r-- | src/net/brysonsteck/Resurrection/Resurrection.java | 23 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandAbout.java | 2 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandBug.java | 3 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandHowLong.java | 3 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandResurrect.java | 3 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandSource.java | 5 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/player/PlayerListener.java | 3 | ||||
-rw-r--r-- | src/net/brysonsteck/Resurrection/startup/ParseSettings.java (renamed from src/net/brysonsteck/Resurrection/ParseSettings.java) | 4 |
8 files changed, 33 insertions, 13 deletions
diff --git a/src/net/brysonsteck/Resurrection/Resurrection.java b/src/net/brysonsteck/Resurrection/Resurrection.java index e8aed53..a4a70a4 100644 --- a/src/net/brysonsteck/Resurrection/Resurrection.java +++ b/src/net/brysonsteck/Resurrection/Resurrection.java @@ -2,9 +2,8 @@ package net.brysonsteck.Resurrection; import net.brysonsteck.Resurrection.commands.*; import net.brysonsteck.Resurrection.player.PlayerListener; -import net.brysonsteck.Resurrection.player.TimeCheck; import net.brysonsteck.Resurrection.startup.CheckForUpdate; -import org.bukkit.Bukkit; +import net.brysonsteck.Resurrection.startup.ParseSettings; import org.bukkit.event.Listener; import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.java.JavaPlugin; @@ -66,6 +65,8 @@ public class Resurrection extends JavaPlugin implements Listener { System.out.println("[Resurrection] ---------------------------------------------------------"); + ParseSettings parseSettings = null; + System.out.println("[Resurrection] Locating player data and settings files..."); // check if playerData.resurrection exists File playerFile = new File("plugins/playerData.resurrection"); @@ -85,7 +86,7 @@ public class Resurrection extends JavaPlugin implements Listener { } if (!settingsFile.exists()) { System.out.println("[Resurrection] Settings file does not exist. (This file is new with the 0.2 beta if you upgraded.) Creating now in the \"plugins\" directory..."); - ParseSettings parseSettings = new ParseSettings(); + parseSettings = new ParseSettings(); System.out.println("[Resurrection] Settings file created successfully."); } else { System.out.println("[Resurrection] The settings file has also been found!"); @@ -98,11 +99,11 @@ public class Resurrection extends JavaPlugin implements Listener { this.getServer().getPluginManager().registerEvents(new PlayerListener(), this); // register commands - this.getCommand("about").setExecutor(new CommandAbout(pluginInfo.getVersion(), outdated)); - this.getCommand("bug").setExecutor(new CommandBug()); - this.getCommand("resurrect").setExecutor(new CommandResurrect()); - this.getCommand("howlong").setExecutor(new CommandHowLong()); - this.getCommand("source").setExecutor(new CommandSource()); + this.getCommand("about").setExecutor(new CommandAbout(parseSettings.getSetting("debug"), pluginInfo.getVersion(), outdated)); + this.getCommand("bug").setExecutor(new CommandBug(parseSettings.getSetting("debug"))); + this.getCommand("resurrect").setExecutor(new CommandResurrect(parseSettings.getSetting("debug"))); + this.getCommand("howlong").setExecutor(new CommandHowLong(parseSettings.getSetting("debug"))); + this.getCommand("source").setExecutor(new CommandSource(parseSettings.getSetting("debug"))); System.out.println("[Resurrection] ---------------------------------------------------------"); System.out.println("[Resurrection] Successfully Started!"); @@ -112,6 +113,12 @@ public class Resurrection extends JavaPlugin implements Listener { public static void main(String[] args) { +// String test = "fals"; +// +// if (!test.toLowerCase().contains("true") && !test.toLowerCase().contains("false")) { +// System.out.println("fail"); +// } + // DO THIS // PlayerData playerData = new PlayerData(); // System.out.println("--- Reading Player data file ---"); diff --git a/src/net/brysonsteck/Resurrection/commands/CommandAbout.java b/src/net/brysonsteck/Resurrection/commands/CommandAbout.java index 3d16878..272b4d0 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandAbout.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandAbout.java @@ -10,7 +10,7 @@ public class CommandAbout implements CommandExecutor { String currentVersion; boolean outdated; - public CommandAbout(String currentVersion, boolean outdated) { + public CommandAbout(String debug, String currentVersion, boolean outdated) { this.currentVersion = currentVersion; this.outdated = outdated; } diff --git a/src/net/brysonsteck/Resurrection/commands/CommandBug.java b/src/net/brysonsteck/Resurrection/commands/CommandBug.java index 894fcbc..75ed5cf 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandBug.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandBug.java @@ -11,6 +11,9 @@ import org.bukkit.scheduler.BukkitRunnable; public class CommandBug implements CommandExecutor { + public CommandBug(String debug) { + } + @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { if (commandSender instanceof Player) { diff --git a/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java b/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java index f36987a..29314d7 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java @@ -11,6 +11,9 @@ import org.bukkit.entity.Player; public class CommandHowLong implements CommandExecutor { + public CommandHowLong(String debug) { + } + @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { if (commandSender instanceof Player) { diff --git a/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java b/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java index 106cb71..9f97c29 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java @@ -12,6 +12,9 @@ import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; public class CommandResurrect implements CommandExecutor { + public CommandResurrect(String debug) { + } + @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { boolean valid = (strings.length == 1); diff --git a/src/net/brysonsteck/Resurrection/commands/CommandSource.java b/src/net/brysonsteck/Resurrection/commands/CommandSource.java index ecab174..92e51c6 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandSource.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandSource.java @@ -10,6 +10,11 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.scheduler.BukkitRunnable; public class CommandSource implements CommandExecutor { + boolean debug; + + public CommandSource(String debug) { + this.debug = Boolean.parseBoolean(debug); + } @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { diff --git a/src/net/brysonsteck/Resurrection/player/PlayerListener.java b/src/net/brysonsteck/Resurrection/player/PlayerListener.java index c94e8f5..c54fcf0 100644 --- a/src/net/brysonsteck/Resurrection/player/PlayerListener.java +++ b/src/net/brysonsteck/Resurrection/player/PlayerListener.java @@ -1,9 +1,8 @@ package net.brysonsteck.Resurrection.player; -import net.brysonsteck.Resurrection.ParseSettings; +import net.brysonsteck.Resurrection.startup.ParseSettings; import net.brysonsteck.Resurrection.Resurrection; import org.bukkit.*; -import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; diff --git a/src/net/brysonsteck/Resurrection/ParseSettings.java b/src/net/brysonsteck/Resurrection/startup/ParseSettings.java index 6de7269..de0bb5d 100644 --- a/src/net/brysonsteck/Resurrection/ParseSettings.java +++ b/src/net/brysonsteck/Resurrection/startup/ParseSettings.java @@ -1,4 +1,4 @@ -package net.brysonsteck.Resurrection; +package net.brysonsteck.Resurrection.startup; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; @@ -91,7 +91,7 @@ public class ParseSettings { failedSetting = "debug"; return false; } - if (settings.get("debug").toLowerCase().contains("true") && settings.get("debug").toLowerCase().contains("false")) { + if (!settings.get("debug").toLowerCase().contains("true") && !settings.get("debug").toLowerCase().contains("false")) { failedSetting = "debug"; return false; } |