2021-07-19 18:43:12 -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-07-19 18:43:12 -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 CommandBug implements CommandExecutor {
2021-09-13 17:14:31 -06:00
boolean DEBUG ;
2021-07-19 18:43:12 -06:00
2021-09-13 15:31:29 -06:00
public CommandBug ( String debug ) {
2021-09-13 17:14:31 -06:00
this . DEBUG = Boolean . parseBoolean ( debug ) ;
2021-09-13 15:31:29 -06:00
}
2021-07-19 18:43:12 -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 `/bug` command was ran by " + commandSender . getName ( ) ) ;
}
2021-07-19 18:43:12 -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-07-19 18:43:12 -06:00
commandSender . sendMessage ( ChatColor . YELLOW + " Did you find a bug? Well that sucks for you. " ) ;
new BukkitRunnable ( ) {
@Override
public void run ( ) {
commandSender . sendMessage ( " " ) ;
commandSender . sendMessage ( ChatColor . YELLOW + " Okay, fine. Maybe I'll tell you how to fix the problem. Hehe. " ) ;
2021-08-25 00:34:27 -06:00
commandSender . sendMessage ( ChatColor . YELLOW + " You can either create an issue on GitHub here: " + ChatColor . AQUA + " 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 . AQUA + " https://forms.gle/3gLmhMXowNyqKUGdA " ) ;
2021-07-19 18:43:12 -06:00
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 ) ;
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-07-19 18:43:12 -06:00
System . out . println ( " [Resurrection] Did you find a bug? Well that sucks for you. " ) ;
new BukkitRunnable ( ) {
@Override
public void run ( ) {
System . out . println ( " [Resurrection] " ) ;
System . out . println ( " [Resurrection] Okay, fine. Maybe I'll tell you how to fix the problem. Hehe. " ) ;
System . out . println ( " [Resurrection] You can either create an issue on GitHub here: https://github.com/brysonsteck/resurrection/issues " ) ;
2021-08-21 12:39:14 -06:00
System . out . println ( " [Resurrection] OR you can fill out this Google Form if you don't know how to use GitHub: https://forms.gle/3gLmhMXowNyqKUGdA " ) ;
2021-07-19 18:43:12 -06:00
System . out . println ( " [Resurrection] Please prepare to explain how the bug occurred regardless of how you report the bug to me. " ) ;
}
} . runTaskLater ( JavaPlugin . getProvidingPlugin ( Resurrection . class ) , 60 ) ;
return true ;
}
}
}