Guest User

Untitled

a guest
Oct 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. package net.minecraft.server;
  2.  
  3. import java.util.Comparator;
  4.  
  5. class RecipeSorter
  6. implements Comparator
  7. {
  8.  
  9. RecipeSorter(CraftingManager craftingmanager)
  10. {
  11. a = craftingmanager;
  12. }
  13.  
  14. public int compare(Object obj, Object obj1)
  15. {
  16. if(!(obj instanceof CraftingRecipe) || !(obj1 instanceof CraftingRecipe))
  17. throw new IllegalArgumentException();
  18. else
  19. return a((CraftingRecipe)obj, (CraftingRecipe)obj);
  20. }
  21.  
  22. public int a(CraftingRecipe craftingrecipe, CraftingRecipe craftingrecipe1)
  23. {
  24. int i = craftingrecipe.getClass().toString().compareTo(craftingrecipe1.getClass().toString());
  25. if(i != 0)
  26. return i;
  27. else
  28. return craftingrecipe1.a() - craftingrecipe.a();
  29. }
  30.  
  31. final CraftingManager a;
  32. }
Add Comment
Please, Sign In to add comment