diff options
author | Bryson Steck <steck.bryson@gmail.com> | 2022-01-04 00:36:47 -0700 |
---|---|---|
committer | Bryson Steck <steck.bryson@gmail.com> | 2022-01-04 00:36:47 -0700 |
commit | 7ab8389f0f2c61056fccbe827a105413300c0789 (patch) | |
tree | 2ddd89082c6fe6d8311deaa0e053e2007503c101 /src/net/brysonsteck/Resurrection/commands/CommandResurrect.java | |
parent | 8dcde3ca41f45e899127891dcc64b65a6d432d55 (diff) | |
download | resurrection-7ab8389f0f2c61056fccbe827a105413300c0789.tar resurrection-7ab8389f0f2c61056fccbe827a105413300c0789.tar.gz resurrection-7ab8389f0f2c61056fccbe827a105413300c0789.tar.bz2 |
fixed all System.out calls, added command
Diffstat (limited to 'src/net/brysonsteck/Resurrection/commands/CommandResurrect.java')
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandResurrect.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java b/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java index 3d206c4..a2301b3 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java @@ -1,6 +1,10 @@ package net.brysonsteck.Resurrection.commands; +import net.brysonsteck.Resurrection.Resurrection; import net.brysonsteck.Resurrection.player.PlayerData; + +import java.util.logging.Logger; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; @@ -9,6 +13,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; public class CommandResurrect implements CommandExecutor { @@ -20,6 +25,7 @@ public class CommandResurrect implements CommandExecutor { @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) { + Logger log = JavaPlugin.getProvidingPlugin(Resurrection.class).getLogger(); if (DEBUG) { Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + "[Res. DEBUG]: The `resurrect` command was ran by " + commandSender.getName()); } @@ -72,7 +78,7 @@ public class CommandResurrect implements CommandExecutor { return false; } } else { - System.out.println(ChatColor.RED + "ERROR: Too few arguments!"); + p.sendMessage(ChatColor.RED + "ERROR: Too few arguments!"); return false; } } else { @@ -87,7 +93,7 @@ public class CommandResurrect implements CommandExecutor { Player resurrectPlayer = Bukkit.getPlayer(strings[0]); if (resurrectPlayer == null) { - System.out.println("[Resurrection] ERROR: That player is not online/doesn't exist! Failed to resurrect."); + log.warning("ERROR: That player is not online/doesn't exist! Failed to resurrect."); return false; } if (DEBUG) { @@ -115,11 +121,11 @@ public class CommandResurrect implements CommandExecutor { } return true; } else { - System.out.println("[Resurrection] ERROR: " + strings[0] + " is not dead! Failed to resurrect."); + log.warning("ERROR: " + strings[0] + " is not dead! Failed to resurrect."); return false; } } else { - System.out.println("[Resurrection] ERROR: Too few arguments!"); + log.warning("ERROR: Too few arguments!"); return false; } } |