MinecraftPortCentral/CraftBukkit — pull request #7 by mushroomhostage (2012-06-22 03:11:19+00:00)
Title: Add net.minecraft.server.RecipeSorter

Adds net.minecraft.server.RecipeSorter from mc-dev so it is compiled with Java 6.

This is the first step in a potential fix for the "java.lang.IllegalArgumentException: Comparison method violates its general contract!" error in TimSort when using addRecipe() from a plugin, when certain combinations of mods are installed (at least: Forestry 1.4.6.2 r5 + IC2 v1.95b r2, but not IC2 alone).

More details at:
http://www.mcportcentral.co.za/index.php?topic=3021.msg16619
http://www.mcportcentral.co.za/index.php?topic=2159.msg13401#msg13401
http://dev.bukkit.org/server-mods/recipemanager/tickets/68-comparison-method-violates-its-general-contract/#c17

Further patches might follow if needed (such as: https://gist.github.com/2969881 ), or they may not if this is all that is needed (recompiling mc-dev's Java 5 RecipeSorter with Java 6 fixes the problem for me, at least with Forestry + IC2, but I'm not clear on why it does – heisenbug?).