2021-08-25 00:23:03 -06:00
|
|
|
package net.brysonsteck.Resurrection.commands;
|
|
|
|
|
|
|
|
import net.brysonsteck.Resurrection.Resurrection;
|
2021-09-13 17:14:31 -06:00
|
|
|
import org.bukkit.Bukkit;
|
2021-08-25 00:23:03 -06:00
|
|
|
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 {
|
2021-09-13 17:14:31 -06:00
|
|
|
boolean DEBUG;
|
2021-09-13 15:31:29 -06:00
|
|
|
|
|
|
|
public CommandSource(String debug) {
|
2021-09-13 17:14:31 -06:00
|
|
|
this.DEBUG = Boolean.parseBoolean(debug);
|
2021-09-13 15:31:29 -06:00
|
|
|
}
|
2021-08-25 00:23:03 -06:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
|
2021-09-13 17:14:31 -06:00
|
|
|
if (DEBUG) {
|
|
|
|
Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + "[Res. DEBUG]: The `/source` command was ran by " + commandSender.getName());
|
|
|
|
}
|
|
|
|
|
2021-08-25 00:23:03 -06:00
|
|
|
if (commandSender instanceof Player) {
|
2021-09-13 17:14:31 -06:00
|
|
|
if (DEBUG) {
|
|
|
|
Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + "[Res. DEBUG]: CommandSender is a player");
|
|
|
|
}
|
2021-08-25 00:34:27 -06:00
|
|
|
commandSender.sendMessage(ChatColor.YELLOW + "Resurrection is FREE AND OPEN SOURCE under the");
|
|
|
|
commandSender.sendMessage(ChatColor.YELLOW + "GNU Affero General Public License v3.0 via GitHub.");
|
|
|
|
commandSender.sendMessage(ChatColor.YELLOW + "You can view the repository at " + ChatColor.AQUA + "https://github.com/brysonsteck/resurrection");
|
|
|
|
commandSender.sendMessage(ChatColor.YELLOW + "and the license at " + ChatColor.AQUA + "https://github.com/brysonsteck/resurrection/blob/master/LICENSE");
|
2021-08-25 00:23:03 -06:00
|
|
|
|
|
|
|
return true;
|
|
|
|
} else {
|
2021-09-13 17:14:31 -06:00
|
|
|
if (DEBUG) {
|
|
|
|
Bukkit.broadcastMessage(ChatColor.YELLOW +""+ ChatColor.BOLD + "[Res. DEBUG]: CommandSender is console");
|
|
|
|
}
|
2021-08-25 00:23:03 -06:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|