Created
May 5, 2012 05:24
-
-
Save mushroomhostage/2600006 to your computer and use it in GitHub Desktop.
net.minecraft.server.RecipeSorter - java.lang.IllegalArgumentException: Comparison method violates its general contract!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int a(CraftingRecipe craftingrecipe, CraftingRecipe craftingrecipe1) | |
{ | |
if((craftingrecipe instanceof ShapelessRecipes) && (craftingrecipe1 instanceof ShapedRecipes)) | |
return 1; | |
if((craftingrecipe1 instanceof ShapelessRecipes) && (craftingrecipe instanceof ShapedRecipes)) | |
return -1; | |
if(craftingrecipe1.a() < craftingrecipe.a()) | |
return -1; | |
return craftingrecipe1.a() <= craftingrecipe.a() ? 0 : 1; | |
} | |
public volatile int compare(Object obj, Object obj1) | |
{ | |
return a((CraftingRecipe)obj, (CraftingRecipe)obj1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment