Example #1
0
        private float func_431_a(int i)
        {
            if (i < field_756_e * 0.29999999999999999D)
            {
                return(-1.618F);
            }
            float f  = field_756_e / 2.0F;
            float f1 = field_756_e / 2.0F - i;
            float f2;

            if (f1 == 0.0F)
            {
                f2 = f;
            }
            else if (Math.abs(f1) >= f)
            {
                f2 = 0.0F;
            }
            else
            {
                f2 = (float)Math.sqrt(Math.pow(Math.abs(f), 2D) - Math.pow(Math.abs(f1), 2D));
            }
            f2 *= 0.5F;
            return(f2);
        }
Example #2
0
        private void func_425_a(int[] ai, int[] ai1, int i)
        {
            int[] ai2 =
            {
                0, 0, 0
            };
            byte byte0 = 0;
            int  j     = 0;

            for (; byte0 < 3; byte0++)
            {
                ai2[byte0] = ai1[byte0] - ai[byte0];
                if (Math.abs(ai2[byte0]) > Math.abs(ai2[j]))
                {
                    j = byte0;
                }
            }

            if (ai2[j] == 0)
            {
                return;
            }
            byte  byte1 = field_760_a[j];
            byte  byte2 = field_760_a[j + 3];
            sbyte byte3;

            if (ai2[j] > 0)
            {
                byte3 = 1;
            }
            else
            {
                byte3 = -1;
            }
            double d  = ai2[byte1] / (double)ai2[j];
            double d1 = ai2[byte2] / (double)ai2[j];

            int[] ai3 =
            {
                0, 0, 0
            };
            int k = 0;

            for (int l = ai2[j] + byte3; k != l; k += byte3)
            {
                ai3[j]     = MathHelper.floor_double((ai[j] + k) + 0.5D);
                ai3[byte1] = MathHelper.floor_double(ai[byte1] + k * d + 0.5D);
                ai3[byte2] = MathHelper.floor_double(ai[byte2] + k * d1 + 0.5D);
                worldObj.setBlock(ai3[0], ai3[1], ai3[2], i);
            }
        }
Example #3
0
        private void func_426_a(int i, int j, int k, float f, byte byte0, int l)
        {
            var  i1    = (int)(f + 0.61799999999999999D);
            byte byte1 = field_760_a[byte0];
            byte byte2 = field_760_a[byte0 + 3];

            int[] ai =
            {
                i, j, k
            };
            int[] ai1 =
            {
                0, 0, 0
            };
            int j1 = -i1;
            int k1 = -i1;

            ai1[byte0] = ai[byte0];
            for (; j1 <= i1; j1++)
            {
                ai1[byte1] = ai[byte1] + j1;
                for (int l1 = -i1; l1 <= i1;)
                {
                    double d =
                        Math.sqrt(Math.pow(Math.abs(j1) + 0.5D, 2D) +
                                  Math.pow(Math.abs(l1) + 0.5D, 2D));
                    if (d > f)
                    {
                        l1++;
                    }
                    else
                    {
                        ai1[byte2] = ai[byte2] + l1;
                        int i2 = worldObj.getBlockId(ai1[0], ai1[1], ai1[2]);
                        if (i2 != 0 && i2 != 18)
                        {
                            l1++;
                        }
                        else
                        {
                            worldObj.setBlock(ai1[0], ai1[1], ai1[2], l);
                            l1++;
                        }
                    }
                }
            }
        }
Example #4
0
        private void func_424_a()
        {
            height = (int)(field_756_e * field_754_g);
            if (height >= field_756_e)
            {
                height = field_756_e - 1;
            }
            var i = (int)(1.3819999999999999D + Math.pow((field_750_k * field_756_e) / 13D, 2D));

            if (i < 1)
            {
                i = 1;
            }
            var ai = new int[i * field_756_e][];

            for (int i2 = 0; i2 < i * field_756_e; i2++)
            {
                ai[i2] = new int[4];
            }
            int j  = (basePos[1] + field_756_e) - field_747_n;
            int k  = 1;
            int l  = basePos[1] + height;
            int i1 = j - basePos[1];

            ai[0][0] = basePos[0];
            ai[0][1] = j;
            ai[0][2] = basePos[2];
            ai[0][3] = l;
            j--;
            while (i1 >= 0)
            {
                int   j1 = 0;
                float f  = func_431_a(i1);
                if (f < 0.0F)
                {
                    j--;
                    i1--;
                }
                else
                {
                    double d = 0.5D;
                    for (; j1 < i; j1++)
                    {
                        double d1  = field_751_j * (f * (field_759_b.nextFloat() + 0.32800000000000001D));
                        double d2  = field_759_b.nextFloat() * 2D * 3.1415899999999999D;
                        var    k1  = (int)(d1 * Math.sin(d2) + basePos[0] + d);
                        var    l1  = (int)(d1 * Math.cos(d2) + basePos[2] + d);
                        int[]  ai1 =
                        {
                            k1, j, l1
                        };
                        int[] ai2 =
                        {
                            k1, j + field_747_n, l1
                        };
                        if (func_427_a(ai1, ai2) != -1)
                        {
                            continue;
                        }
                        int[] ai3 =
                        {
                            basePos[0], basePos[1], basePos[2]
                        };
                        double d3 =
                            Math.sqrt(Math.pow(Math.abs(basePos[0] - ai1[0]), 2D) +
                                      Math.pow(Math.abs(basePos[2] - ai1[2]), 2D));
                        double d4 = d3 * field_752_i;
                        if (ai1[1] - d4 > l)
                        {
                            ai3[1] = l;
                        }
                        else
                        {
                            ai3[1] = (int)(ai1[1] - d4);
                        }
                        if (func_427_a(ai3, ai1) == -1)
                        {
                            ai[k][0] = k1;
                            ai[k][1] = j;
                            ai[k][2] = l1;
                            ai[k][3] = ai3[1];
                            k++;
                        }
                    }

                    j--;
                    i1--;
                }
            }
            field_746_o = new int[k][];
            for (int i3 = 0; i3 < k; i3++)
            {
                field_746_o[i3] = new int[4];
            }
            Array.Copy(ai, 0, field_746_o, 0, k);
        }
Example #5
0
        private int func_427_a(int[] ai, int[] ai1)
        {
            int[] ai2 =
            {
                0, 0, 0
            };
            byte byte0 = 0;
            int  i     = 0;

            for (; byte0 < 3; byte0++)
            {
                ai2[byte0] = ai1[byte0] - ai[byte0];
                if (Math.abs(ai2[byte0]) > Math.abs(ai2[i]))
                {
                    i = byte0;
                }
            }

            if (ai2[i] == 0)
            {
                return(-1);
            }
            byte  byte1 = field_760_a[i];
            byte  byte2 = field_760_a[i + 3];
            sbyte byte3;

            if (ai2[i] > 0)
            {
                byte3 = 1;
            }
            else
            {
                byte3 = -1;
            }
            double d  = ai2[byte1] / (double)ai2[i];
            double d1 = ai2[byte2] / (double)ai2[i];

            int[] ai3 =
            {
                0, 0, 0
            };
            int j = 0;
            int k = ai2[i] + byte3;

            do
            {
                if (j == k)
                {
                    break;
                }
                ai3[i]     = ai[i] + j;
                ai3[byte1] = (int)(ai[byte1] + j * d);
                ai3[byte2] = (int)(ai[byte2] + j * d1);
                int l = worldObj.getBlockId(ai3[0], ai3[1], ai3[2]);
                if (l != 0 && l != 18)
                {
                    break;
                }
                j += byte3;
            } while (true);
            if (j == k)
            {
                return(-1);
            }
            else
            {
                return(Math.abs(j));
            }
        }