Search in sources :

Example 1 with JoinLeaveListener

use of fr.neatmonster.nocheatplus.components.registry.feature.JoinLeaveListener in project NoCheatPlus by NoCheatPlus.

the class NoCheatPlus method onJoinLow.

private void onJoinLow(final Player player) {
    final String playerName = player.getName();
    final IPlayerData data = DataManager.getPlayerData(player);
    if (data.hasPermission(Permissions.NOTIFY, player)) {
        // Inconsistent config version.
        if (configProblemsChat != null && ConfigManager.getConfigFile().getBoolean(ConfPaths.CONFIGVERSION_NOTIFY)) {
            // Could use custom prefix from logging, however ncp should be mentioned then.
            sendMessageOnTick(playerName, ChatColor.RED + "NCP: " + ChatColor.WHITE + configProblemsChat);
        }
        // Message if notify is turned off.
        if (data.getNotifyOff()) {
            sendMessageOnTick(playerName, MSG_NOTIFY_OFF);
        }
    }
    // JoinLeaveListenerS: Do update comment in NoCheatPlusAPI with changing event priority.
    for (final JoinLeaveListener jlListener : joinLeaveListeners) {
        try {
            jlListener.playerJoins(player);
        } catch (Throwable t) {
            logManager.severe(Streams.INIT, "JoinLeaveListener(" + jlListener.getClass().getName() + ") generated an exception (join): " + t.getClass().getSimpleName());
            logManager.severe(Streams.INIT, t);
        }
    }
    // Mod message (left on low instead of lowest to allow some permissions plugins compatibility).
    ModUtil.motdOnJoin(player);
}
Also used : JoinLeaveListener(fr.neatmonster.nocheatplus.components.registry.feature.JoinLeaveListener) IPlayerData(fr.neatmonster.nocheatplus.players.IPlayerData)

Aggregations

JoinLeaveListener (fr.neatmonster.nocheatplus.components.registry.feature.JoinLeaveListener)1 IPlayerData (fr.neatmonster.nocheatplus.players.IPlayerData)1