    001    package net.minecraft.src;
    002
    003    import java.util.Comparator;
    004
    005    public class PlayerPositionComparator implements Comparator
    006    {
    007        private final ChunkCoordinates field_82548_a;
    008
    009        public PlayerPositionComparator(ChunkCoordinates par1ChunkCoordinates)
    010        {
    011            this.field_82548_a = par1ChunkCoordinates;
    012        }
    013
    014        public int func_82547_a(EntityPlayerMP par1EntityPlayerMP, EntityPlayerMP par2EntityPlayerMP)
    015        {
    016            double var3 = par1EntityPlayerMP.getDistanceSq((double)this.field_82548_a.posX, (double)this.field_82548_a.posY, (double)this.field_82548_a.posZ);
    017            double var5 = par2EntityPlayerMP.getDistanceSq((double)this.field_82548_a.posX, (double)this.field_82548_a.posY, (double)this.field_82548_a.posZ);
    018            return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0);
    019        }
    020
    021        public int compare(Object par1Obj, Object par2Obj)
    022        {
    023            return this.func_82547_a((EntityPlayerMP)par1Obj, (EntityPlayerMP)par2Obj);
    024        }
    025    }