<commit_before>package com.gmail.nossr50.events.party;

import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;

public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable{

    protected String oldParty;
    protected String newParty;
    protected EventReason reason;
    protected boolean cancelled;

    public McMMOPartyChangeEvent(Player player, String oldParty, String newParty, EventReason reason) {
        super(player);
        newParty = newParty.replace(":", ".");
        this.oldParty = oldParty;
        this.newParty = newParty;
        this.reason = reason;
        this.cancelled = false;
    }

    public String getOldParty() {
        return oldParty;
    }

    public String getNewParty() {
        return newParty;
    }

    public EventReason getReason() {
        return reason;
    }

    /** Rest of file is required boilerplate for custom events **/
    private static final HandlerList handlers = new HandlerList();

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }

    /** Following are required for Cancellable **/
    @Override
    public boolean isCancelled() {
        return cancelled;
    }

    @Override
    public void setCancelled(boolean cancelled) {
        this.cancelled = cancelled;
    }

    public enum EventReason{
        JOINED_PARTY,
        LEFT_PARTY,
        KICKED_FROM_PARTY,
        CHANGED_PARTIES;
    }
}
<commit_msg>Fixed NPE due to McMMOPartyChangeEvent.<commit_after>package com.gmail.nossr50.events.party;

import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;

public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable{

    protected String oldParty;
    protected String newParty;
    protected EventReason reason;
    protected boolean cancelled;

    public McMMOPartyChangeEvent(Player player, String oldParty, String newParty, EventReason reason) {
        super(player);

        if (newParty != null) {
            newParty = newParty.replace(":", ".");
        }

        this.oldParty = oldParty;
        this.newParty = newParty;
        this.reason = reason;
        this.cancelled = false;
    }

    public String getOldParty() {
        return oldParty;
    }

    public String getNewParty() {
        return newParty;
    }

    public EventReason getReason() {
        return reason;
    }

    /** Rest of file is required boilerplate for custom events **/
    private static final HandlerList handlers = new HandlerList();

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }

    /** Following are required for Cancellable **/
    @Override
    public boolean isCancelled() {
        return cancelled;
    }

    @Override
    public void setCancelled(boolean cancelled) {
        this.cancelled = cancelled;
    }

    public enum EventReason{
        JOINED_PARTY,
        LEFT_PARTY,
        KICKED_FROM_PARTY,
        CHANGED_PARTIES;
    }
}

{'fraction_non_alphanumeric': 0.07604895104895106, 'fraction_numerical': 0.0011655011655011655, 'mean_word_length': 2.3009615384615385, 'pattern_counts': {'":': 2, '<': 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': '2406126', 'n_tokens_mistral': 1030, 'n_tokens_neox': 912, 'n_words': 241}