diff options
Diffstat (limited to 'src/net/brysonsteck/Resurrection/commands/CommandAbout.java')
-rw-r--r-- | src/net/brysonsteck/Resurrection/commands/CommandAbout.java | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandAbout.java b/src/net/brysonsteck/Resurrection/commands/CommandAbout.java index a820432..932c5c6 100644 --- a/src/net/brysonsteck/Resurrection/commands/CommandAbout.java +++ b/src/net/brysonsteck/Resurrection/commands/CommandAbout.java @@ -1,11 +1,16 @@ package net.brysonsteck.Resurrection.commands; +import java.util.logging.Logger; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; 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 net.brysonsteck.Resurrection.Resurrection; public class CommandAbout implements CommandExecutor { boolean DEBUG; @@ -20,6 +25,7 @@ public class CommandAbout 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 `/about` command was ran by " + commandSender.getName()); } @@ -28,13 +34,15 @@ public class CommandAbout implements CommandExecutor { if (DEBUG) { Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + "[Res. DEBUG]: CommandSender is a player."); } + + String outdatedText = ""; Player p = (Player) commandSender; p.sendMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "--- Resurrection ---" + ChatColor.RESET); p.sendMessage(ChatColor.YELLOW + "Resurrection is a Spigot Minecraft plugin that forces players to wait a certain amount of time before respawning."); - p.sendMessage(ChatColor.YELLOW + "This server is running version " + ChatColor.AQUA + currentVersion + ChatColor.YELLOW + " of Resurrection."); if (outdated) { - p.sendMessage(ChatColor.RED + "HOWEVER, A newer version of this plugin is available. Please notify a server admin to update this plugin for new features and/or stability improvements."); + outdatedText = " HOWEVER, A newer version of this plugin is available. Please notify a server admin to update this plugin for new features and/or stability improvements."; } + p.sendMessage(ChatColor.YELLOW + "This server is running version " + ChatColor.AQUA + currentVersion + ChatColor.YELLOW + " of Resurrection." + ChatColor.RED + outdatedText); p.sendMessage("---"); p.sendMessage(ChatColor.YELLOW + "This plugin is licensed under the GNU Affero General Public License v3.0. For more info, run " + ChatColor.AQUA + "/source"); p.sendMessage(ChatColor.YELLOW + "For more info on this plugin or to download it, visit the GitHub repository at " + ChatColor.AQUA + "https://github.com/brysonsteck/resurrection"); @@ -43,18 +51,17 @@ public class CommandAbout implements CommandExecutor { if (DEBUG) { Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + "[Res. DEBUG]: CommandSender is console."); } - System.out.println("[Resurrection] --- Resurrection ---"); - System.out.println("[Resurrection]"); - System.out.println("[Resurrection] Resurrection is a Spigot Minecraft plugin that forces players to wait a certain amount of time before respawning."); - System.out.println("[Resurrection] This server is running version " + currentVersion + " of Resurrection."); + String outdatedText = ""; + log.info("--- Resurrection ---"); + log.info(""); + log.info("Resurrection is a Spigot Minecraft plugin that forces players to wait a certain amount of time before respawning."); if (outdated) { - System.out.println("[Resurrection] HOWEVER, a newer version of Resurrection is available. Please check the updater on startup for more information."); + outdatedText = " HOWEVER, a newer version of Resurrection is available. Please check the updater on startup for more information."; } - System.out.println("[Resurrection]"); - System.out.println("[Resurrection] This plugin is licensed under the GNU Affero General Public License v3.0. For more info, run /source"); - System.out.println("[Resurrection] Since you're the admin, you probably know where to download it lmao. Here's the link anyway: https://github.com/brysonsteck/resurrection"); - System.out.println("[Resurrection] Copyright 2021 Bryson Steck"); - + log.info("This server is running version " + currentVersion + " of Resurrection." + outdatedText); + log.info(""); + log.info("This plugin is licensed under the GNU Affero General Public License v3.0. For more info, run \"/source\". Since you're the admin, you probably know where to download it lmao. Here's the link anyway: https://github.com/brysonsteck/resurrection"); + log.info("Copyright 2021 Bryson Steck"); } return true; } |