Ejemplo n.º 1
0
        public virtual MobSpawnerBase[] loadBlockGeneratorData(MobSpawnerBase[] amobspawnerbase, int i, int j, int k,
                                                               int l)
        {
            if (amobspawnerbase == null || amobspawnerbase.Length < k * l)
            {
                amobspawnerbase = new MobSpawnerBase[k * l];
            }
            temperature = field_4255_e.func_4101_a(temperature, i, j, k, k, 0.02500000037252903D, 0.02500000037252903D,
                                                   0.25D);
            humidity = field_4254_f.func_4101_a(humidity, i, j, k, k, 0.05000000074505806D, 0.05000000074505806D,
                                                0.33333333333333331D);
            field_4257_c = field_4253_g.func_4101_a(field_4257_c, i, j, k, k, 0.25D, 0.25D, 0.58823529411764708D);
            int i1 = 0;

            for (int j1 = 0; j1 < k; j1++)
            {
                for (int k1 = 0; k1 < l; k1++)
                {
                    double d  = field_4257_c[i1] * 1.1000000000000001D + 0.5D;
                    double d1 = 0.01D;
                    double d2 = 1.0D - d1;
                    double d3 = (temperature[i1] * 0.14999999999999999D + 0.69999999999999996D) * d2 + d * d1;
                    d1 = 0.002D;
                    d2 = 1.0D - d1;
                    double d4 = (humidity[i1] * 0.14999999999999999D + 0.5D) * d2 + d * d1;
                    d3 = 1.0D - (1.0D - d3) * (1.0D - d3);
                    if (d3 < 0.0D)
                    {
                        d3 = 0.0D;
                    }
                    if (d4 < 0.0D)
                    {
                        d4 = 0.0D;
                    }
                    if (d3 > 1.0D)
                    {
                        d3 = 1.0D;
                    }
                    if (d4 > 1.0D)
                    {
                        d4 = 1.0D;
                    }
                    temperature[i1]       = d3;
                    humidity[i1]          = d4;
                    amobspawnerbase[i1++] = MobSpawnerBase.getBiomeFromLookup(d3, d4);
                }
            }

            return(amobspawnerbase);
        }
Ejemplo n.º 2
0
 public override MobSpawnerBase[] loadBlockGeneratorData(MobSpawnerBase[] amobspawnerbase, int i, int j, int k,
                                                         int l)
 {
     if (amobspawnerbase == null || amobspawnerbase.Length < k * l)
     {
         amobspawnerbase = new MobSpawnerBase[k * l];
         temperature     = new double[k * l];
         humidity        = new double[k * l];
     }
     Arrays.fill(amobspawnerbase, 0, k * l, field_4262_e);
     Arrays.fill(humidity, 0, k * l, field_4260_g);
     Arrays.fill(temperature, 0, k * l, field_4261_f);
     return(amobspawnerbase);
 }
Ejemplo n.º 3
0
 public override MobSpawnerBase[] loadBlockGeneratorData(MobSpawnerBase[] amobspawnerbase, int i, int j, int k,
     int l)
 {
     if (amobspawnerbase == null || amobspawnerbase.Length < k*l)
     {
         amobspawnerbase = new MobSpawnerBase[k*l];
         temperature = new double[k*l];
         humidity = new double[k*l];
     }
     Arrays.fill(amobspawnerbase, 0, k*l, field_4262_e);
     Arrays.fill(humidity, 0, k*l, field_4260_g);
     Arrays.fill(temperature, 0, k*l, field_4261_f);
     return amobspawnerbase;
 }
Ejemplo n.º 4
0
        public static int performSpawning(World var0, bool var1, bool var2)
        {
            if (!var1 && !var2)
            {
                return(0);
            }
            else
            {
                eligibleChunksForSpawning.clear();

                int var3;
                int var6;
                for (var3 = 0; var3 < var0.playerEntities.size(); ++var3)
                {
                    var var4 = (EntityPlayer)var0.playerEntities.get(var3);
                    int var5 = MathHelper.floor_double(var4.posX / 16.0D);
                    var6 = MathHelper.floor_double(var4.posZ / 16.0D);
                    byte var7 = 8;

                    for (int var8 = -var7; var8 <= var7; ++var8)
                    {
                        for (int var9 = -var7; var9 <= var7; ++var9)
                        {
                            eligibleChunksForSpawning.add(new ChunkCoordIntPair(var8 + var5, var9 + var6));
                        }
                    }
                }

                var3 = 0;
                ChunkCoordinates   var33 = var0.func_22078_l();
                EnumCreatureType[] var34 = EnumCreatureType.values();
                var6 = var34.Length;

                for (int var35 = 0; var35 < var6; ++var35)
                {
                    EnumCreatureType var36 = var34[var35];
                    if ((!var36.func_21103_d() || var2) && (var36.func_21103_d() || var1) &&
                        var0.countEntities(var36.getCreatureClass()) <=
                        var36.getMaxNumberOfCreature() * eligibleChunksForSpawning.size() / 256)
                    {
                        Iterator var37 = eligibleChunksForSpawning.iterator();

                        while (var37.hasNext())
                        {
                            var            var10 = (ChunkCoordIntPair)var37.next();
                            MobSpawnerBase var11 = var0.getWorldChunkManager().func_4066_a(var10);
                            Class[]        var12 = var11.getEntitiesForType(var36);
                            if (var12 != null && var12.Length != 0)
                            {
                                int           var13 = var0.rand.nextInt(var12.Length);
                                ChunkPosition var14 = getRandomSpawningPointInChunk(var0, var10.chunkXPos * 16,
                                                                                    var10.chunkZPos * 16);
                                int var15 = var14.x;
                                int var16 = var14.y;
                                int var17 = var14.z;
                                if (!var0.isBlockOpaqueCube(var15, var16, var17) &&
                                    var0.getBlockMaterial(var15, var16, var17) == var36.getCreatureMaterial())
                                {
                                    int var18 = 0;

                                    for (int var19 = 0; var19 < 3; ++var19)
                                    {
                                        int  var20 = var15;
                                        int  var21 = var16;
                                        int  var22 = var17;
                                        byte var23 = 6;

                                        for (int var24 = 0; var24 < 4; ++var24)
                                        {
                                            var20 += var0.rand.nextInt(var23) - var0.rand.nextInt(var23);
                                            var21 += var0.rand.nextInt(1) - var0.rand.nextInt(1);
                                            var22 += var0.rand.nextInt(var23) - var0.rand.nextInt(var23);
                                            if (func_21167_a(var36, var0, var20, var21, var22))
                                            {
                                                float var25 = var20 + 0.5F;
                                                float var26 = var21;
                                                float var27 = var22 + 0.5F;
                                                if (
                                                    var0.getClosestPlayer(var25, var26, var27,
                                                                          24.0D) == null)
                                                {
                                                    float var28 = var25 - var33.posX;
                                                    float var29 = var26 - var33.posY;
                                                    float var30 = var27 - var33.posZ;
                                                    float var31 = var28 * var28 + var29 * var29 + var30 * var30;
                                                    if (var31 >= 576.0F)
                                                    {
                                                        EntityLiving var38;
                                                        try
                                                        {
                                                            var38 =
                                                                (EntityLiving)
                                                                var12[var13].getConstructor(new Class[] { typeof(World) })
                                                                .newInstance(new object[] { var0 });
                                                        }
                                                        catch (Exception var32)
                                                        {
                                                            var32.printStackTrace();
                                                            return(var3);
                                                        }

                                                        var38.setLocationAndAngles(var25, var26,
                                                                                   var27,
                                                                                   var0.rand.nextFloat() * 360.0F, 0.0F);
                                                        if (var38.getCanSpawnHere())
                                                        {
                                                            ++var18;
                                                            var0.entityJoinedWorld(var38);
                                                            func_21166_a(var38, var0, var25, var26, var27);
                                                            if (var18 >= var38.getMaxSpawnedInChunk())
                                                            {
                                                                continue;
                                                            }
                                                        }

                                                        var3 += var18;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                return(var3);
            }
        }
Ejemplo n.º 5
0
        public void generateTerrain(int i, int j, byte[] abyte0, MobSpawnerBase[] amobspawnerbase, double[] ad)
        {
            byte byte0 = 4;
            byte byte1 = 64;
            int k = byte0 + 1;
            byte byte2 = 17;
            int l = byte0 + 1;
            field_4224_q = func_4058_a(field_4224_q, i*byte0, 0, j*byte0, k, byte2, l);
            for (int i1 = 0; i1 < byte0; i1++)
            {
                for (int j1 = 0; j1 < byte0; j1++)
                {
                    for (int k1 = 0; k1 < 16; k1++)
                    {
                        double d = 0.125D;
                        double d1 = field_4224_q[((i1 + 0)*l + (j1 + 0))*byte2 + (k1 + 0)];
                        double d2 = field_4224_q[((i1 + 0)*l + (j1 + 1))*byte2 + (k1 + 0)];
                        double d3 = field_4224_q[((i1 + 1)*l + (j1 + 0))*byte2 + (k1 + 0)];
                        double d4 = field_4224_q[((i1 + 1)*l + (j1 + 1))*byte2 + (k1 + 0)];
                        double d5 = (field_4224_q[((i1 + 0)*l + (j1 + 0))*byte2 + (k1 + 1)] - d1)*d;
                        double d6 = (field_4224_q[((i1 + 0)*l + (j1 + 1))*byte2 + (k1 + 1)] - d2)*d;
                        double d7 = (field_4224_q[((i1 + 1)*l + (j1 + 0))*byte2 + (k1 + 1)] - d3)*d;
                        double d8 = (field_4224_q[((i1 + 1)*l + (j1 + 1))*byte2 + (k1 + 1)] - d4)*d;
                        for (int l1 = 0; l1 < 8; l1++)
                        {
                            double d9 = 0.25D;
                            double d10 = d1;
                            double d11 = d2;
                            double d12 = (d3 - d1)*d9;
                            double d13 = (d4 - d2)*d9;
                            for (int i2 = 0; i2 < 4; i2++)
                            {
                                int j2 = i2 + i1*4 << 11 | 0 + j1*4 << 7 | k1*8 + l1;
                                char c = '\x0080'; // '\200';
                                double d14 = 0.25D;
                                double d15 = d10;
                                double d16 = (d11 - d10)*d14;
                                for (int k2 = 0; k2 < 4; k2++)
                                {
                                    double d17 = ad[(i1*4 + i2)*16 + (j1*4 + k2)];
                                    int l2 = 0;
                                    if (k1*8 + l1 < byte1)
                                    {
                                        if (d17 < 0.5D && k1*8 + l1 >= byte1 - 1)
                                        {
                                            l2 = Block.ice.blockID;
                                        }
                                        else
                                        {
                                            l2 = Block.waterMoving.blockID;
                                        }
                                    }
                                    if (d15 > 0.0D)
                                    {
                                        l2 = Block.stone.blockID;
                                    }
                                    abyte0[j2] = (byte) l2;
                                    j2 += c;
                                    d15 += d16;
                                }

                                d10 += d12;
                                d11 += d13;
                            }

                            d1 += d5;
                            d2 += d6;
                            d3 += d7;
                            d4 += d8;
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public void replaceBlocksForBiome(int i, int j, byte[] abyte0, MobSpawnerBase[] amobspawnerbase)
 {
     byte byte0 = 64;
     double d = 0.03125D;
     sandNoise = field_702_n.generateNoiseOctaves(sandNoise, i*16, j*16, 0.0D, 16, 16, 1, d, d, 1.0D);
     gravelNoise = field_702_n.generateNoiseOctaves(gravelNoise, i*16, 109.0134D, j*16, 16, 1, 16, d, 1.0D, d);
     stoneNoise = field_701_o.generateNoiseOctaves(stoneNoise, i*16, j*16, 0.0D, 16, 16, 1, d*2D, d*2D, d*2D);
     for (int k = 0; k < 16; k++)
     {
         for (int l = 0; l < 16; l++)
         {
             MobSpawnerBase mobspawnerbase = amobspawnerbase[k + l*16];
             bool flag = sandNoise[k + l*16] + rand.nextDouble()*0.20000000000000001D > 0.0D;
             bool flag1 = gravelNoise[k + l*16] + rand.nextDouble()*0.20000000000000001D > 3D;
             var i1 = (int) (stoneNoise[k + l*16]/3D + 3D + rand.nextDouble()*0.25D);
             int j1 = -1;
             byte byte1 = mobspawnerbase.topBlock;
             byte byte2 = mobspawnerbase.fillerBlock;
             for (int k1 = 127; k1 >= 0; k1--)
             {
                 int l1 = (l*16 + k)*128 + k1;
                 if (k1 <= 0 + rand.nextInt(5))
                 {
                     abyte0[l1] = (byte) Block.bedrock.blockID;
                     continue;
                 }
                 byte byte3 = abyte0[l1];
                 if (byte3 == 0)
                 {
                     j1 = -1;
                     continue;
                 }
                 if (byte3 != Block.stone.blockID)
                 {
                     continue;
                 }
                 if (j1 == -1)
                 {
                     if (i1 <= 0)
                     {
                         byte1 = 0;
                         byte2 = (byte) Block.stone.blockID;
                     }
                     else if (k1 >= byte0 - 4 && k1 <= byte0 + 1)
                     {
                         byte1 = mobspawnerbase.topBlock;
                         byte2 = mobspawnerbase.fillerBlock;
                         if (flag1)
                         {
                             byte1 = 0;
                         }
                         if (flag1)
                         {
                             byte2 = (byte) Block.gravel.blockID;
                         }
                         if (flag)
                         {
                             byte1 = (byte) Block.sand.blockID;
                         }
                         if (flag)
                         {
                             byte2 = (byte) Block.sand.blockID;
                         }
                     }
                     if (k1 < byte0 && byte1 == 0)
                     {
                         byte1 = (byte) Block.waterMoving.blockID;
                     }
                     j1 = i1;
                     if (k1 >= byte0 - 1)
                     {
                         abyte0[l1] = byte1;
                     }
                     else
                     {
                         abyte0[l1] = byte2;
                     }
                     continue;
                 }
                 if (j1 <= 0)
                 {
                     continue;
                 }
                 j1--;
                 abyte0[l1] = byte2;
                 if (j1 == 0 && byte2 == Block.sand.blockID)
                 {
                     j1 = rand.nextInt(4);
                     byte2 = (byte) Block.sandStone.blockID;
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
 public WorldChunkManagerHell(MobSpawnerBase mobspawnerbase, double d, double d1)
 {
     field_4262_e = mobspawnerbase;
     field_4261_f = d;
     field_4260_g = d1;
 }
Ejemplo n.º 8
0
 public WorldChunkManagerHell(MobSpawnerBase mobspawnerbase, double d, double d1)
 {
     field_4262_e = mobspawnerbase;
     field_4261_f = d;
     field_4260_g = d1;
 }
Ejemplo n.º 9
0
        public void populate(IChunkProvider ichunkprovider, int i, int j)
        {
            BlockSand.fallInstantly = true;
            int            k = i * 16;
            int            l = j * 16;
            MobSpawnerBase mobspawnerbase = worldObj.getWorldChunkManager().func_4067_a(k + 16, l + 16);

            rand.setSeed(worldObj.func_22079_j());
            long l1 = (rand.nextLong() / 2L) * 2L + 1L;
            long l2 = (rand.nextLong() / 2L) * 2L + 1L;

            rand.setSeed(i * l1 + j * l2 ^ worldObj.func_22079_j());
            double d = 0.25D;

            if (rand.nextInt(4) == 0)
            {
                int i1 = k + rand.nextInt(16) + 8;
                int l4 = rand.nextInt(128);
                int i8 = l + rand.nextInt(16) + 8;
                (new WorldGenLakes(Block.waterMoving.blockID)).generate(worldObj, rand, i1, l4, i8);
            }
            if (rand.nextInt(8) == 0)
            {
                int j1 = k + rand.nextInt(16) + 8;
                int i5 = rand.nextInt(rand.nextInt(120) + 8);
                int j8 = l + rand.nextInt(16) + 8;
                if (i5 < 64 || rand.nextInt(10) == 0)
                {
                    (new WorldGenLakes(Block.lavaMoving.blockID)).generate(worldObj, rand, j1, i5, j8);
                }
            }
            for (int k1 = 0; k1 < 8; k1++)
            {
                int j5  = k + rand.nextInt(16) + 8;
                int k8  = rand.nextInt(128);
                int i13 = l + rand.nextInt(16) + 8;
                (new WorldGenDungeons()).generate(worldObj, rand, j5, k8, i13);
            }

            for (int i2 = 0; i2 < 10; i2++)
            {
                int k5  = k + rand.nextInt(16);
                int l8  = rand.nextInt(128);
                int j13 = l + rand.nextInt(16);
                (new WorldGenClay(32)).generate(worldObj, rand, k5, l8, j13);
            }

            for (int j2 = 0; j2 < 20; j2++)
            {
                int l5  = k + rand.nextInt(16);
                int i9  = rand.nextInt(128);
                int k13 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.dirt.blockID, 32)).generate(worldObj, rand, l5, i9, k13);
            }

            for (int k2 = 0; k2 < 10; k2++)
            {
                int i6  = k + rand.nextInt(16);
                int j9  = rand.nextInt(128);
                int l13 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.gravel.blockID, 32)).generate(worldObj, rand, i6, j9, l13);
            }

            for (int i3 = 0; i3 < 20; i3++)
            {
                int j6  = k + rand.nextInt(16);
                int k9  = rand.nextInt(128);
                int i14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(worldObj, rand, j6, k9, i14);
            }

            for (int j3 = 0; j3 < 20; j3++)
            {
                int k6  = k + rand.nextInt(16);
                int l9  = rand.nextInt(64);
                int j14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreIron.blockID, 8)).generate(worldObj, rand, k6, l9, j14);
            }

            for (int k3 = 0; k3 < 2; k3++)
            {
                int l6  = k + rand.nextInt(16);
                int i10 = rand.nextInt(32);
                int k14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreGold.blockID, 8)).generate(worldObj, rand, l6, i10, k14);
            }

            for (int l3 = 0; l3 < 8; l3++)
            {
                int i7  = k + rand.nextInt(16);
                int j10 = rand.nextInt(16);
                int l14 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreRedstone.blockID, 7)).generate(worldObj, rand, i7, j10, l14);
            }

            for (int i4 = 0; i4 < 1; i4++)
            {
                int j7  = k + rand.nextInt(16);
                int k10 = rand.nextInt(16);
                int i15 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(worldObj, rand, j7, k10, i15);
            }

            for (int j4 = 0; j4 < 1; j4++)
            {
                int k7  = k + rand.nextInt(16);
                int l10 = rand.nextInt(16) + rand.nextInt(16);
                int j15 = l + rand.nextInt(16);
                (new WorldGenMinable(Block.oreLapis.blockID, 6)).generate(worldObj, rand, k7, l10, j15);
            }

            d = 0.5D;
            var k4 = (int)((mobSpawnerNoise.func_647_a(k * d, l * d) / 8D + rand.nextDouble() * 4D + 4D) / 3D);
            int l7 = 0;

            if (rand.nextInt(10) == 0)
            {
                l7++;
            }
            if (mobspawnerbase == MobSpawnerBase.forest)
            {
                l7 += k4 + 5;
            }
            if (mobspawnerbase == MobSpawnerBase.rainforest)
            {
                l7 += k4 + 5;
            }
            if (mobspawnerbase == MobSpawnerBase.seasonalForest)
            {
                l7 += k4 + 2;
            }
            if (mobspawnerbase == MobSpawnerBase.taiga)
            {
                l7 += k4 + 5;
            }
            if (mobspawnerbase == MobSpawnerBase.desert)
            {
                l7 -= 20;
            }
            if (mobspawnerbase == MobSpawnerBase.tundra)
            {
                l7 -= 20;
            }
            if (mobspawnerbase == MobSpawnerBase.plains)
            {
                l7 -= 20;
            }
            for (int i11 = 0; i11 < l7; i11++)
            {
                int            k15            = k + rand.nextInt(16) + 8;
                int            j18            = l + rand.nextInt(16) + 8;
                WorldGenerator worldgenerator = mobspawnerbase.getRandomWorldGenForTrees(rand);
                worldgenerator.func_420_a(1.0D, 1.0D, 1.0D);
                worldgenerator.generate(worldObj, rand, k15, worldObj.getHeightValue(k15, j18), j18);
            }

            for (int j11 = 0; j11 < 2; j11++)
            {
                int l15 = k + rand.nextInt(16) + 8;
                int k18 = rand.nextInt(128);
                int i21 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.plantYellow.blockID)).generate(worldObj, rand, l15, k18, i21);
            }

            if (rand.nextInt(2) == 0)
            {
                int k11 = k + rand.nextInt(16) + 8;
                int i16 = rand.nextInt(128);
                int l18 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.plantRed.blockID)).generate(worldObj, rand, k11, i16, l18);
            }
            if (rand.nextInt(4) == 0)
            {
                int l11 = k + rand.nextInt(16) + 8;
                int j16 = rand.nextInt(128);
                int i19 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(worldObj, rand, l11, j16, i19);
            }
            if (rand.nextInt(8) == 0)
            {
                int i12 = k + rand.nextInt(16) + 8;
                int k16 = rand.nextInt(128);
                int j19 = l + rand.nextInt(16) + 8;
                (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(worldObj, rand, i12, k16, j19);
            }
            for (int j12 = 0; j12 < 10; j12++)
            {
                int l16 = k + rand.nextInt(16) + 8;
                int k19 = rand.nextInt(128);
                int j21 = l + rand.nextInt(16) + 8;
                (new WorldGenReed()).generate(worldObj, rand, l16, k19, j21);
            }

            if (rand.nextInt(32) == 0)
            {
                int k12 = k + rand.nextInt(16) + 8;
                int i17 = rand.nextInt(128);
                int l19 = l + rand.nextInt(16) + 8;
                (new WorldGenPumpkin()).generate(worldObj, rand, k12, i17, l19);
            }
            int l12 = 0;

            if (mobspawnerbase == MobSpawnerBase.desert)
            {
                l12 += 10;
            }
            for (int j17 = 0; j17 < l12; j17++)
            {
                int i20 = k + rand.nextInt(16) + 8;
                int k21 = rand.nextInt(128);
                int k22 = l + rand.nextInt(16) + 8;
                (new WorldGenCactus()).generate(worldObj, rand, i20, k21, k22);
            }

            for (int k17 = 0; k17 < 50; k17++)
            {
                int j20 = k + rand.nextInt(16) + 8;
                int l21 = rand.nextInt(rand.nextInt(120) + 8);
                int l22 = l + rand.nextInt(16) + 8;
                (new WorldGenLiquids(Block.waterStill.blockID)).generate(worldObj, rand, j20, l21, l22);
            }

            for (int l17 = 0; l17 < 20; l17++)
            {
                int k20 = k + rand.nextInt(16) + 8;
                int i22 = rand.nextInt(rand.nextInt(rand.nextInt(112) + 8) + 8);
                int i23 = l + rand.nextInt(16) + 8;
                (new WorldGenLiquids(Block.lavaStill.blockID)).generate(worldObj, rand, k20, i22, i23);
            }

            generatedTemperatures = worldObj.getWorldChunkManager().getTemperatures(generatedTemperatures, k + 8, l + 8,
                                                                                    16, 16);
            for (int i18 = k + 8; i18 < k + 8 + 16; i18++)
            {
                for (int l20 = l + 8; l20 < l + 8 + 16; l20++)
                {
                    int    j22 = i18 - (k + 8);
                    int    j23 = l20 - (l + 8);
                    int    k23 = worldObj.findTopSolidBlock(i18, l20);
                    double d1  = generatedTemperatures[j22 * 16 + j23] - ((k23 - 64) / 64D) * 0.29999999999999999D;
                    if (d1 < 0.5D && k23 > 0 && k23 < 128 && worldObj.isAirBlock(i18, k23, l20) &&
                        worldObj.getBlockMaterial(i18, k23 - 1, l20).getIsSolid() &&
                        worldObj.getBlockMaterial(i18, k23 - 1, l20) != Material.ice)
                    {
                        worldObj.setBlockWithNotify(i18, k23, l20, Block.snow.blockID);
                    }
                }
            }

            BlockSand.fallInstantly = false;
        }
Ejemplo n.º 10
0
        public void replaceBlocksForBiome(int i, int j, byte[] abyte0, MobSpawnerBase[] amobspawnerbase)
        {
            byte   byte0 = 64;
            double d     = 0.03125D;

            sandNoise   = field_702_n.generateNoiseOctaves(sandNoise, i * 16, j * 16, 0.0D, 16, 16, 1, d, d, 1.0D);
            gravelNoise = field_702_n.generateNoiseOctaves(gravelNoise, i * 16, 109.0134D, j * 16, 16, 1, 16, d, 1.0D, d);
            stoneNoise  = field_701_o.generateNoiseOctaves(stoneNoise, i * 16, j * 16, 0.0D, 16, 16, 1, d * 2D, d * 2D, d * 2D);
            for (int k = 0; k < 16; k++)
            {
                for (int l = 0; l < 16; l++)
                {
                    MobSpawnerBase mobspawnerbase = amobspawnerbase[k + l * 16];
                    bool           flag           = sandNoise[k + l * 16] + rand.nextDouble() * 0.20000000000000001D > 0.0D;
                    bool           flag1          = gravelNoise[k + l * 16] + rand.nextDouble() * 0.20000000000000001D > 3D;
                    var            i1             = (int)(stoneNoise[k + l * 16] / 3D + 3D + rand.nextDouble() * 0.25D);
                    int            j1             = -1;
                    byte           byte1          = mobspawnerbase.topBlock;
                    byte           byte2          = mobspawnerbase.fillerBlock;
                    for (int k1 = 127; k1 >= 0; k1--)
                    {
                        int l1 = (l * 16 + k) * 128 + k1;
                        if (k1 <= 0 + rand.nextInt(5))
                        {
                            abyte0[l1] = (byte)Block.bedrock.blockID;
                            continue;
                        }
                        byte byte3 = abyte0[l1];
                        if (byte3 == 0)
                        {
                            j1 = -1;
                            continue;
                        }
                        if (byte3 != Block.stone.blockID)
                        {
                            continue;
                        }
                        if (j1 == -1)
                        {
                            if (i1 <= 0)
                            {
                                byte1 = 0;
                                byte2 = (byte)Block.stone.blockID;
                            }
                            else if (k1 >= byte0 - 4 && k1 <= byte0 + 1)
                            {
                                byte1 = mobspawnerbase.topBlock;
                                byte2 = mobspawnerbase.fillerBlock;
                                if (flag1)
                                {
                                    byte1 = 0;
                                }
                                if (flag1)
                                {
                                    byte2 = (byte)Block.gravel.blockID;
                                }
                                if (flag)
                                {
                                    byte1 = (byte)Block.sand.blockID;
                                }
                                if (flag)
                                {
                                    byte2 = (byte)Block.sand.blockID;
                                }
                            }
                            if (k1 < byte0 && byte1 == 0)
                            {
                                byte1 = (byte)Block.waterMoving.blockID;
                            }
                            j1 = i1;
                            if (k1 >= byte0 - 1)
                            {
                                abyte0[l1] = byte1;
                            }
                            else
                            {
                                abyte0[l1] = byte2;
                            }
                            continue;
                        }
                        if (j1 <= 0)
                        {
                            continue;
                        }
                        j1--;
                        abyte0[l1] = byte2;
                        if (j1 == 0 && byte2 == Block.sand.blockID)
                        {
                            j1    = rand.nextInt(4);
                            byte2 = (byte)Block.sandStone.blockID;
                        }
                    }
                }
            }
        }