<commit_before>package com.kierdavis.kmail;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class PartialMessageListener implements Listener {
    private KMail plugin;
    
    public PartialMessageListener(KMail plugin_) {
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
        
        plugin = plugin_;
    }
    
    @EventHandler
    public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
        String s = event.getMessage();
        Player player = event.getPlayer();
        PartialMessage pm = plugin.getPartialMessage(player);
                
        if (pm != null) {
            if (s.equals(".")) {
                plugin.removePartialMessage(player);
                plugin.sendMessage(pm.finish());
                
                player.sendMessage("Mail queued.");
            }
            
            else {
                player.sendMessage("Message body updated.");
                pm.append(s);<commit_msg>Fixed NPE on startup after refactoring use of 'this' keyword<commit_after>package com.kierdavis.kmail;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class PartialMessageListener implements Listener {
    private KMail plugin;
    
    public PartialMessageListener(KMail plugin_) {
        plugin = plugin_;
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }
    
    @EventHandler
    public void onAsyncPlayerChat(AsyncPlayerChatEvent event) {
        String s = event.getMessage();
        Player player = event.getPlayer();
        PartialMessage pm = plugin.getPartialMessage(player);
                
        if (pm != null) {
            if (s.equals(".")) {
                plugin.removePartialMessage(player);
                plugin.sendMessage(pm.finish());
                
                player.sendMessage("Mail queued.");
            }
            
            else {
                player.sendMessage("Message body updated.");
                pm.append(s);
{'fraction_non_alphanumeric': 0.09674502712477397, 'fraction_numerical': 0.0, 'mean_word_length': 2.1750358680057387, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4128714', 'n_tokens_mistral': 569, 'n_tokens_neox': 556, 'n_words': 114}