// Path: src/main/java/com/devotedmc/ExilePearl/core/CorePluginFactory.java
// public final class CorePluginFactory implements PearlFactory {
// 
// 	private final ExilePearlApi pearlApi;
// 
// 	public static ExilePearlApi createCore(final Plugin plugin) {
// 		return new ExilePearlCore(plugin);
// 	}
// 
// 	/**
// 	 * Creates a new ExilePearlFactory instance
// 	 * @param plugin The plugin instance
// 	 */
// 	public CorePluginFactory(final ExilePearlApi plugin) {
// 		Guard.ArgumentNotNull(plugin, "plugin");
// 
// 		this.pearlApi = plugin;
// 	}
// 
// 	@Override
// 	public ExilePearl createExilePearl(UUID uid, Document doc) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(doc, "doc");
// 
// 		try {
// 			UUID killedBy = UUID.fromString(doc.getString("killer_id"));
// 			int pearlId = doc.getInteger("pearl_id");
// 			Location loc = doc.getLocation("location");
// 			int health = doc.getInteger("health");
// 			Date pearledOn = doc.getDate("pearled_on", new Date());
// 			Date lastSeen = doc.getDate("last_seen", new Date());
// 			boolean freedOffline = doc.getBoolean("freed_offline", false);
// 			boolean summoned = doc.getBoolean("summoned", false);
// 			Location returnLoc = doc.getLocation("returnLoc");
// 
// 			ExilePearl pearl = new CoreExilePearl(pearlApi, pearlApi.getStorageProvider().getStorage(), uid, killedBy, pearlId, new BlockHolder(loc.getBlock()), pearlApi.getPearlConfig().getDefaultPearlType());
// 			pearl.setPearlType(PearlType.valueOf(doc.getInteger("type", 0)));
// 			pearl.setHealth(health);
// 			pearl.setPearledOn(pearledOn);
// 			pearl.setLastOnline(lastSeen);
// 			pearl.setFreedOffline(freedOffline);
// 			pearl.setSummoned(summoned);
// 			pearl.setReturnLocation(returnLoc);
// 			pearl.enableStorage();
// 			return pearl;
// 
// 		} catch(Exception ex) {
// 			pearlApi.log(Level.SEVERE, "Failed to create pearl for ID=%s, ", uid.toString(), doc);
// 			return null;
// 		}
// 	}
// 
// 	@Override
// 	public ExilePearl createExilePearl(UUID uid, Player killedBy, int pearlId) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(killedBy, "killedBy");
// 
// 		ExilePearl pearl = new CoreExilePearl(pearlApi, pearlApi.getStorageProvider().getStorage(), uid, killedBy.getUniqueId(), pearlId, new PlayerHolder(killedBy), pearlApi.getPearlConfig().getDefaultPearlType());
// 		pearl.enableStorage();
// 		return pearl;
// 	}
// 
// 	@Override
// 	public ExilePearl createExilePearl(UUID uid, UUID killedById, int pearlId, PearlHolder holder) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(killedById, "killedById");
// 		Guard.ArgumentNotNull(holder, "holder");
// 
// 		ExilePearl pearl = new CoreExilePearl(pearlApi, pearlApi.getStorageProvider().getStorage(), uid, killedById, pearlId, holder, pearlApi.getPearlConfig().getDefaultPearlType());
// 		pearl.enableStorage();
// 		return pearl;
// 	}
// 
// 	@Override
// 	public ExilePearl createdMigratedPearl(UUID uid, Document doc) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(doc, "doc");
// 
// 		doc.append("health", pearlApi.getPearlConfig().getPearlHealthMaxValue() / 2); // set health to half max health
// 		return createExilePearl(uid, doc);
// 	}
// 
// 	public PearlManager createPearlManager() {
// 		return new CorePearlManager(pearlApi, this, pearlApi.getStorageProvider());
// 	}
// 
// 	public ExilePearlRunnable createPearlDecayWorker() {
// 		return new PearlDecayTask(pearlApi);
// 	}
// 
// 	public SuicideHandler createSuicideHandler() {
// 		return new PlayerSuicideTask(pearlApi);
// 	}
// 
// 	public BorderHandler createPearlBorderHandler() {
// 		return new PearlBoundaryTask(pearlApi);
// 	}
// 
// 	public BrewHandler createBrewHandler() {
// 		if (Bukkit.getPluginManager().isPluginEnabled("Brewery")) {
// 			return new BreweryHandler();
// 		} else {
// 			pearlApi.log("Brewery not found, defaulting to no-brew handler");
// 			return new NoBrewHandler(pearlApi);
// 		}
// 	}
// 
// 	public LoreProvider createLoreGenerator() {
// 		return new CoreLoreGenerator(pearlApi.getPearlConfig());
// 	}
// 
// 	public PearlConfig createPearlConfig() {
// 		return new CorePearlConfig(pearlApi, pearlApi);
// 	}
// 
// 	public DamageLogger createDamageLogger() {
// 		return new CoreDamageLogger(pearlApi);
// 	}
// }


import java.io.File;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.java.JavaPluginLoader;
import com.devotedmc.ExilePearl.core.CorePluginFactory;
package com.devotedmc.ExilePearl;




/**
 * The plugin class for ExilePearl
 * <p>
 * The meat of the plugin is located in ExilePearlCore.java
 * 
 * @author GordonFreemanQ
 *
 */
public final class ExilePearlPlugin extends JavaPlugin {

	private static ExilePearlApi core;

	public static ExilePearlApi getApi() {
		return core;
	}

	public ExilePearlPlugin() {
		core = CorePluginFactory.createCore(this);
	}

	// Unit testing
// Path: src/main/java/com/devotedmc/ExilePearl/core/CorePluginFactory.java
// public final class CorePluginFactory implements PearlFactory {
// 
// 	private final ExilePearlApi pearlApi;
// 
// 	public static ExilePearlApi createCore(final Plugin plugin) {
// 		return new ExilePearlCore(plugin);
// 	}
// 
// 	/**
// 	 * Creates a new ExilePearlFactory instance
// 	 * @param plugin The plugin instance
// 	 */
// 	public CorePluginFactory(final ExilePearlApi plugin) {
// 		Guard.ArgumentNotNull(plugin, "plugin");
// 
// 		this.pearlApi = plugin;
// 	}
// 
// 	@Override
// 	public ExilePearl createExilePearl(UUID uid, Document doc) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(doc, "doc");
// 
// 		try {
// 			UUID killedBy = UUID.fromString(doc.getString("killer_id"));
// 			int pearlId = doc.getInteger("pearl_id");
// 			Location loc = doc.getLocation("location");
// 			int health = doc.getInteger("health");
// 			Date pearledOn = doc.getDate("pearled_on", new Date());
// 			Date lastSeen = doc.getDate("last_seen", new Date());
// 			boolean freedOffline = doc.getBoolean("freed_offline", false);
// 			boolean summoned = doc.getBoolean("summoned", false);
// 			Location returnLoc = doc.getLocation("returnLoc");
// 
// 			ExilePearl pearl = new CoreExilePearl(pearlApi, pearlApi.getStorageProvider().getStorage(), uid, killedBy, pearlId, new BlockHolder(loc.getBlock()), pearlApi.getPearlConfig().getDefaultPearlType());
// 			pearl.setPearlType(PearlType.valueOf(doc.getInteger("type", 0)));
// 			pearl.setHealth(health);
// 			pearl.setPearledOn(pearledOn);
// 			pearl.setLastOnline(lastSeen);
// 			pearl.setFreedOffline(freedOffline);
// 			pearl.setSummoned(summoned);
// 			pearl.setReturnLocation(returnLoc);
// 			pearl.enableStorage();
// 			return pearl;
// 
// 		} catch(Exception ex) {
// 			pearlApi.log(Level.SEVERE, "Failed to create pearl for ID=%s, ", uid.toString(), doc);
// 			return null;
// 		}
// 	}
// 
// 	@Override
// 	public ExilePearl createExilePearl(UUID uid, Player killedBy, int pearlId) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(killedBy, "killedBy");
// 
// 		ExilePearl pearl = new CoreExilePearl(pearlApi, pearlApi.getStorageProvider().getStorage(), uid, killedBy.getUniqueId(), pearlId, new PlayerHolder(killedBy), pearlApi.getPearlConfig().getDefaultPearlType());
// 		pearl.enableStorage();
// 		return pearl;
// 	}
// 
// 	@Override
// 	public ExilePearl createExilePearl(UUID uid, UUID killedById, int pearlId, PearlHolder holder) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(killedById, "killedById");
// 		Guard.ArgumentNotNull(holder, "holder");
// 
// 		ExilePearl pearl = new CoreExilePearl(pearlApi, pearlApi.getStorageProvider().getStorage(), uid, killedById, pearlId, holder, pearlApi.getPearlConfig().getDefaultPearlType());
// 		pearl.enableStorage();
// 		return pearl;
// 	}
// 
// 	@Override
// 	public ExilePearl createdMigratedPearl(UUID uid, Document doc) {
// 		Guard.ArgumentNotNull(uid, "uid");
// 		Guard.ArgumentNotNull(doc, "doc");
// 
// 		doc.append("health", pearlApi.getPearlConfig().getPearlHealthMaxValue() / 2); // set health to half max health
// 		return createExilePearl(uid, doc);
// 	}
// 
// 	public PearlManager createPearlManager() {
// 		return new CorePearlManager(pearlApi, this, pearlApi.getStorageProvider());
// 	}
// 
// 	public ExilePearlRunnable createPearlDecayWorker() {
// 		return new PearlDecayTask(pearlApi);
// 	}
// 
// 	public SuicideHandler createSuicideHandler() {
// 		return new PlayerSuicideTask(pearlApi);
// 	}
// 
// 	public BorderHandler createPearlBorderHandler() {
// 		return new PearlBoundaryTask(pearlApi);
// 	}
// 
// 	public BrewHandler createBrewHandler() {
// 		if (Bukkit.getPluginManager().isPluginEnabled("Brewery")) {
// 			return new BreweryHandler();
// 		} else {
// 			pearlApi.log("Brewery not found, defaulting to no-brew handler");
// 			return new NoBrewHandler(pearlApi);
// 		}
// 	}
// 
// 	public LoreProvider createLoreGenerator() {
// 		return new CoreLoreGenerator(pearlApi.getPearlConfig());
// 	}
// 
// 	public PearlConfig createPearlConfig() {
// 		return new CorePearlConfig(pearlApi, pearlApi);
// 	}
// 
// 	public DamageLogger createDamageLogger() {
// 		return new CoreDamageLogger(pearlApi);
// 	}
// }


// Path: src/main/java/com/devotedmc/ExilePearl/ExilePearlPlugin.java
import java.io.File;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.java.JavaPluginLoader;
import com.devotedmc.ExilePearl.core.CorePluginFactory;

package com.devotedmc.ExilePearl;




/**
 * The plugin class for ExilePearl
 * <p>
 * The meat of the plugin is located in ExilePearlCore.java
 * 
 * @author GordonFreemanQ
 *
 */
public final class ExilePearlPlugin extends JavaPlugin {

	private static ExilePearlApi core;

	public static ExilePearlApi getApi() {
		return core;
	}

	public ExilePearlPlugin() {
		core = CorePluginFactory.createCore(this);
	}

	// Unit testing
    protected ExilePearlPlugin(final JavaPluginLoader loader, final PluginDescriptionFile description, final File dataFolder, final File file) {