package net.wayward_realms.waywardchat;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class ReplyCommand implements CommandExecutor {

    private WaywardChat plugin;

    public ReplyCommand(WaywardChat plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            if (plugin.getLastPrivateMessage((Player) sender) != null) {
                if (args.length >= 1) {
                    StringBuilder message = new StringBuilder();
                    for (int i = 1; i < args.length; i++) {
                        message.append(args[i]).append(" ");
                    }
                    plugin.sendPrivateMessage((Player) sender, plugin.getLastPrivateMessage((Player) sender), message.toString());
                } else {
                    sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You must specify a message to reply with");
                }
            } else {
                sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You have not recieved a private message recently (or the last group you recieved a message from was disbanded)");
            }
        } else {
            sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You must be a player to perform this command.");
        }
        return true;
    }

}

@@ -748,39 +748,25 @@
 or (
-int i = 1; i %3C args.length; i++
+String arg : args
 ) %7B%0A
@@ -811,12 +811,8 @@
 (arg
-s%5Bi%5D
 ).ap

Add missing first word to replied messages