Bukkit/CraftBukkit — pull request #1367 by NathanWolf (2014-04-22 01:36:07+00:00)
Title: Reduce XP for empty enchants. Fixes BUKKIT-5557

This preserves @t00thpick1 's special-case fix for enchanting books,
but will allow custom enchanting of other items.

The original change (ac1a2d0) made it so plugins that handle the
enchant event by clearing the enchant list will not have XP deducted
for enchanting. This could cause issues with custom enchanting plugins.