Ejemplo n.º 1
0
 public virtual net.minecraft.src.Chunk ProvideChunk(int i, int j)
 {
     rand.SetSeed((long)i *unchecked ((long)(0x4f9939f508L)) + (long)j *unchecked ((long
                                                                                    )(0x1ef1565bd5L)));
     byte[] abyte0 = new byte[32768];
     net.minecraft.src.Chunk chunk = new net.minecraft.src.Chunk(worldObj, abyte0, i, j);
     biomesForGeneration = worldObj.GetWorldChunkManager().LoadBlockGeneratorData(biomesForGeneration, i * 16, j * 16, 16, 16);
     double[] ad = worldObj.GetWorldChunkManager().temperature;
     GenerateTerrain(i, j, abyte0, biomesForGeneration, ad);
     ReplaceBlocksForBiome(i, j, abyte0, biomesForGeneration);
     field_695_u.Func_667_a(this, worldObj, i, j, abyte0);
     chunk.Func_353_b();
     return(chunk);
 }
Ejemplo n.º 2
0
 public virtual net.minecraft.src.Chunk ProvideChunk(int i, int j)
 {
     field_28085_j.SetSeed((long)i *unchecked ((long)(0x4f9939f508L)) + (long)j *unchecked (
                               (long)(0x1ef1565bd5L)));
     byte[] abyte0 = new byte[32768];
     net.minecraft.src.Chunk chunk = new net.minecraft.src.Chunk(field_28079_p, abyte0
                                                                 , i, j);
     field_28073_v = field_28079_p.GetWorldChunkManager().LoadBlockGeneratorData(field_28073_v
                                                                                 , i * 16, j * 16, 16, 16);
     double[] ad = field_28079_p.GetWorldChunkManager().temperature;
     Func_28070_a(i, j, abyte0, field_28073_v, ad);
     Func_28069_a(i, j, abyte0, field_28073_v);
     field_28074_u.Func_667_a(this, field_28079_p, i, j, abyte0);
     chunk.Func_353_b();
     return(chunk);
 }
Ejemplo n.º 3
0
        public static net.minecraft.src.Chunk LoadChunkIntoWorldFromCompound(net.minecraft.src.World
                                                                             world, net.minecraft.src.NBTTagCompound nbttagcompound)
        {
            int i = nbttagcompound.GetInteger("xPos");
            int j = nbttagcompound.GetInteger("zPos");

            net.minecraft.src.Chunk chunk = new net.minecraft.src.Chunk(world, i, j);
            chunk.blocks = nbttagcompound.GetByteArray("Blocks");
            chunk.data   = new net.minecraft.src.NibbleArray(nbttagcompound.GetByteArray("Data"
                                                                                         ));
            chunk.skylightMap = new net.minecraft.src.NibbleArray(nbttagcompound.GetByteArray
                                                                      ("SkyLight"));
            chunk.blocklightMap = new net.minecraft.src.NibbleArray(nbttagcompound.GetByteArray
                                                                        ("BlockLight"));
            chunk.heightMap          = nbttagcompound.GetByteArray("HeightMap");
            chunk.isTerrainPopulated = nbttagcompound.GetBoolean("TerrainPopulated");
            if (!chunk.data.IsValid())
            {
                chunk.data = new net.minecraft.src.NibbleArray(chunk.blocks.Length);
            }
            if (chunk.heightMap == null || !chunk.skylightMap.IsValid())
            {
                chunk.heightMap   = new byte[256];
                chunk.skylightMap = new net.minecraft.src.NibbleArray(chunk.blocks.Length);
                chunk.Func_353_b();
            }
            if (!chunk.blocklightMap.IsValid())
            {
                chunk.blocklightMap = new net.minecraft.src.NibbleArray(chunk.blocks.Length);
                chunk.Func_348_a();
            }
            net.minecraft.src.NBTTagList nbttaglist = nbttagcompound.GetTagList("Entities");
            if (nbttaglist != null)
            {
                for (int k = 0; k < nbttaglist.TagCount(); k++)
                {
                    net.minecraft.src.NBTTagCompound nbttagcompound1 = (net.minecraft.src.NBTTagCompound
                                                                        )nbttaglist.TagAt(k);
                    net.minecraft.src.Entity entity = net.minecraft.src.EntityList.CreateEntityFromNBT
                                                          (nbttagcompound1, world);
                    chunk.hasEntities = true;
                    if (entity != null)
                    {
                        chunk.AddEntity(entity);
                    }
                }
            }
            net.minecraft.src.NBTTagList nbttaglist1 = nbttagcompound.GetTagList("TileEntities"
                                                                                 );
            if (nbttaglist1 != null)
            {
                for (int l = 0; l < nbttaglist1.TagCount(); l++)
                {
                    net.minecraft.src.NBTTagCompound nbttagcompound2 = (net.minecraft.src.NBTTagCompound
                                                                        )nbttaglist1.TagAt(l);
                    net.minecraft.src.TileEntity tileentity = net.minecraft.src.TileEntity.CreateAndLoadEntity
                                                                  (nbttagcompound2);
                    if (tileentity != null)
                    {
                        chunk.AddTileEntity(tileentity);
                    }
                }
            }
            return(chunk);
        }