Hub / src / main / java / com / lifeknight / relaymchub / commands / queue / RematchCommand.java
RematchCommand.java
Raw
package com.lifeknight.relaymchub.commands.queue;

import com.lifeknight.relaymcutils.network.ServerCommunicator;
import com.lifeknight.relaymcutils.player.commands.CommandUtilities;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class RematchCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player) || !command.getName().equalsIgnoreCase("rematch")) {
            return true;
        }

        if (args.length > 0) {
            ServerCommunicator.sendToProxy(com.lifeknight.relayutils.network.Command.OTHER, "rematch", ((Player) sender).getUniqueId(), args[0]);
        } else {
            CommandUtilities.sendUsageMessage(sender, "/rematch [player]");
        }

        return true;
    }
}