public static Comparator DISTANCE = new Comparator() { @Override public int compare(final CaptionWorld o1, final CaptionWorld o2) { if (Minecraft.getMinecraft().thePlayer == null) return 0; final double d1 = o1.getDistanceTo(Minecraft.getMinecraft().thePlayer); final double d2 = o2.getDistanceTo(Minecraft.getMinecraft().thePlayer); if (d1 < d2) return 1; if (d1 > d2) return -1; return 0; } };