if ((blockState instanceof Attachable && blockState.getBlock().getRelative(((Attachable) blockState).getAttachedFace()).getType() == Material.AIR)
|| blockState.getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR)
counter++;
else
{
CHBlockHealEvent event = new CHBlockHealEvent(blockState, true, reason);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled())
blockState.replace(event.shouldDrop());
Bukkit.getScheduler().cancelTask(id);
}
}
else
{
CHBlockHealEvent event = new CHBlockHealEvent(blockState, true, reason);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled())
blockState.replace(event.shouldDrop());
Bukkit.getScheduler().cancelTask(id);
}
}