Advertisement
GenuineSounds

Untitled

Mar 4th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public static Comparator<CaptionWorld> DISTANCE = new Comparator<CaptionWorld>() {
  2.  
  3.     @Override
  4.     public int compare(final CaptionWorld o1, final CaptionWorld o2) {
  5.         if (Minecraft.getMinecraft().thePlayer == null)
  6.             return 0;
  7.         final double d1 = o1.getDistanceTo(Minecraft.getMinecraft().thePlayer);
  8.         final double d2 = o2.getDistanceTo(Minecraft.getMinecraft().thePlayer);
  9.         if (d1 < d2)
  10.             return 1;
  11.         if (d1 > d2)
  12.             return -1;
  13.         return 0;
  14.     }
  15. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement