Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected boolean func_145771_j(double p_145771_1_, double p_145771_3_, double p_145771_5_)
- {
- int i = MathHelper.floor_double(p_145771_1_);
- int j = MathHelper.floor_double(p_145771_3_);
- int k = MathHelper.floor_double(p_145771_5_);
- double d3 = p_145771_1_ - (double)i;
- double d4 = p_145771_3_ - (double)j;
- double d5 = p_145771_5_ - (double)k;
- List list = this.worldObj.func_147461_a(this.boundingBox);
- if (list.isEmpty() && !this.worldObj.func_147469_q(i, j, k))
- {
- return false;
- }
- else
- {
- boolean flag = !this.worldObj.func_147469_q(i - 1, j, k);
- boolean flag1 = !this.worldObj.func_147469_q(i + 1, j, k);
- boolean flag2 = !this.worldObj.func_147469_q(i, j - 1, k);
- boolean flag3 = !this.worldObj.func_147469_q(i, j + 1, k);
- boolean flag4 = !this.worldObj.func_147469_q(i, j, k - 1);
- boolean flag5 = !this.worldObj.func_147469_q(i, j, k + 1);
- byte b0 = 3;
- double d6 = 9999.0D;
- if (flag && d3 < d6)
- {
- d6 = d3;
- b0 = 0;
- }
- if (flag1 && 1.0D - d3 < d6)
- {
- d6 = 1.0D - d3;
- b0 = 1;
- }
- if (flag3 && 1.0D - d4 < d6)
- {
- d6 = 1.0D - d4;
- b0 = 3;
- }
- if (flag4 && d5 < d6)
- {
- d6 = d5;
- b0 = 4;
- }
- if (flag5 && 1.0D - d5 < d6)
- {
- d6 = 1.0D - d5;
- b0 = 5;
- }
- float f = this.rand.nextFloat() * 0.2F + 0.1F;
- if (b0 == 0)
- {
- this.motionX = (double)(-f);
- }
- if (b0 == 1)
- {
- this.motionX = (double)f;
- }
- if (b0 == 2)
- {
- this.motionY = (double)(-f);
- }
- if (b0 == 3)
- {
- this.motionY = (double)f;
- }
- if (b0 == 4)
- {
- this.motionZ = (double)(-f);
- }
- if (b0 == 5)
- {
- this.motionZ = (double)f;
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement