package fr.aumgn.tobenamed.util;

import java.util.List;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

import fr.aumgn.tobenamed.TBN;

public final class TBNUtil {

    private TBNUtil() {
    }

    public static void broadcast(String message) {
        for (Player player : Bukkit.getOnlinePlayers()) {
            player.sendMessage(message);
        }
    }

    public static void broadcast(String permission, String message) {
        for (Player player : Bukkit.getOnlinePlayers()) {
            if (player.hasPermission(permission)) {
                player.sendMessage(message);
            }
        }
    }

    public static <T> T pickRandom(List<T> from) {
        return from.get(TBN.getRandom().nextInt(from.size()));
    }

    public static int scheduleDelayed(int delay, Runnable runnable) {
        return Bukkit.getScheduler().scheduleSyncDelayedTask(
                TBN.getPlugin(), runnable, delay);
    }

    public static int scheduleRepeating(int delay, Runnable runnable) {
        return Bukkit.getScheduler().scheduleSyncRepeatingTask(
                TBN.getPlugin(), runnable, delay, delay);
    }
}

@@ -674,24 +674,89 @@
 %3CT%3E from) %7B%0A
+        if (from.isEmpty()) %7B%0A            return null;%0A        %7D%0A
         retu

Fix TBNUtil.pickRandom()