/* This file is part of ArborianQuests for Bukkit, licensed under the MIT License (MIT).
 *
 * Copyright (c) JCThePants (www.jcwhatever.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */


package com.jcwhatever.bukkit.arborianquests;

import com.jcwhatever.bukkit.generic.messaging.Messenger;
import com.jcwhatever.bukkit.generic.messaging.ChatPaginator;
import com.jcwhatever.bukkit.generic.utils.text.TextUtils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import java.util.Collection;
import java.util.UUID;

public class Msg {

    private Msg() {}

    public static void tell(CommandSender sender, String message, Object...params) {
        Messenger.tell(ArborianQuests.getPlugin(), sender, message, params);
    }

    public static void tell(Player p, String message, Object...params) {
        Messenger.tell(ArborianQuests.getPlugin(), p, message, params);
    }

    public static void tellImportant(UUID playerId, String context, String message, Object...params) {
        Messenger.tellImportant(ArborianQuests.getPlugin(), playerId, context, message, params);
    }

    public static void info(String message, Object...params) {
        Messenger.info(ArborianQuests.getPlugin(), message, params);
    }

    public static void debug(String message, Object...params) {
        //if (!Plugin.getInstance().isDebugging())
        //	return;
        Messenger.debug(ArborianQuests.getPlugin(), message, params);
    }

    public static void warning(String message, Object...params) {
        Messenger.warning(ArborianQuests.getPlugin(), message, params);
    }

    public static void severe(String message, Object...params) {
        Messenger.severe(ArborianQuests.getPlugin(), message, params);
    }

    public static void broadcast(String message, Object...params) {
        Messenger.broadcast(ArborianQuests.getPlugin(), message, params);
    }

    public static void broadcast(String message, Collection<Player> exclude, Object...params) {
        Messenger.broadcast(ArborianQuests.getPlugin(), message, exclude, params);
    }

    public static ChatPaginator getPaginator(String title, Object...params) {
        return new ChatPaginator(ArborianQuests.getPlugin(), 6, TextUtils.format(title, params));
    }

}

@@ -1309,24 +1309,28 @@
 ssaging.
-Messenge
+ChatPaginato
 r;%0Aimpor
@@ -1367,36 +1367,33 @@
 c.messaging.
-ChatPaginato
+IMessenge
 r;%0Aimport co
@@ -1442,16 +1442,17 @@
 tUtils;%0A
+%0A
 import o
@@ -1710,51 +1710,19 @@
     
-Messenger.tell(ArborianQuests.getPlugin(), 
+msg().tell(
 send
@@ -1835,51 +1835,19 @@
     
-Messenger.tell(ArborianQuests.getPlugin(), 
+msg().tell(
 p, m
@@ -1981,25 +1981,21 @@
         
-Messenger
+msg()
 .tellImp
@@ -2005,36 +2005,8 @@
 ant(
-ArborianQuests.getPlugin(), 
 play
@@ -2120,51 +2120,19 @@
     
-Messenger.info(ArborianQuests.getPlugin(), 
+msg().info(
 mess
@@ -2228,33 +2228,37 @@
     
-//
 if (!
-Plugin.getInstance
+ArborianQuests.getPlugin
 ().i
@@ -2283,10 +2283,8 @@
     
-//
 %09ret
@@ -2288,24 +2288,25 @@
 return;%0A
+%0A
         
 Messenge
@@ -2301,52 +2301,20 @@
     
-Messenger.debug(ArborianQuests.getPlugin(), 
+msg().debug(
 mess
@@ -2412,54 +2412,22 @@
     
-Messenger.warning(ArborianQuests.getPlugin(), 
+msg().warning(
 mess
@@ -2524,53 +2524,21 @@
     
-Messenger.severe(ArborianQuests.getPlugin(), 
+msg().severe(
 mess
@@ -2630,33 +2630,29 @@
 ) %7B%0A        
-Messenger
+msg()
 .broadcast(A
@@ -2654,36 +2654,8 @@
 ast(
-ArborianQuests.getPlugin(), 
 mess
@@ -2779,25 +2779,21 @@
         
-Messenger
+msg()
 .broadca
@@ -2799,36 +2799,8 @@
 ast(
-ArborianQuests.getPlugin(), 
 mess
@@ -2899,32 +2899,32 @@
 ect...params) %7B%0A
-
         return n
@@ -3012,10 +3012,113 @@
 %0A    %7D%0A%0A
+    private static IMessenger msg() %7B%0A        return ArborianQuests.getPlugin().getMessenger();%0A    %7D%0A%0A
 %7D%0A

fix Msg to use GenericsLibs new messenger system