aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/brysonsteck/Resurrection/commands')
-rw-r--r--src/net/brysonsteck/Resurrection/commands/CommandAbout.java34
-rw-r--r--src/net/brysonsteck/Resurrection/commands/CommandBug.java2
-rw-r--r--src/net/brysonsteck/Resurrection/commands/CommandHowLong.java10
-rw-r--r--src/net/brysonsteck/Resurrection/commands/CommandResurrect.java14
-rw-r--r--src/net/brysonsteck/Resurrection/commands/CommandSource.java32
5 files changed, 63 insertions, 29 deletions
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandAbout.java b/src/net/brysonsteck/Resurrection/commands/CommandAbout.java
index a474f6c..47d45c8 100644
--- a/src/net/brysonsteck/Resurrection/commands/CommandAbout.java
+++ b/src/net/brysonsteck/Resurrection/commands/CommandAbout.java
@@ -17,29 +17,33 @@ public class CommandAbout implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
- String aboutMessage = ChatColor.GREEN + "" + ChatColor.BOLD + "Resurrection\n\n" + ChatColor.RESET +
- "Resurrection is a Spigot Minecraft plugin that forces players to wait 24 hours before respawning.\n" +
- "The current version of this plugin is " + currentVersion + ".\n\n" +
- "This plugin is licensed under the GNU Affero General Public License v3.0. Read more here: " +
- "For more information on this plugin or to download it for yourself, visit the GitHub repository at https://github.com/brysonsteck/resurrection" +
- "\u00a9 2021 Bryson Steck.";
+
if (commandSender instanceof Player) {
Player p = (Player) commandSender;
- p.sendMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "Resurrection" + ChatColor.RESET);
- p.sendMessage("");
- p.sendMessage(ChatColor.YELLOW + "Resurrection is a Spigot Minecraft plugin that forces players to wait 24 hours before respawning.");
+ 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.");
- p.sendMessage("");
if (outdated) {
- p.sendMessage(ChatColor.RED + "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("");
+ 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.");
}
+ 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 https://github.com/brysonsteck/resurrection");
p.sendMessage(ChatColor.YELLOW + "\u00a9 2021 Bryson Steck");
- p.sendMessage(ChatColor.YELLOW + "This plugin is licensed under the GNU Affero General Public License v3.0. Read more here: https://www.gnu.org/licenses/agpl-3.0.en.html");
- p.sendMessage(ChatColor.YELLOW + "For more information on this plugin or to download it for yourself, visit the GitHub repository at https://github.com/brysonsteck/resurrection");
} else {
- System.out.println(aboutMessage);
+ 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.");
+ if (outdated) {
+ System.out.println("[Resurrection] 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] \u00a9 2021 Bryson Steck");
+
}
return true;
}
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandBug.java b/src/net/brysonsteck/Resurrection/commands/CommandBug.java
index 2c6b2f4..f6607c3 100644
--- a/src/net/brysonsteck/Resurrection/commands/CommandBug.java
+++ b/src/net/brysonsteck/Resurrection/commands/CommandBug.java
@@ -21,7 +21,7 @@ public class CommandBug implements CommandExecutor {
commandSender.sendMessage("");
commandSender.sendMessage(ChatColor.YELLOW + "Okay, fine. Maybe I'll tell you how to fix the problem. Hehe.");
commandSender.sendMessage(ChatColor.YELLOW + "You can either create an issue on GitHub here: " + ChatColor.BLUE + "https://github.com/brysonsteck/resurrection/issues");
- commandSender.sendMessage(ChatColor.YELLOW + "OR you can fill out this Google Form if you don't know how to use GitHub: " + ChatColor.GREEN + "https://forms.gle/3gLmhMXowNyqKUGdA");
+ commandSender.sendMessage(ChatColor.YELLOW + "OR you can fill out this Google Form if you don't know how to use GitHub: " + ChatColor.BLUE + "https://forms.gle/3gLmhMXowNyqKUGdA");
commandSender.sendMessage(ChatColor.YELLOW + "Please prepare to explain how the bug occurred regardless of how you report the bug to me.");
}
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), 60);
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java b/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java
index 012d23e..9569c27 100644
--- a/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java
+++ b/src/net/brysonsteck/Resurrection/commands/CommandHowLong.java
@@ -48,22 +48,22 @@ public class CommandHowLong implements CommandExecutor {
TimeCheck timeCheck = new TimeCheck(resurrectionTime - currentTime);
if (self) {
- commandSender.sendMessage("You will respawn in " + timeCheck.formatTime('f'));
+ commandSender.sendMessage(ChatColor.YELLOW + "You will respawn in " + timeCheck.formatTime('f'));
} else {
- commandSender.sendMessage(p.getDisplayName() + " will respawn in " + timeCheck.formatTime('f'));
+ commandSender.sendMessage(ChatColor.YELLOW + p.getDisplayName() + " will respawn in " + timeCheck.formatTime('f'));
}
return true;
} else {
if (self) {
- commandSender.sendMessage("You aren't dead, dummy.");
+ commandSender.sendMessage(ChatColor.RED + "ERROR: You aren't dead, dummy.");
} else {
- commandSender.sendMessage("ERROR: " + p.getDisplayName() + " is not dead!");
+ commandSender.sendMessage(ChatColor.RED + "ERROR: " + p.getDisplayName() + " is not dead!");
}
return false;
}
}
}
- commandSender.sendMessage("ERROR: An error has occurred while trying to get time information. This is a bug in the program and not your fault.");
+ commandSender.sendMessage(ChatColor.RED + "ERROR: An error has occurred while trying to get time information. This is a bug in the program and not your fault.");
return false;
}
} else {
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java b/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java
index b573349..45ed156 100644
--- a/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java
+++ b/src/net/brysonsteck/Resurrection/commands/CommandResurrect.java
@@ -21,7 +21,7 @@ public class CommandResurrect implements CommandExecutor {
if (valid) {
Player resurrectPlayer = Bukkit.getPlayer(strings[0]);
if (resurrectPlayer == null) {
- p.sendMessage(ChatColor.RED + "That player does not exist! Failed to resurrect.");
+ p.sendMessage(ChatColor.RED + "ERROR: That player is not online/doesn't exist! Failed to resurrect.");
return false;
}
if (resurrectPlayer.getGameMode() == GameMode.SPECTATOR) {
@@ -38,19 +38,18 @@ public class CommandResurrect implements CommandExecutor {
}
return true;
} else {
- p.sendMessage(ChatColor.RED + strings[0] + " is not dead! Failed to resurrect.");
+ p.sendMessage(ChatColor.RED + "ERROR: " + strings[0] + " is not dead! Failed to resurrect.");
return false;
}
} else {
- System.out.println(ChatColor.RED + "Too few arguments!");
- System.out.println(ChatColor.RED + "Usage: /resurrect PLAYER");
+ System.out.println(ChatColor.RED + "ERROR: Too few arguments!");
return false;
}
} else {
if (valid) {
Player resurrectPlayer = Bukkit.getPlayer(strings[0]);
if (resurrectPlayer == null) {
- System.out.println("That player does not exist! Failed to resurrect.");
+ System.out.println("[Resurrection] That player is not online/doesn't exist! Failed to resurrect.");
return false;
}
if (resurrectPlayer.getGameMode() == GameMode.SPECTATOR) {
@@ -67,12 +66,11 @@ public class CommandResurrect implements CommandExecutor {
}
return true;
} else {
- System.out.println(strings[0] + " is not dead! Failed to resurrect.");
+ System.out.println("[Resurrection] " + strings[0] + " is not dead! Failed to resurrect.");
return false;
}
} else {
- System.out.println("Too few arguments!");
- System.out.println("Usage: /resurrect PLAYER");
+ System.out.println("[Resurrection] ERROR: Too few arguments!");
return false;
}
}
diff --git a/src/net/brysonsteck/Resurrection/commands/CommandSource.java b/src/net/brysonsteck/Resurrection/commands/CommandSource.java
new file mode 100644
index 0000000..c36fbf2
--- /dev/null
+++ b/src/net/brysonsteck/Resurrection/commands/CommandSource.java
@@ -0,0 +1,32 @@
+package net.brysonsteck.Resurrection.commands;
+
+import net.brysonsteck.Resurrection.Resurrection;
+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 org.bukkit.scheduler.BukkitRunnable;
+
+public class CommandSource implements CommandExecutor {
+
+ @Override
+ public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
+ if (commandSender instanceof Player) {
+ commandSender.sendMessage(ChatColor.AQUA + "Resurrection is FREE AND OPEN SOURCE under the");
+ commandSender.sendMessage(ChatColor.AQUA + "GNU Affero General Public License v3.0 via GitHub.");
+ commandSender.sendMessage(ChatColor.AQUA + "You can view the repository at https://github.com/brysonsteck/resurrection");
+ commandSender.sendMessage(ChatColor.AQUA + "and the license at https://github.com/brysonsteck/resurrection/blob/master/LICENSE");
+
+ return true;
+ } else {
+ System.out.println("[Resurrection] Resurrection is FREE AND OPEN SOURCE under the");
+ System.out.println("[Resurrection] GNU Affero General Public License v3.0 via GitHub.");
+ System.out.println("[Resurrection] You can view the repository at https://github.com/brysonsteck/resurrection");
+ System.out.println("[Resurrection] and the license at https://github.com/brysonsteck/resurrection/blob/master/LICENSE");
+
+ return true;
+ }
+ }
+}