<commit_before>package net.vanillacraft.CoreFunctions.main;

import net.vanillacraft.CoreFunctions.database.DatabaseQueryManager;
import net.vanillacraft.CoreFunctions.database.MySQLDatabase;
import net.vanillacraft.CoreFunctions.datastores.CoreData;
import net.vanillacraft.CoreFunctions.interfaces.Database;
import net.vanillacraft.CoreFunctions.utils.CoreErrors;
import net.vanillacraft.CoreFunctions.utils.CoreMethods;
import net.vanillacraft.Factions.main.Factions;
import net.vanillacraft.Zones.main.Zones;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.logging.Level;

/**
 * Created by ryan on 5/5/2015.
 * This plugin is ment to provide an interface for all VC plugins to talk to each other.
 * <p/>
 * For example if you want to teleport a player you would ref a function in this plugin
 * which would handle the checking of how soon a player is allowed to TP so that all tp
 * methods would have the exact same output and already the time checking is already
 * delt with.
 */
public class CoreFunctions extends JavaPlugin
{
    //Commit Test
    private static CoreFunctions instance;

    private CoreData coreData;
    private CoreMethods coreMethods;
    private CoreErrors coreErrors;
    private Zones coreZones;
    private Factions coreFactions;

    public CoreErrors getCoreErrors()
    {
        return coreErrors;
    }

    public CoreData getCoreData()
    {
        return coreData;
    }

    public CoreMethods getCoreMethods()
    {
        return coreMethods;
    }

    public Zones getCoreZones()
    {
        return coreZones;
    }

    public Factions getCoreFactions()
    {
        return coreFactions;
    }

    public static JavaPlugin getInstance()
    {
        return instance;
    }

    public static void logError(String message, Class<?> clazz, int errorNumber)
    {
        Bukkit.getLogger().log(Level.SEVERE, "[CoreFunctions] Class={" + clazz.getSimpleName() + "} Error " + errorNumber + ": " + message);
    }

    public static void logError(String message, Class<?> clazz)
    {
        logError(message, clazz, 1);
    }

    public static void logInfoMessage(String message)
    {
        Bukkit.getLogger().info("[CoreFunctions] " + message);
    }

    public static void logWarning(String message)
    {
        Bukkit.getLogger().warning("[CoreFunctions] " + message);
    }


    @Override
    public void onEnable()
    {
        instance = this;

        Database db = setupDatabase();

        if (db == null)
        {
            logWarning("Could not connect to a database. Disabling.");

            for (Player player : Bukkit.getOnlinePlayers())
            {
                player.kickPlayer("Error with Database. Kicking for safety.");
            }

            Bukkit.setWhitelist(true);
            Bukkit.reloadWhitelist();

            return;
        }

        coreData = new CoreData(this, db);
        coreMethods = new CoreMethods(this);
        coreErrors = new CoreErrors(this);

        coreZones = (Zones) getServer().getPluginManager().getPlugin("Zones");
        coreFactions = (Factions) getServer().getPluginManager().getPlugin("Factions");


        //new WorldLogListeners(this,db);

        Bukkit.getServicesManager().register(CoreFunctions.class, this, this, ServicePriority.High);
    }<commit_msg>added an object to make this actually load<commit_after>package net.vanillacraft.CoreFunctions.main;

import net.vanillacraft.CoreFunctions.database.DatabaseQueryManager;
import net.vanillacraft.CoreFunctions.database.MySQLDatabase;
import net.vanillacraft.CoreFunctions.datastores.CoreData;
import net.vanillacraft.CoreFunctions.interfaces.Database;
import net.vanillacraft.CoreFunctions.utils.CoreErrors;
import net.vanillacraft.CoreFunctions.utils.CoreMethods;
import net.vanillacraft.CoreFunctions.utils.Nerf;
import net.vanillacraft.Factions.main.Factions;
import net.vanillacraft.Zones.main.Zones;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.logging.Level;

/**
 * Created by ryan on 5/5/2015.
 * This plugin is ment to provide an interface for all VC plugins to talk to each other.
 * <p/>
 * For example if you want to teleport a player you would ref a function in this plugin
 * which would handle the checking of how soon a player is allowed to TP so that all tp
 * methods would have the exact same output and already the time checking is already
 * delt with.
 */
public class CoreFunctions extends JavaPlugin
{
    //Commit Test
    private static CoreFunctions instance;

    private CoreData coreData;
    private CoreMethods coreMethods;
    private CoreErrors coreErrors;
    private Zones coreZones;
    private Factions coreFactions;

    private Nerf nerfListener;

    public CoreErrors getCoreErrors()
    {
        return coreErrors;
    }

    public CoreData getCoreData()
    {
        return coreData;
    }

    public CoreMethods getCoreMethods()
    {
        return coreMethods;
    }

    public Zones getCoreZones()
    {
        return coreZones;
    }

    public Factions getCoreFactions()
    {
        return coreFactions;
    }

    public static JavaPlugin getInstance()
    {
        return instance;
    }

    public static void logError(String message, Class<?> clazz, int errorNumber)
    {
        Bukkit.getLogger().log(Level.SEVERE, "[CoreFunctions] Class={" + clazz.getSimpleName() + "} Error " + errorNumber + ": " + message);
    }

    public static void logError(String message, Class<?> clazz)
    {
        logError(message, clazz, 1);
    }

    public static void logInfoMessage(String message)
    {
        Bukkit.getLogger().info("[CoreFunctions] " + message);
    }

    public static void logWarning(String message)
    {
        Bukkit.getLogger().warning("[CoreFunctions] " + message);
    }


    @Override
    public void onEnable()
    {
        instance = this;

        Database db = setupDatabase();

        if (db == null)
        {
            logWarning("Could not connect to a database. Disabling.");

            for (Player player : Bukkit.getOnlinePlayers())
            {
                player.kickPlayer("Error with Database. Kicking for safety.");
            }

            Bukkit.setWhitelist(true);
            Bukkit.reloadWhitelist();

            return;
        }

        coreData = new CoreData(this, db);
        coreMethods = new CoreMethods(this);
        coreErrors = new CoreErrors(this);

        coreZones = (Zones) getServer().getPluginManager().getPlugin("Zones");
        coreFactions = (Factions) getServer().getPluginManager().getPlugin("Factions");


        //new WorldLogListeners(this,db);
        nerfListener = new Nerf(this);
        Bukkit.getServicesManager().register(CoreFunctions.class, this, this, ServicePriority.High);
    }
{'fraction_non_alphanumeric': 0.09212943337572417, 'fraction_numerical': 0.0019782393669634025, 'mean_word_length': 2.9697139652271454, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, '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': '6037092', 'n_tokens_mistral': 2033, 'n_tokens_neox': 1944, 'n_words': 525}