Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.bluebird.report;
- import fr.bluebird.report.Report;
- import fr.bluebird.report.Issue;
- import net.md_5.bungee.api.ChatColor;
- import net.md_5.bungee.api.CommandSender;
- import net.md_5.bungee.api.plugin.Command;
- public class IssuesCommand extends Command {
- public IssuesCommand() {
- super("issues");
- }
- @Override
- public void execute(CommandSender sender, String[] args) {
- if(!sender.hasPermission("Report.showall")) {
- if(args.length <= 0) {
- Report.getChat().sendMessage(sender, "Faites: /issues <nombre>");
- Report.getChat().sendMessage(sender, "Toutes les issues:");
- for (Issue issue : Issue.getAllIsuesBy(sender.getName())) {
- Report.getChat().sendMessage(sender, ChatColor.YELLOW + "" + ChatColor.BOLD + issue.getUser() +
- ChatColor.WHITE + " - " + issue.getDescription() + " - " + issue.getStatus().getName());
- }
- } else if(args.length == 1) {
- int i = 0;
- try {
- i = Integer.valueOf(args[0]);
- } catch(Exception e) {
- Report.getChat().sendMessage(sender, "Vous n'avez pas tape de nombre");
- return;
- }
- Issue issue = Issue.getAllIsuesBy(sender.getName()).get(i);
- if(issue == null) {
- Report.getChat().sendMessage(sender, "Le Report n° " + i + " n'existe pas!");
- }
- Report.getChat().sendMessage(sender, "Report n° " + i + ":");
- Report.getChat().sendMessage(sender, "Description: " + issue.getDescription());
- Report.getChat().sendMessage(sender, "Joueur: " + issue.getUser());
- Report.getChat().sendMessage(sender, "Report: " + issue.getReporter());
- Report.getChat().sendMessage(sender, "Status: " + issue.getStatus().getName());
- }
- }
- if(args.length <= 0) {
- Report.getChat().sendMessage(sender, "Il existe toute");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement