Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.32 KB | None | 0 0
  1.     public EntityPlayer getClosestVulnerablePlayer(double p_72846_1_, double p_72846_3_, double p_72846_5_, double p_72846_7_)
  2.     {
  3.         double d4 = -1.0D;
  4.         EntityPlayer entityplayer = null;
  5.  
  6.         for (int i = 0; i < this.playerEntities.size(); ++i)
  7.         {
  8.             EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i);
  9.  
  10.             if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive())
  11.             {
  12.                 double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_);
  13.                 double d6 = p_72846_7_;
  14.  
  15.                 if (entityplayer1.isSneaking())
  16.                 {
  17.                     d6 = p_72846_7_ * 0.800000011920929D;
  18.                 }
  19.  
  20.                 if (entityplayer1.isInvisible())
  21.                 {
  22.                     float f = entityplayer1.getArmorVisibility();
  23.  
  24.                     if (f < 0.1F)
  25.                     {
  26.                         f = 0.1F;
  27.                     }
  28.  
  29.                     d6 *= (double)(0.7F * f);
  30.                 }
  31.  
  32.                 if ((p_72846_7_ < 0.0D || d5 < d6 * d6) && (d4 == -1.0D || d5 < d4))
  33.                 {
  34.                     d4 = d5;
  35.                     entityplayer = entityplayer1;
  36.                 }
  37.             }
  38.         }
  39.  
  40.         return entityplayer;
  41.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement