<commit_before>package org.dynmap;

import java.util.logging.Logger;
import java.io.IOException;

import java.io.File;
import org.bukkit.*;
import org.bukkit.event.*;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.block.BlockListener;
import org.bukkit.plugin.*;
import org.bukkit.plugin.java.*;
import org.bukkit.util.config.Configuration;
import org.dynmap.debug.BukkitPlayerDebugger;

public class DynmapPlugin extends JavaPlugin {

	protected static final Logger log = Logger.getLogger("Minecraft");

	private WebServer webserver = null;
	private MapManager mgr = null;
	private PlayerList playerList;
	
	private BukkitPlayerDebugger debugger = new BukkitPlayerDebugger(this);
	
	public static File dataRoot;

	public DynmapPlugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
		super(pluginLoader, instance, desc, folder, plugin, cLoader);
		dataRoot = folder;
	}

	public World getWorld() {
		return getServer().getWorlds()[0];
	}

	public void onEnable() {
		Configuration configuration = new Configuration(new File(this.getDataFolder(), "configuration.txt"));
		configuration.load();
		
		debugger.enable();
		playerList = new PlayerList(getServer());
		playerList.load();
		
		mgr = new MapManager(getWorld(), debugger, configuration);
		mgr.startManager();

		try {
			webserver = new WebServer(mgr, getServer(), playerList, debugger, configuration);
		} catch(IOException e) {
			log.info("position failed to start WebServer (IOException)");
		}
		
		registerEvents();
	}

	public void onDisable() {
		mgr.stopManager();

		if(webserver != null) {
			webserver.shutdown();
			webserver = null;
		}
		debugger.disable();
	}

	public void registerEvents() {
		BlockListener blockListener = new DynmapBlockListener(mgr);
		getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
		getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
		
		getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, new DynmapPlayerListener(mgr, playerList), Priority.Normal, this);
		//getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DESTROYED, listener, Priority.Normal, this);
	/*	etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
		etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
		etc.getLoader().addListener(PluginLoader.Hook.BLOCK_DESTROYED, listener, this, PluginListener.Priority.MEDIUM);
		etc.getLoader().addListener(PluginLoader.Hook.LOGIN, listener, this, PluginListener.Priority.MEDIUM);

		etc.getInstance().addCommand("/map_wait", " [wait] - set wait between tile renders (ms)");
		etc.getInstance().addCommand("/map_stat", " - query number of tiles in render queue");
		etc.getInstance().addCommand("/map_regen", " - regenerate entire map");<commit_msg>Added getters/setters.<commit_after>package org.dynmap;

import java.util.logging.Logger;
import java.io.IOException;

import java.io.File;
import org.bukkit.*;
import org.bukkit.event.*;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.block.BlockListener;
import org.bukkit.plugin.*;
import org.bukkit.plugin.java.*;
import org.bukkit.util.config.Configuration;
import org.dynmap.debug.BukkitPlayerDebugger;

public class DynmapPlugin extends JavaPlugin {

	protected static final Logger log = Logger.getLogger("Minecraft");

	private WebServer webServer = null;
	private MapManager mapManager = null;
	private PlayerList playerList;
	
	private BukkitPlayerDebugger debugger = new BukkitPlayerDebugger(this);
	
	public static File dataRoot;
	
	public DynmapPlugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
		super(pluginLoader, instance, desc, folder, plugin, cLoader);
		dataRoot = folder;
	}

	public World getWorld() {
		return getServer().getWorlds()[0];
	}
	
	public MapManager getMapManager() {
		return mapManager;
	}
	
	public WebServer getWebServer() {
		return webServer;
	}

	public void onEnable() {
		Configuration configuration = new Configuration(new File(this.getDataFolder(), "configuration.txt"));
		configuration.load();
		
		debugger.enable();
		playerList = new PlayerList(getServer());
		playerList.load();
		
		mapManager = new MapManager(getWorld(), debugger, configuration);
		mapManager.startManager();

		try {
			webServer = new WebServer(mapManager, getServer(), playerList, debugger, configuration);
		} catch(IOException e) {
			log.info("position failed to start WebServer (IOException)");
		}
		
		registerEvents();
	}

	public void onDisable() {
		mapManager.stopManager();

		if(webServer != null) {
			webServer.shutdown();
			webServer = null;
		}
		debugger.disable();
	}

	public void registerEvents() {
		BlockListener blockListener = new DynmapBlockListener(mapManager);
		getServer().getPluginManager().registerEvent(Event.Type.BLOCK_PLACED, blockListener, Priority.Normal, this);
		getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DAMAGED, blockListener, Priority.Normal, this);
		
		getServer().getPluginManager().registerEvent(Event.Type.PLAYER_COMMAND, new DynmapPlayerListener(mapManager, playerList), Priority.Normal, this);
		//getServer().getPluginManager().registerEvent(Event.Type.BLOCK_DESTROYED, listener, Priority.Normal, this);
	/*	etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM);
		etc.getLoader().addListener(PluginLoader.Hook.BLOCK_CREATED, listener, this, PluginListener.Priority.MEDIUM);
		etc.getLoader().addListener(PluginLoader.Hook.BLOCK_DESTROYED, listener, this, PluginListener.Priority.MEDIUM);
		etc.getLoader().addListener(PluginLoader.Hook.LOGIN, listener, this, PluginListener.Priority.MEDIUM);

		etc.getInstance().addCommand("/map_wait", " [wait] - set wait between tile renders (ms)");
		etc.getInstance().addCommand("/map_stat", " - query number of tiles in render queue");
		etc.getInstance().addCommand("/map_regen", " - regenerate entire map");
{'fraction_non_alphanumeric': 0.12370801033591731, 'fraction_numerical': 0.00032299741602067185, 'mean_word_length': 5.724212812160695, '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': '2755152', 'n_tokens_mistral': 1929, 'n_tokens_neox': 1781, 'n_words': 390}