<commit_before>package net.wayward_realms.waywardessentials;

import net.wayward_realms.waywardessentials.command.*;
import net.wayward_realms.waywardessentials.drink.DrinkManager;
import net.wayward_realms.waywardessentials.drink.PlayerItemConsumeListener;
import net.wayward_realms.waywardessentials.kit.KitImpl;
import net.wayward_realms.waywardessentials.kit.KitManager;
import net.wayward_realms.waywardessentials.time.TimeSlowRunnable;
import net.wayward_realms.waywardessentials.warp.WarpManager;
import net.wayward_realms.waywardessentials.warp.WarpPlayerInteractListener;
import net.wayward_realms.waywardessentials.warp.WarpSignChangeListener;
import net.wayward_realms.waywardlib.character.Character;
import net.wayward_realms.waywardlib.essentials.EssentialsPlugin;
import net.wayward_realms.waywardlib.essentials.Kit;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import org.kohsuke.github.GitHub;

import java.io.File;
import java.io.IOException;
import java.util.*;

public class WaywardEssentials extends JavaPlugin implements EssentialsPlugin {

    private WarpManager warpManager;
    private KitManager kitManager;
    private DrinkManager drinkManager;

    private GitHub gitHub;

    private Set<String> logMessagesEnabled = new HashSet<>();
    private Map<String, Location> previousLocations = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        ConfigurationSerialization.registerClass(KitImpl.class);
        getServer().getScheduler().scheduleSyncRepeatingTask(this, new TimeSlowRunnable(this), 100L, 100L);
        registerListeners(new PlayerJoinListener(this), new PlayerQuitListener(this), new PlayerTeleportListener(this),
                new PlayerItemConsumeListener(this),
                new WarpSignChangeListener(this), new WarpPlayerInteractListener(this));
        registerCommands();
        warpManager = new WarpManager(this);
        kitManager = new KitManager(this);
        drinkManager = new DrinkManager(this);
        try {
            File gitHubFile = new File(getDataFolder(), "github.yml");
            if (gitHubFile.exists()) {
                YamlConfiguration gitHubConfig = new YamlConfiguration();
                gitHubConfig.load(gitHubFile);
                if (gitHubConfig.getString("oauth") != null) {
                    getLogger().info("Found OAuth token in GitHub config, attempting to connect using OAuth...");
                    gitHub = GitHub.connectUsingOAuth(gitHubConfig.getString("oauth"));
                } else if (gitHubConfig.getString("user") != null && gitHubConfig.getString("password") != null) {
                    getLogger().info("Found user and password in GitHub config, attempting to connect using user and password...");
                    gitHub = GitHub.connectUsingPassword(gitHubConfig.getString("user"), gitHubConfig.getString("password"));
                } else {
                    getLogger().info("No user & password or OAuth token found in GitHub config, attempting to connect anonymously...");
                    gitHub = GitHub.connectAnonymously();
                }
            } else {
                getLogger().info("No GitHub config found, attempting to connect anonymously...");
                gitHub = GitHub.connectAnonymously();
            }
        } catch (IOException | InvalidConfigurationException exception) {
            exception.printStackTrace();
        }
        drinkManager.setupRecipes();
    }

    @Override
    public void onDisable() {
        warpManager.save();
        kitManager.save();
    }

    private void registerListeners(Listener... listeners) {
        for (Listener listener : listeners) {
            this.getServer().getPluginManager().registerEvents(listener, this);
        }
    }

    private void registerCommands() {
        getCommand("back").setExecutor(new BackCommand(this));
        getCommand("clone").setExecutor(new CloneCommand(this));
        getCommand("deletewarp").setExecutor(new DeleteWarpCommand(this));
        getCommand("enchant").setExecutor(new EnchantCommand(this));
        getCommand("feed").setExecutor(new FeedCommand(this));
        getCommand("fly").setExecutor(new FlyCommand(this));
        getCommand("getbook").setExecutor(new GetBookCommand(this));
        getCommand("getsign").setExecutor(new GetSignCommand(this));
        getCommand("heal").setExecutor(new HealCommand(this));
        getCommand("inventory").setExecutor(new InventoryCommand(this));
        getCommand("issue").setExecutor(new IssueCommand(this));
        getCommand("item").setExecutor(new ItemCommand(this));
        getCommand("itemmeta").setExecutor(new ItemMetaCommand(this));
        getCommand("jump").setExecutor(new JumpCommand(this));
        getCommand("kit").setExecutor(new KitCommand(this));
        getCommand("msg").setExecutor(new MsgCommand(this));
        getCommand("repair").setExecutor(new RepairCommand(this));
        getCommand("roll").setExecutor(new RollCommand(this));
        getCommand("runas").setExecutor(new RunAsCommand(this));
        getCommand("setspawn").setExecutor(new SetSpawnCommand(this));
        getCommand("setwarp").setExecutor(new SetWarpCommand(this));
        getCommand("smite").setExecutor(new SmiteCommand());
        getCommand("spawn").setExecutor(new SpawnCommand(this));
        getCommand("spawner").setExecutor(new SpawnerCommand(this));
        getCommand("spawnmob").setExecutor(new SpawnMobCommand(this));
        getCommand("speed").setExecutor(new SpeedCommand(this));
        getCommand("sudo").setExecutor(new SudoCommand(this));
        getCommand("togglelogmessages").setExecutor(new ToggleLogMessagesCommand(this));
        getCommand("unsign").setExecutor(new UnsignCommand(this));
        getCommand("warp").setExecutor(new WarpCommand(this));
    }

    @Override
    public String getPrefix() {
        //return "" + ChatColor.DARK_GRAY + ChatColor.MAGIC + "|" + ChatColor.RESET + ChatColor.BLUE + "WaywardEssentials" + ChatColor.DARK_GRAY + ChatColor.MAGIC + "| " + ChatColor.RESET;
        return "";
    }

    @Override
    public void loadState() {
        warpManager.load();
        kitManager.load();
    }

    @Override
    public void saveState() {
        warpManager.save();
        kitManager.save();<commit_msg>Call correct constructor for smite command<commit_after>package net.wayward_realms.waywardessentials;

import net.wayward_realms.waywardessentials.command.*;
import net.wayward_realms.waywardessentials.drink.DrinkManager;
import net.wayward_realms.waywardessentials.drink.PlayerItemConsumeListener;
import net.wayward_realms.waywardessentials.kit.KitImpl;
import net.wayward_realms.waywardessentials.kit.KitManager;
import net.wayward_realms.waywardessentials.time.TimeSlowRunnable;
import net.wayward_realms.waywardessentials.warp.WarpManager;
import net.wayward_realms.waywardessentials.warp.WarpPlayerInteractListener;
import net.wayward_realms.waywardessentials.warp.WarpSignChangeListener;
import net.wayward_realms.waywardlib.character.Character;
import net.wayward_realms.waywardlib.essentials.EssentialsPlugin;
import net.wayward_realms.waywardlib.essentials.Kit;
import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import org.kohsuke.github.GitHub;

import java.io.File;
import java.io.IOException;
import java.util.*;

public class WaywardEssentials extends JavaPlugin implements EssentialsPlugin {

    private WarpManager warpManager;
    private KitManager kitManager;
    private DrinkManager drinkManager;

    private GitHub gitHub;

    private Set<String> logMessagesEnabled = new HashSet<>();
    private Map<String, Location> previousLocations = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        ConfigurationSerialization.registerClass(KitImpl.class);
        getServer().getScheduler().scheduleSyncRepeatingTask(this, new TimeSlowRunnable(this), 100L, 100L);
        registerListeners(new PlayerJoinListener(this), new PlayerQuitListener(this), new PlayerTeleportListener(this),
                new PlayerItemConsumeListener(this),
                new WarpSignChangeListener(this), new WarpPlayerInteractListener(this));
        registerCommands();
        warpManager = new WarpManager(this);
        kitManager = new KitManager(this);
        drinkManager = new DrinkManager(this);
        try {
            File gitHubFile = new File(getDataFolder(), "github.yml");
            if (gitHubFile.exists()) {
                YamlConfiguration gitHubConfig = new YamlConfiguration();
                gitHubConfig.load(gitHubFile);
                if (gitHubConfig.getString("oauth") != null) {
                    getLogger().info("Found OAuth token in GitHub config, attempting to connect using OAuth...");
                    gitHub = GitHub.connectUsingOAuth(gitHubConfig.getString("oauth"));
                } else if (gitHubConfig.getString("user") != null && gitHubConfig.getString("password") != null) {
                    getLogger().info("Found user and password in GitHub config, attempting to connect using user and password...");
                    gitHub = GitHub.connectUsingPassword(gitHubConfig.getString("user"), gitHubConfig.getString("password"));
                } else {
                    getLogger().info("No user & password or OAuth token found in GitHub config, attempting to connect anonymously...");
                    gitHub = GitHub.connectAnonymously();
                }
            } else {
                getLogger().info("No GitHub config found, attempting to connect anonymously...");
                gitHub = GitHub.connectAnonymously();
            }
        } catch (IOException | InvalidConfigurationException exception) {
            exception.printStackTrace();
        }
        drinkManager.setupRecipes();
    }

    @Override
    public void onDisable() {
        warpManager.save();
        kitManager.save();
    }

    private void registerListeners(Listener... listeners) {
        for (Listener listener : listeners) {
            this.getServer().getPluginManager().registerEvents(listener, this);
        }
    }

    private void registerCommands() {
        getCommand("back").setExecutor(new BackCommand(this));
        getCommand("clone").setExecutor(new CloneCommand(this));
        getCommand("deletewarp").setExecutor(new DeleteWarpCommand(this));
        getCommand("enchant").setExecutor(new EnchantCommand(this));
        getCommand("feed").setExecutor(new FeedCommand(this));
        getCommand("fly").setExecutor(new FlyCommand(this));
        getCommand("getbook").setExecutor(new GetBookCommand(this));
        getCommand("getsign").setExecutor(new GetSignCommand(this));
        getCommand("heal").setExecutor(new HealCommand(this));
        getCommand("inventory").setExecutor(new InventoryCommand(this));
        getCommand("issue").setExecutor(new IssueCommand(this));
        getCommand("item").setExecutor(new ItemCommand(this));
        getCommand("itemmeta").setExecutor(new ItemMetaCommand(this));
        getCommand("jump").setExecutor(new JumpCommand(this));
        getCommand("kit").setExecutor(new KitCommand(this));
        getCommand("msg").setExecutor(new MsgCommand(this));
        getCommand("repair").setExecutor(new RepairCommand(this));
        getCommand("roll").setExecutor(new RollCommand(this));
        getCommand("runas").setExecutor(new RunAsCommand(this));
        getCommand("setspawn").setExecutor(new SetSpawnCommand(this));
        getCommand("setwarp").setExecutor(new SetWarpCommand(this));
        getCommand("smite").setExecutor(new SmiteCommand(this));
        getCommand("spawn").setExecutor(new SpawnCommand(this));
        getCommand("spawner").setExecutor(new SpawnerCommand(this));
        getCommand("spawnmob").setExecutor(new SpawnMobCommand(this));
        getCommand("speed").setExecutor(new SpeedCommand(this));
        getCommand("sudo").setExecutor(new SudoCommand(this));
        getCommand("togglelogmessages").setExecutor(new ToggleLogMessagesCommand(this));
        getCommand("unsign").setExecutor(new UnsignCommand(this));
        getCommand("warp").setExecutor(new WarpCommand(this));
    }

    @Override
    public String getPrefix() {
        //return "" + ChatColor.DARK_GRAY + ChatColor.MAGIC + "|" + ChatColor.RESET + ChatColor.BLUE + "WaywardEssentials" + ChatColor.DARK_GRAY + ChatColor.MAGIC + "| " + ChatColor.RESET;
        return "";
    }

    @Override
    public void loadState() {
        warpManager.load();
        kitManager.load();
    }

    @Override
    public void saveState() {
        warpManager.save();
        kitManager.save();
{'fraction_non_alphanumeric': 0.11444469508985639, 'fraction_numerical': 0.0009023234829686443, 'mean_word_length': 3.696327683615819, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1699454', 'n_tokens_mistral': 3617, 'n_tokens_neox': 3502, 'n_words': 612}