package com.extrahardmode.compatibility;


import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import uk.co.oliwali.HawkEye.DataType;
import uk.co.oliwali.HawkEye.entry.BlockChangeEntry;
import uk.co.oliwali.HawkEye.entry.BlockEntry;
import uk.co.oliwali.HawkEye.util.BlockUtil;
import uk.co.oliwali.HawkEye.util.HawkEyeAPI;

/**
 * Thanks HawkEye for wasting my time
 */
public class CompatHawkEye implements ICompat, IBlockLogger
{
    private final JavaPlugin plugin;
    private boolean hawkEyeEnabled = true;


    public CompatHawkEye(Plugin plugin)
    {
        this.plugin = (JavaPlugin) plugin;
        try
        {
            Class.forName("uk.co.oliwali.HawkEye.util.HawkEyeAPI");
        } catch (ClassNotFoundException ignored)
        {
            hawkEyeEnabled = false;
        }
    }


    @Override
    public void logFallingBlockFall(Block block)
    {
        HawkEyeAPI.addEntry(plugin, new BlockEntry(fallingBlockFallTag, DataType.BLOCK_BREAK, block));
    }


    @Override
    public void logFallingBlockLand(BlockState block)
    {
        String after = BlockUtil.getBlockString(block.getBlock());
        String before = block.getRawData() != 0 ? block.getTypeId() + ":" + block.getRawData() : Integer.toString(block.getTypeId());
        HawkEyeAPI.addEntry(plugin, new BlockChangeEntry(fallingBlockLandTag, DataType.BLOCK_PLACE, block.getLocation(), before, after));
    }


    @Override
    public boolean isEnabled()
    {
        return hawkEyeEnabled;
    }
}

package com.extrahardmode.compatibility;


import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import uk.co.oliwali.HawkEye.DataType;
import uk.co.oliwali.HawkEye.HawkEye;
import uk.co.oliwali.HawkEye.entry.BlockChangeEntry;
import uk.co.oliwali.HawkEye.entry.BlockEntry;
import uk.co.oliwali.HawkEye.util.BlockUtil;
import uk.co.oliwali.HawkEye.util.HawkEyeAPI;

/**
 * Thanks HawkEye for wasting my time
 */
public class CompatHawkEye implements ICompat, IBlockLogger
{
    private final JavaPlugin plugin;
    private boolean hawkEyeEnabled;


    public CompatHawkEye(Plugin plugin)
    {
        this.plugin = (JavaPlugin) plugin;
        Plugin hawkPlugin = plugin.getServer().getPluginManager().getPlugin("HawkEye");
        hawkEyeEnabled = hawkPlugin instanceof HawkEye;
    }


    @Override
    public void logFallingBlockFall(Block block)
    {
        HawkEyeAPI.addEntry(plugin, new BlockEntry(fallingBlockFallTag, DataType.BLOCK_BREAK, block));
    }


    @Override
    public void logFallingBlockLand(BlockState block)
    {
        String after = BlockUtil.getBlockString(block.getBlock());
        String before = block.getRawData() != 0 ? block.getTypeId() + ":" + block.getRawData() : Integer.toString(block.getTypeId());
        HawkEyeAPI.addEntry(plugin, new BlockChangeEntry(fallingBlockLandTag, DataType.BLOCK_PLACE, block.getLocation(), before, after));
    }


    @Override
    public boolean isEnabled()
    {
        return hawkEyeEnabled;
    }
}

Fix HawkEye not being recognized correctly