SpigotMC/Spigot — pull request #153 by Dmck2b (2014-04-23 00:08:28+00:00)
Title: Prevent anvils from eating the spare items in the second slot

Due to https://github.com/SpigotMC/Spigot-Server/commit/c549609d91182cf65afd2d16fa4dcfc84be7ebf3 currently anvils do not respect the fact you can put more than 1 item in the second slot to repair an item. As a result, this leads to weird visual glitches in the client and also destroys any extra items unpon enchantment.

A issue with this commit is that you can repair multiple items at once for the cost of 1 item. This may have been previous behavior though, I haven't had time to check.