The eula states not to distribute changes to the minecraft code, and it's likely that, at least under U.S. copyright law, that could be applied to derivative code.
In reality, Mojang has the entire modding community by the balls, because if they so desired, they could pull copyright, and force the retraction of Modloader, Forge, and all the other API's that directly handle mojang code.