<commit_before>/*
   Copyright 2013 <NAME>, <NAME>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

package me.ScottSpittle.MuezliLogin;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

public class PlayerListener implements Listener {

	public static MuezliLogin plugin;
	
	public PlayerListener(MuezliLogin instance){
		plugin = instance;
	}

    @EventHandler
	public void onPlayerJoin(PlayerJoinEvent event) {
		Player player = event.getPlayer();
		String privateLoginMessage = plugin.getConfig().getString("loginMessages." + player.getName());
		if (player.hasPermission("muezli.login.silent")){
			privateLoginMessage = null;
		}
		else {
			if (privateLoginMessage == null) {
				String country = plugin.getGeoIPLookup().getCountry(player.getAddress().getAddress()).getName();
					event.setJoinMessage(ChatColor.GOLD + player.getName() + ChatColor.GRAY + " has joined from " + ChatColor.GOLD + country);
			}else {
				event.setJoinMessage(ChatColor.GOLD + player.getName() + ChatColor.GRAY + " has joined from " + ChatColor.GOLD + privateLoginMessage);
			}
		}
    }
}
<commit_msg>Modified silent login, so it works and is efficient. Added silent logout.<commit_after>/*
   Copyright 2013 <NAME>, <NAME>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

package me.ScottSpittle.MuezliLogin;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;;

public class PlayerListener implements Listener {

	public static MuezliLogin plugin;

	public PlayerListener(MuezliLogin instance) {
		plugin = instance;
	}

	@EventHandler
	public void onPlayerJoin(PlayerJoinEvent event) {
		Player player = event.getPlayer();
		String privateLoginMessage = plugin.getConfig().getString(
				"loginMessages." + player.getName());
		if (player.hasPermission("muezli.login.silent")) {
			event.setJoinMessage("");
			return;
		} else if (privateLoginMessage == null) {
			String country = plugin.getGeoIPLookup().getCountry(player.getAddress().getAddress()).getName();
			event.setJoinMessage(ChatColor.GOLD + player.getName() + ChatColor.GRAY + " has joined from " + ChatColor.GOLD + country);
		} else {
			event.setJoinMessage(ChatColor.GOLD + player.getName() + ChatColor.GRAY + " has joined from " + ChatColor.GOLD + privateLoginMessage);
		}
	}
	
	@EventHandler
	public void onPlayerQuit(PlayerQuitEvent event) {
		Player player = event.getPlayer();
		if (player.hasPermission("muezli.login.silent")) {
			event.setQuitMessage("");
		}
	}
}

{'fraction_non_alphanumeric': 0.09638242894056848, 'fraction_numerical': 0.004134366925064599, 'mean_word_length': 3.7555282555282554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3828499', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1075, 'n_words': 323}