src/main/java/com/davidcubesvk/repairItem/command/Command.java
/**
     * Sends a repair message to a recipient.
     *
     * @param recipient the message recipient
     * @param config    the configuration file
     * @param basePath  the base path (path to the configuration section for sender/target messages)
     * @param function  the command (repair) function called
     * @param status    the repair status
     * @param repaired  amount of items repaired
     * @param sender    the sender's name (if sending to the target), otherwise <code>null</code>
     * @param target    the target parameter (if used and sending message to the sender), otherwise <code>null</code>
     */
Sends a repair message to a recipient.
Sends a repair message to a recipient .
private void sendMessage(CommandSender recipient, Configuration config, String basePath, Function function, RepairResult.Status status, int repaired, String sender, String target) {
        String message = ChatColor.translateAlternateColorCodes('&',
                config.getString(basePath + "." + (status == RepairResult.Status.SUCCESS ? "success." + function.getPath() : "fail." + status.getPath())));
        if (sender != null)
            message = message.replace("{sender}", sender);
        if (target != null)
            message = message.replace("{target}", target);
        recipient.sendMessage(message.replace("{repaired}", "" + repaired));
    }
private void sendMessage ( CommandSender recipient , Configuration config , String basePath , Function function , RepairResult . Status status , int repaired , String sender , String target ) { String message = ChatColor . translateAlternateColorCodes ( '&' , config . getString ( basePath + "." + ( status == RepairResult . Status . SUCCESS ? "success." + function . getPath ( ) : "fail." + status . getPath ( ) ) ) ) ; if ( sender != null ) message = message . replace ( "{sender}" , sender ) ; if ( target != null ) message = message . replace ( "{target}" , target ) ; recipient . sendMessage ( message . replace ( "{repaired}" , "" + repaired ) ) ; }
Sends a repair message to a recipient.
Sends a repair message to a recipient .
//The message //If sender specified //Replace //If target specified //Replace //Send the message