Advertisement
Guest User

the function

a guest
May 30th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.40 KB | None | 0 0
  1. protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
  2.     {
  3.         int i = MathHelper.floor_double(p_145771_1_);
  4.         int j = MathHelper.floor_double(p_145771_3_);
  5.         int k = MathHelper.floor_double(p_145771_5_);
  6.         double d3 = p_145771_1_ - (double)i;
  7.         double d4 = p_145771_3_ - (double)j;
  8.         double d5 = p_145771_5_ - (double)k;
  9.         List list = this.worldObj.func_147461_a(this.boundingBox);
  10.  
  11.         if (list.isEmpty() && !this.worldObj.func_147469_q(i, j, k))
  12.         {
  13.             return false;
  14.         }
  15.         else
  16.         {
  17.             boolean flag = !this.worldObj.func_147469_q(i - 1, j, k);
  18.             boolean flag1 = !this.worldObj.func_147469_q(i + 1, j, k);
  19.             boolean flag2 = !this.worldObj.func_147469_q(i, j - 1, k);
  20.             boolean flag3 = !this.worldObj.func_147469_q(i, j + 1, k);
  21.             boolean flag4 = !this.worldObj.func_147469_q(i, j, k - 1);
  22.             boolean flag5 = !this.worldObj.func_147469_q(i, j, k + 1);
  23.             byte b0 = 3;
  24.             double d6 = 9999.0D;
  25.  
  26.             if (flag && d3 < d6)
  27.             {
  28.                 d6 = d3;
  29.                 b0 = 0;
  30.             }
  31.  
  32.             if (flag1 && 1.0D - d3 < d6)
  33.             {
  34.                 d6 = 1.0D - d3;
  35.                 b0 = 1;
  36.             }
  37.  
  38.             if (flag3 && 1.0D - d4 < d6)
  39.             {
  40.                 d6 = 1.0D - d4;
  41.                 b0 = 3;
  42.             }
  43.  
  44.             if (flag4 && d5 < d6)
  45.             {
  46.                 d6 = d5;
  47.                 b0 = 4;
  48.             }
  49.  
  50.             if (flag5 && 1.0D - d5 < d6)
  51.             {
  52.                 d6 = 1.0D - d5;
  53.                 b0 = 5;
  54.             }
  55.  
  56.             float f = this.rand.nextFloat() * 0.2F + 0.1F;
  57.  
  58.             if (b0 == 0)
  59.             {
  60.                 this.motionX = (double)(-f);
  61.             }
  62.  
  63.             if (b0 == 1)
  64.             {
  65.                 this.motionX = (double)f;
  66.             }
  67.  
  68.             if (b0 == 2)
  69.             {
  70.                 this.motionY = (double)(-f);
  71.             }
  72.  
  73.             if (b0 == 3)
  74.             {
  75.                 this.motionY = (double)f;
  76.             }
  77.  
  78.             if (b0 == 4)
  79.             {
  80.                 this.motionZ = (double)(-f);
  81.             }
  82.  
  83.             if (b0 == 5)
  84.             {
  85.                 this.motionZ = (double)f;
  86.             }
  87.  
  88.             return true;
  89.         }
  90.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement