package com.gamingmesh.jobs.McMMO;

import java.util.HashMap;
import java.util.UUID;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

import com.gamingmesh.jobs.Jobs;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;

public class McMMOManager {

    public boolean mcMMOPresent = false;
	
    public boolean mcMMOOverHaul = false;

    private HashMap<UUID, HashMap<String, Long>> map = new HashMap<>();

    public double getMultiplier(Player player) {

	if (player == null)
	    return 0D;

	HashMap<String, Long> InfoMap = map.get(player.getUniqueId());
	if (InfoMap == null)
	    return 0D;
	
	if (mcMMOOverHaul = true) {
		Long t = InfoMap.get(SuperAbilityType.TREE_FELLER);
		if (t != null) {
			if (t < System.currentTimeMillis())
			return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
			InfoMap.remove(SuperAbilityType.TREE_FELLER);
		}

		t = InfoMap.get(SuperAbilityType.GIGA_DRILL_BREAKER);
		if (t != null) {
			if (t < System.currentTimeMillis())
			return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
			InfoMap.remove(SuperAbilityType.GIGA_DRILL_BREAKER);
		}

		t = InfoMap.get(SuperAbilityType.SUPER_BREAKER);
		if (t != null) {
			if (t < System.currentTimeMillis())
			return -(1 - Jobs.getGCManager().superBreakerMultiplier);
			InfoMap.remove(SuperAbilityType.SUPER_BREAKER);
		}
	} else { //Don't report errors if using pre-overhaul mcmmo
		Long t = InfoMap.get(AbilityType.TREE_FELLER);
		if (t != null) {
			if (t < System.currentTimeMillis())
			return -(1 - Jobs.getGCManager().TreeFellerMultiplier);
			InfoMap.remove(AbilityType.TREE_FELLER);
		}

		t = InfoMap.get(AbilityType.GIGA_DRILL_BREAKER);
		if (t != null) {
			if (t < System.currentTimeMillis())
			return -(1 - Jobs.getGCManager().gigaDrillMultiplier);
			InfoMap.remove(AbilityType.GIGA_DRILL_BREAKER);
		}

		t = InfoMap.get(AbilityType.SUPER_BREAKER);
		if (t != null) {
			if (t < System.currentTimeMillis())
			return -(1 - Jobs.getGCManager().superBreakerMultiplier);
			InfoMap.remove(AbilityType.SUPER_BREAKER);
		}
	}

	return 0D;
    }

    public boolean CheckmcMMO() {
	Plugin McMMO = Bukkit.getPluginManager().getPlugin("mcMMO");
	if (McMMO != null) {
	    try {
		Class.forName("com.gmail.nossr50.api.AbilityAPI");
	    } catch (ClassNotFoundException e) {
		// Disabling skill API check;
		mcMMOPresent = false;
		Jobs.consoleMsg("&e[Jobs] &6mcMMO was found - &cBut your McMMO version is outdated, please update for full support.");
		// Still enabling event listener for repair
		return true;
	    }

	    mcMMOPresent = true;
		mcMMOOverHaul = true;
	    Jobs.consoleMsg("&e[Jobs] &6mcMMO" + McMMO.getDescription().getVersion() + " was found - Enabling capabilities.");
	    return true;
	}
	return false;
    }

    public HashMap<UUID, HashMap<String, Long>> getMap() {
	return map;
    }

    public void setMap(HashMap<UUID, HashMap<String, Long>> map) {
	this.map = map;
    }
}

@@ -1414,742 +1414,8 @@
 %0D%0A%09%7D
- else %7B //Don't report errors if using pre-overhaul mcmmo%0D%0A%09%09Long t = InfoMap.get(AbilityType.TREE_FELLER);%0D%0A%09%09if (t != null) %7B%0D%0A%09%09%09if (t %3C System.currentTimeMillis())%0D%0A%09%09%09return -(1 - Jobs.getGCManager().TreeFellerMultiplier);%0D%0A%09%09%09InfoMap.remove(AbilityType.TREE_FELLER);%0D%0A%09%09%7D%0D%0A%0D%0A%09%09t = InfoMap.get(AbilityType.GIGA_DRILL_BREAKER);%0D%0A%09%09if (t != null) %7B%0D%0A%09%09%09if (t %3C System.currentTimeMillis())%0D%0A%09%09%09return -(1 - Jobs.getGCManager().gigaDrillMultiplier);%0D%0A%09%09%09InfoMap.remove(AbilityType.GIGA_DRILL_BREAKER);%0D%0A%09%09%7D%0D%0A%0D%0A%09%09t = InfoMap.get(AbilityType.SUPER_BREAKER);%0D%0A%09%09if (t != null) %7B%0D%0A%09%09%09if (t %3C System.currentTimeMillis())%0D%0A%09%09%09return -(1 - Jobs.getGCManager().superBreakerMultiplier);%0D%0A%09%09%09InfoMap.remove(AbilityType.SUPER_BREAKER);%0D%0A%09%09%7D%0D%0A%09%7D
 %0D%0A%0D%0A
@@ -1619,24 +1619,97 @@
 lityAPI%22);%0D%0A
+%09%09Class.forName(%22com.gmail.nossr50.datatypes.skills.SuperAbilityType%22);%0D%0A
 %09    %7D catch

Remove AbilityType references causing Import error