<commit_before>package net.wesjd.anvilgui;

import net.wesjd.anvilgui.version.VersionMatcher;
import net.wesjd.anvilgui.version.VersionWrapper;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.Plugin;

import java.util.function.BiFunction;
import java.util.function.Consumer;

/**
 * An anvil gui, used for gathering a user's input
 *
 * @author <NAME>
 * @since 1.0
 */
public class AnvilGUI {

    /**
     * The local {@link VersionWrapper} object for the server's version
     */
    private static VersionWrapper WRAPPER = new VersionMatcher().match();

    /**
     * The {@link Plugin} that this anvil GUI is associated with
     */
    private final Plugin plugin;
    /**
     * The player who has the GUI open
     */
    private final Player player;
    /**
     * The title of the anvil inventory
     */
    private String inventoryTitle;
    /**
     * The ItemStack that is in the {@link Slot#INPUT_LEFT} slot.
     */
    private ItemStack inputLeft;
    /**
     * The ItemStack that is in the {@link Slot#INPUT_RIGHT} slot.
     */
    private ItemStack inputRight;
    /**
     * A state that decides where the anvil GUI is able to be closed by the user
     */
    private final boolean preventClose;
    /**
     * An {@link Consumer} that is called when the anvil GUI is closed
     */
    private final Consumer<Player> closeListener;
    /**
     * An {@link BiFunction} that is called when the {@link Slot#OUTPUT} slot has been clicked
     */
    private final BiFunction<Player, String, Response> completeFunction;

    /**
     * An {@link Consumer} that is called when the {@link Slot#INPUT_LEFT} slot has been clicked
     */
    private final Consumer<Player> inputLeftClickListener;
    /**
     * An {@link Consumer} that is called when the {@link Slot#INPUT_RIGHT} slot has been clicked
     */
    private final Consumer<Player> inputRightClickListener;

    /**
     * The container id of the inventory, used for NMS methods
     */
    private int containerId;
    /**
     * The inventory that is used on the Bukkit side of things
     */
    private Inventory inventory;
    /**
     * The listener holder class
     */
    private final ListenUp listener = new ListenUp();

    /**
     * Represents the state of the inventory being open
     */
    private boolean open;

    /**
     * Create an AnvilGUI and open it for the player.
     *
     * @param plugin     A {@link org.bukkit.plugin.java.JavaPlugin} instance
     * @param holder     The {@link Player} to open the inventory for
     * @param inputLeft  What to have the text already set to
     * @param biFunction A {@link BiFunction} that is called when the player clicks the {@link Slot#OUTPUT} slot
     * @throws NullPointerException If the server version isn't supported
     * @deprecated As of version 1.2.3, use {@link AnvilGUI.Builder}
     */
    @Deprecated
    public AnvilGUI(Plugin plugin, Player holder, String insert, BiFunction<Player, String, String> biFunction) {
        this(plugin, holder, "Repair & Name", insert, null, null, false, null, null, null, (player, text) -> {
            String response = biFunction.apply(player, text);
            if (response != null) {
                return Response.text(response);
            } else {<commit_msg>fix invalid javadoc<commit_after>package net.wesjd.anvilgui;

import net.wesjd.anvilgui.version.VersionMatcher;
import net.wesjd.anvilgui.version.VersionWrapper;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.Plugin;

import java.util.function.BiFunction;
import java.util.function.Consumer;

/**
 * An anvil gui, used for gathering a user's input
 *
 * @author <NAME>
 * @since 1.0
 */
public class AnvilGUI {

    /**
     * The local {@link VersionWrapper} object for the server's version
     */
    private static VersionWrapper WRAPPER = new VersionMatcher().match();

    /**
     * The {@link Plugin} that this anvil GUI is associated with
     */
    private final Plugin plugin;
    /**
     * The player who has the GUI open
     */
    private final Player player;
    /**
     * The title of the anvil inventory
     */
    private String inventoryTitle;
    /**
     * The ItemStack that is in the {@link Slot#INPUT_LEFT} slot.
     */
    private ItemStack inputLeft;
    /**
     * The ItemStack that is in the {@link Slot#INPUT_RIGHT} slot.
     */
    private ItemStack inputRight;
    /**
     * A state that decides where the anvil GUI is able to be closed by the user
     */
    private final boolean preventClose;
    /**
     * An {@link Consumer} that is called when the anvil GUI is closed
     */
    private final Consumer<Player> closeListener;
    /**
     * An {@link BiFunction} that is called when the {@link Slot#OUTPUT} slot has been clicked
     */
    private final BiFunction<Player, String, Response> completeFunction;

    /**
     * An {@link Consumer} that is called when the {@link Slot#INPUT_LEFT} slot has been clicked
     */
    private final Consumer<Player> inputLeftClickListener;
    /**
     * An {@link Consumer} that is called when the {@link Slot#INPUT_RIGHT} slot has been clicked
     */
    private final Consumer<Player> inputRightClickListener;

    /**
     * The container id of the inventory, used for NMS methods
     */
    private int containerId;
    /**
     * The inventory that is used on the Bukkit side of things
     */
    private Inventory inventory;
    /**
     * The listener holder class
     */
    private final ListenUp listener = new ListenUp();

    /**
     * Represents the state of the inventory being open
     */
    private boolean open;

    /**
     * Create an AnvilGUI and open it for the player.
     *
     * @param plugin     A {@link org.bukkit.plugin.java.JavaPlugin} instance
     * @param holder     The {@link Player} to open the inventory for
     * @param insert  What to have the text already set to
     * @param biFunction A {@link BiFunction} that is called when the player clicks the {@link Slot#OUTPUT} slot
     * @throws NullPointerException If the server version isn't supported
     * @deprecated As of version 1.2.3, use {@link AnvilGUI.Builder}
     */
    @Deprecated
    public AnvilGUI(Plugin plugin, Player holder, String insert, BiFunction<Player, String, String> biFunction) {
        this(plugin, holder, "Repair & Name", insert, null, null, false, null, null, null, (player, text) -> {
            String response = biFunction.apply(player, text);
            if (response != null) {
                return Response.text(response);
            } else {
{'fraction_non_alphanumeric': 0.09515096065873742, 'fraction_numerical': 0.0013070186903672723, 'mean_word_length': 2.9504388229220444, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '409062', 'n_tokens_mistral': 2207, 'n_tokens_neox': 2126, 'n_words': 744}