@@ -0,0 +1,2731 @@
+package com.elmakers.mine.bukkit.magicquests;%0A%0Aimport com.elmakers.mine.bukkit.api.magic.Mage;%0Aimport com.elmakers.mine.bukkit.api.magic.MageController;%0Aimport com.elmakers.mine.bukkit.api.magic.MagicAPI;%0Aimport com.elmakers.mine.bukkit.api.wand.Wand;%0Aimport com.elmakers.mine.bukkit.api.wand.WandUpgradePath;%0Aimport me.blackvein.quests.CustomRequirement;%0Aimport org.bukkit.ChatColor;%0Aimport org.bukkit.Server;%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.plugin.Plugin;%0A%0Aimport java.util.Map;%0A%0Apublic class PathRequirement extends CustomRequirement %7B%0A    private static MagicAPI api;%0A%0A    protected static MagicAPI getAPI(Server server) %7B%0A        if (api == null) %7B%0A            Plugin magicPlugin = server.getPluginManager().getPlugin(%22Magic%22);%0A            if (magicPlugin != null && magicPlugin instanceof MagicAPI) %7B%0A                api = (MagicAPI)magicPlugin;%0A            %7D%0A        %7D%0A%0A        return api;%0A    %7D%0A%0A    public PathRequirement() %7B%0A        this.setName(%22Has Wand Path%22);%0A        this.setAuthor(%22NathanWolf%22);%0A        this.addData(%22Wand%22);%0A        this.addData(%22Path%22);%0A        this.addDescription(%22Wand%22, %22The template to look at (normally 'default')%22);%0A        this.addDescription(%22Path%22, %22What path the player must be on.%22);%0A    %7D%0A%0A    @Override%0A    public boolean testRequirement(Player player, Map%3CString, Object%3E stringObjectMap) %7B%0A        MagicAPI api = getAPI(player.getServer());%0A        String baseTemplate = (String)stringObjectMap.get(%22Wand%22);%0A        if (baseTemplate == null %7C%7C baseTemplate.isEmpty()) %7B%0A            baseTemplate = %22default%22;%0A        %7D%0A        String pathKey = (String)stringObjectMap.get(%22Path%22);%0A        if (api == null %7C%7C pathKey == null) return false;%0A%0A        MageController controller = api.getController();%0A        if (!controller.isMage(player)) return false;%0A%0A        Mage mage = api.getMage(player);%0A%0A        WandUpgradePath path = null;%0A        if (baseTemplate != null)%0A        %7B%0A            Wand boundWand = mage.getBoundWand(baseTemplate);%0A            if (boundWand != null) %7B%0A                path = boundWand.getPath();%0A            %7D%0A        %7D%0A%0A        boolean isDebug = mage.getDebugLevel() %3E 0;%0A        if (path == null) %7B%0A            if (isDebug) mage.sendDebugMessage(ChatColor.RED + %22Has no %22 + ChatColor.YELLOW + baseTemplate + ChatColor.DARK_RED +%22 wand%22, 7);%0A            return false;%0A        %7D%0A%0A        boolean hasPath = path.hasPath(pathKey);%0A        if (isDebug) mage.sendDebugMessage(ChatColor.BLUE + %22Checking wand path %22 + ChatColor.GOLD + path.getKey() +%0A                ChatColor.BLUE +%22 has path %22 + ChatColor.YELLOW + pathKey + %22? %22 +%0A                (hasPath ? ChatColor.GREEN + %22Yes%22 : ChatColor.RED + %22No%22), 7);%0A        return hasPath;%0A    %7D%0A%7D%0A

Add Path requirement