Search in sources :

Example 6 with MessageConfiguration

use of net.dzikoysk.funnyguilds.config.MessageConfiguration in project FunnyGuilds by FunnyGuilds.

the class WarUtils method message.

public static void message(Player player, int i, Object... values) {
    MessageConfiguration messages = FunnyGuilds.getInstance().getMessageConfiguration();
    String message = null;
    switch(i) {
        case 0:
            message = messages.warHasNotGuild;
            break;
        case 1:
            message = messages.warAlly;
            break;
        case 2:
            message = messages.warWait;
            message = StringUtils.replace(message, "{TIME}", TimeUtils.getDurationBreakdown((long) values[0]));
            break;
        case 3:
            message = messages.warAttacker;
            message = StringUtils.replace(message, "{ATTACKED}", ((Guild) values[0]).getTag());
            break;
        case 4:
            message = messages.warAttacked;
            message = StringUtils.replace(message, "{ATTACKER}", ((Guild) values[0]).getTag());
            break;
        case 5:
            message = messages.warDisabled;
            break;
        default:
            throw new IllegalArgumentException("Unknown magic number " + i);
    }
    ChatUtils.sendMessage(player, message);
}
Also used : MessageConfiguration(net.dzikoysk.funnyguilds.config.MessageConfiguration) Guild(net.dzikoysk.funnyguilds.guild.Guild)

Example 7 with MessageConfiguration

use of net.dzikoysk.funnyguilds.config.MessageConfiguration in project FunnyGuilds by FunnyGuilds.

the class SecurityUtils method sendToOperator.

public static void sendToOperator(Player player, String cheat, String note) {
    MessageConfiguration messages = FunnyGuilds.getInstance().getMessageConfiguration();
    String message = messages.securitySystemPrefix + messages.securitySystemInfo;
    String messageNote = messages.securitySystemPrefix + messages.securitySystemNote;
    message = StringUtils.replace(message, "{PLAYER}", player.getName());
    message = StringUtils.replace(message, "{CHEAT}", cheat);
    messageNote = StringUtils.replace(messageNote, "{NOTE}", note);
    Bukkit.broadcast(ChatUtils.colored(message), "funnyguilds.admin");
    Bukkit.broadcast(ChatUtils.colored(messageNote), "funnyguilds.admin");
}
Also used : MessageConfiguration(net.dzikoysk.funnyguilds.config.MessageConfiguration)

Aggregations

MessageConfiguration (net.dzikoysk.funnyguilds.config.MessageConfiguration)7 PluginConfiguration (net.dzikoysk.funnyguilds.config.PluginConfiguration)5 FunnyGuilds (net.dzikoysk.funnyguilds.FunnyGuilds)2 Guild (net.dzikoysk.funnyguilds.guild.Guild)2 User (net.dzikoysk.funnyguilds.user.User)2 Player (org.bukkit.entity.Player)2 List (java.util.List)1 Map (java.util.Map)1 Spliterator (java.util.Spliterator)1 Spliterators (java.util.Spliterators)1 TimeUnit (java.util.concurrent.TimeUnit)1 Collectors.toList (java.util.stream.Collectors.toList)1 StreamSupport (java.util.stream.StreamSupport)1 ValidationException (net.dzikoysk.funnycommands.resources.ValidationException)1 DefaultConcurrencyRequest (net.dzikoysk.funnyguilds.concurrency.util.DefaultConcurrencyRequest)1 InfoCommand (net.dzikoysk.funnyguilds.feature.command.user.InfoCommand)1 SecuritySystem (net.dzikoysk.funnyguilds.feature.security.SecuritySystem)1 SecurityUtils (net.dzikoysk.funnyguilds.feature.security.SecurityUtils)1 GuildManager (net.dzikoysk.funnyguilds.guild.GuildManager)1 GuildRankManager (net.dzikoysk.funnyguilds.guild.GuildRankManager)1