Exemplo n.º 1
0
        /// <summary>
        /// Drops the specified chunk.
        /// </summary>
        public virtual void DropChunk(int par1, int par2)
        {
            ChunkCoordinates chunkcoordinates = worldObj.GetSpawnPoint();
            int i = (par1 * 16 + 8) - chunkcoordinates.PosX;
            int j = (par2 * 16 + 8) - chunkcoordinates.PosZ;
            int c = 200;

            if (i < -c || i > c || j < -c || j > c)
            {
                droppedChunksSet.Add(ChunkCoordIntPair.ChunkXZ2Int(par1, par2));
            }
        }
Exemplo n.º 2
0
 public virtual bool Equals(object par1Obj)
 {
     if (!(par1Obj is ChunkCoordinates))
     {
         return(false);
     }
     else
     {
         ChunkCoordinates chunkcoordinates = (ChunkCoordinates)par1Obj;
         return(PosX == chunkcoordinates.PosX && PosY == chunkcoordinates.PosY && PosZ == chunkcoordinates.PosZ);
     }
 }
Exemplo n.º 3
0
        private bool IsVillagerPositionPresent(int par1, int par2, int par3)
        {
            for (IEnumerator <ChunkCoordinates> iterator = VillagerPositionsList.GetEnumerator(); iterator.MoveNext();)
            {
                ChunkCoordinates chunkcoordinates = iterator.Current;

                if (chunkcoordinates.PosX == par1 && chunkcoordinates.PosY == par2 && chunkcoordinates.PosZ == par3)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Compare the coordinate with another coordinate
 /// </summary>
 public virtual int CompareChunkCoordinate(ChunkCoordinates par1ChunkCoordinates)
 {
     if (PosY == par1ChunkCoordinates.PosY)
     {
         if (PosZ == par1ChunkCoordinates.PosZ)
         {
             return(PosX - par1ChunkCoordinates.PosX);
         }
         else
         {
             return(PosZ - par1ChunkCoordinates.PosZ);
         }
     }
     else
     {
         return(PosY - par1ChunkCoordinates.PosY);
     }
 }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private static void writeWatchableObject(DataOutputStream par0DataOutputStream, WatchableObject par1WatchableObject) throws IOException
        private static void WriteWatchableObject(BinaryWriter par0DataOutputStream, WatchableObject par1WatchableObject)
        {
            int i = (par1WatchableObject.GetObjectType() << 5 | par1WatchableObject.GetDataValueId() & 0x1f) & 0xff;

            par0DataOutputStream.Write((byte)i);

            switch (par1WatchableObject.GetObjectType())
            {
            case 0:
                par0DataOutputStream.Write((byte)par1WatchableObject.GetObject());
                break;

            case 1:
                par0DataOutputStream.Write((short)par1WatchableObject.GetObject());
                break;

            case 2:
                par0DataOutputStream.Write((int)par1WatchableObject.GetObject());
                break;

            case 3:
                par0DataOutputStream.Write((float)par1WatchableObject.GetObject());
                break;

            case 4:
                Packet.WriteString((string)par1WatchableObject.GetObject(), par0DataOutputStream);
                break;

            case 5:
                ItemStack itemstack = (ItemStack)par1WatchableObject.GetObject();
                par0DataOutputStream.Write(itemstack.GetItem().ShiftedIndex);
                par0DataOutputStream.Write(itemstack.StackSize);
                par0DataOutputStream.Write(itemstack.GetItemDamage());
                break;

            case 6:
                ChunkCoordinates chunkcoordinates = (ChunkCoordinates)par1WatchableObject.GetObject();
                par0DataOutputStream.Write(chunkcoordinates.PosX);
                par0DataOutputStream.Write(chunkcoordinates.PosY);
                par0DataOutputStream.Write(chunkcoordinates.PosZ);
                break;
            }
        }
        /// <summary>
        /// main AI tick function, replaces updateEntityActionState
        /// </summary>
        protected override void UpdateAITick()
        {
            if (--Field_48119_b <= 0)
            {
                Field_48119_b = 70 + Rand.Next(50);
                VillageObj    = WorldObj.VillageCollectionObj.FindNearestVillage(MathHelper2.Floor_double(PosX), MathHelper2.Floor_double(PosY), MathHelper2.Floor_double(PosZ), 32);

                if (VillageObj == null)
                {
                    DetachHome();
                }
                else
                {
                    ChunkCoordinates chunkcoordinates = VillageObj.GetCenter();
                    SetHomeArea(chunkcoordinates.PosX, chunkcoordinates.PosY, chunkcoordinates.PosZ, VillageObj.GetVillageRadius());
                }
            }

            base.UpdateAITick();
        }
Exemplo n.º 7
0
        /// <summary>
        /// The main spawning algorithm, spawns three random creatures of types in the subclass array
        /// </summary>
        public static int PerformSpawning(World par0World, bool par1, bool par2)
        {
            if (!par1 && !par2)
            {
                return(0);
            }
            else
            {
                EligibleChunksForSpawning.Clear();
                int var3;
                int var6;

                for (var3 = 0; var3 < par0World.PlayerEntities.Count; ++var3)
                {
                    EntityPlayer var4 = (EntityPlayer)par0World.PlayerEntities[var3];
                    int          var5 = MathHelper2.Floor_double(var4.PosX / 16.0D);
                    var6 = MathHelper2.Floor_double(var4.PosZ / 16.0D);
                    sbyte var7 = 8;

                    for (int var8 = -var7; var8 <= var7; ++var8)
                    {
                        for (int var9 = -var7; var9 <= var7; ++var9)
                        {
                            bool var10 = var8 == -var7 || var8 == var7 || var9 == -var7 || var9 == var7;
                            ChunkCoordIntPair var11 = new ChunkCoordIntPair(var8 + var5, var9 + var6);

                            if (!var10)
                            {
                                EligibleChunksForSpawning[var11] = false;
                            }
                            else if (!EligibleChunksForSpawning.ContainsKey(var11))
                            {
                                EligibleChunksForSpawning[var11] = true;
                            }
                        }
                    }
                }

                var3 = 0;
                ChunkCoordinates var31 = par0World.GetSpawnPoint();
                CreatureType[]   var32 = CreatureType.GetValues();
                var6 = var32.Length;

                for (int var33 = 0; var33 < var6; ++var33)
                {
                    CreatureType var34 = var32[var33];

                    if ((!var34.IsPeacefulCreature || par2) && (var34.IsPeacefulCreature || par1) && par0World.CountEntities(var34.CreatureClass) <= var34.MaxNumberOfCreature * EligibleChunksForSpawning.Count / 256)
                    {
                        IEnumerator <ChunkCoordIntPair> var35 = EligibleChunksForSpawning.Keys.GetEnumerator();
label108:

                        while (var35.MoveNext())
                        {
                            ChunkCoordIntPair var37 = var35.Current;

                            if (!EligibleChunksForSpawning[var37])
                            {
                                ChunkPosition var36 = GetRandomSpawningPointInChunk(par0World, var37.ChunkXPos, var37.ChunkZPos);
                                int           var12 = var36.x;
                                int           var13 = var36.y;
                                int           var14 = var36.z;

                                if (!par0World.IsBlockNormalCube(var12, var13, var14) && par0World.GetBlockMaterial(var12, var13, var14) == var34.CreatureMaterial)
                                {
                                    int var15 = 0;
                                    int var16 = 0;

                                    while (var16 < 3)
                                    {
                                        int            var17 = var12;
                                        int            var18 = var13;
                                        int            var19 = var14;
                                        sbyte          var20 = 6;
                                        SpawnListEntry var21 = null;
                                        int            var22 = 0;

                                        while (true)
                                        {
                                            if (var22 < 4)
                                            {
label101:
                                                {
                                                    var17 += par0World.Rand.Next(var20) - par0World.Rand.Next(var20);
                                                    var18 += par0World.Rand.Next(1) - par0World.Rand.Next(1);
                                                    var19 += par0World.Rand.Next(var20) - par0World.Rand.Next(var20);

                                                    if (CanCreatureTypeSpawnAtLocation(var34, par0World, var17, var18, var19))
                                                    {
                                                        float var23 = (float)var17 + 0.5F;
                                                        float var24 = (float)var18;
                                                        float var25 = (float)var19 + 0.5F;

                                                        if (par0World.GetClosestPlayer(var23, var24, var25, 24) == null)
                                                        {
                                                            float var26 = var23 - (float)var31.PosX;
                                                            float var27 = var24 - (float)var31.PosY;
                                                            float var28 = var25 - (float)var31.PosZ;
                                                            float var29 = var26 * var26 + var27 * var27 + var28 * var28;

                                                            if (var29 >= 576.0F)
                                                            {
                                                                if (var21 == null)
                                                                {
                                                                    var21 = par0World.GetRandomMob(var34, var17, var18, var19);

                                                                    if (var21 == null)
                                                                    {
                                                                        goto label101;
                                                                    }
                                                                }

                                                                EntityLiving var38;

                                                                try
                                                                {
                                                                    var38 = (EntityLiving)Activator.CreateInstance(var21.EntityClass, new object[] { par0World });
                                                                }
                                                                catch (Exception var30)
                                                                {
                                                                    Console.WriteLine(var30.ToString());
                                                                    Console.Write(var30.StackTrace);
                                                                    return(var3);
                                                                }

                                                                var38.SetLocationAndAngles(var23, var24, var25, (float)par0World.Rand.NextDouble() * 360.0F, 0.0F);

                                                                if (var38.GetCanSpawnHere())
                                                                {
                                                                    ++var15;
                                                                    par0World.SpawnEntityInWorld(var38);
                                                                    CreatureSpecificInit(var38, par0World, var23, var24, var25);

                                                                    if (var15 >= var38.GetMaxSpawnedInChunk())
                                                                    {
                                                                        goto label108;
                                                                    }
                                                                }

                                                                var3 += var15;
                                                            }
                                                        }
                                                    }

                                                    ++var22;
                                                    continue;
                                                }
                                            }

                                            ++var16;
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                return(var3);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the
        /// block.
        /// </summary>
        public override bool BlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
        {
            if (par1World.IsRemote)
            {
                return(true);
            }

            int i = par1World.GetBlockMetadata(par2, par3, par4);

            if (!IsBlockFootOfBed(i))
            {
                int j = GetDirection(i);
                par2 += HeadBlockToFootBlockMap[j][0];
                par4 += HeadBlockToFootBlockMap[j][1];

                if (par1World.GetBlockId(par2, par3, par4) != BlockID)
                {
                    return(true);
                }

                i = par1World.GetBlockMetadata(par2, par3, par4);
            }

            if (!par1World.WorldProvider.CanRespawnHere())
            {
                double d  = (double)par2 + 0.5D;
                double d1 = (double)par3 + 0.5D;
                double d2 = (double)par4 + 0.5D;
                par1World.SetBlockWithNotify(par2, par3, par4, 0);
                int k = GetDirection(i);
                par2 += HeadBlockToFootBlockMap[k][0];
                par4 += HeadBlockToFootBlockMap[k][1];

                if (par1World.GetBlockId(par2, par3, par4) == BlockID)
                {
                    par1World.SetBlockWithNotify(par2, par3, par4, 0);
                    d  = (d + (double)par2 + 0.5D) / 2D;
                    d1 = (d1 + (double)par3 + 0.5D) / 2D;
                    d2 = (d2 + (double)par4 + 0.5D) / 2D;
                }

                par1World.NewExplosion(null, (float)par2 + 0.5F, (float)par3 + 0.5F, (float)par4 + 0.5F, 5F, true);
                return(true);
            }

            if (IsBedOccupied(i))
            {
                EntityPlayer entityplayer           = null;
                IEnumerator <EntityPlayer> iterator = par1World.PlayerEntities.GetEnumerator();

                do
                {
                    if (!iterator.MoveNext())
                    {
                        break;
                    }

                    EntityPlayer entityplayer1 = iterator.Current;

                    if (entityplayer1.IsPlayerSleeping())
                    {
                        ChunkCoordinates chunkcoordinates = entityplayer1.PlayerLocation;

                        if (chunkcoordinates.PosX == par2 && chunkcoordinates.PosY == par3 && chunkcoordinates.PosZ == par4)
                        {
                            entityplayer = entityplayer1;
                        }
                    }
                }while (true);

                if (entityplayer == null)
                {
                    SetBedOccupied(par1World, par2, par3, par4, false);
                }
                else
                {
                    par5EntityPlayer.AddChatMessage("tile.bed.occupied");
                    return(true);
                }
            }

            EnumStatus enumstatus = par5EntityPlayer.SleepInBedAt(par2, par3, par4);

            if (enumstatus == EnumStatus.OK)
            {
                SetBedOccupied(par1World, par2, par3, par4, true);
                return(true);
            }

            if (enumstatus == EnumStatus.NOT_POSSIBLE_NOW)
            {
                par5EntityPlayer.AddChatMessage("tile.bed.noSleep");
            }
            else if (enumstatus == EnumStatus.NOT_SAFE)
            {
                par5EntityPlayer.AddChatMessage("tile.bed.notSafe");
            }

            return(true);
        }
Exemplo n.º 9
0
 public ChunkCoordinates(ChunkCoordinates par1ChunkCoordinates)
 {
     PosX = par1ChunkCoordinates.PosX;
     PosY = par1ChunkCoordinates.PosY;
     PosZ = par1ChunkCoordinates.PosZ;
 }
Exemplo n.º 10
0
        public override void OnTick()
        {
            for (int i = 0; i < 256; i++)
            {
                int j  = CompassIconImageData[i] >> 24 & 0xff;
                int k  = CompassIconImageData[i] >> 16 & 0xff;
                int l  = CompassIconImageData[i] >> 8 & 0xff;
                int i1 = CompassIconImageData[i] >> 0 & 0xff;

                if (AnaglyphEnabled)
                {
                    int j1 = (k * 30 + l * 59 + i1 * 11) / 100;
                    int k1 = (k * 30 + l * 70) / 100;
                    int l1 = (k * 30 + i1 * 70) / 100;
                    k  = j1;
                    l  = k1;
                    i1 = l1;
                }

                ImageData[i * 4 + 0] = (byte)k;
                ImageData[i * 4 + 1] = (byte)l;
                ImageData[i * 4 + 2] = (byte)i1;
                ImageData[i * 4 + 3] = (byte)j;
            }

            double d = 0.0F;

            if (Mc.TheWorld != null && Mc.ThePlayer != null)
            {
                ChunkCoordinates chunkcoordinates = Mc.TheWorld.GetSpawnPoint();
                double           d2 = (double)chunkcoordinates.PosX - Mc.ThePlayer.PosX;
                double           d4 = (double)chunkcoordinates.PosZ - Mc.ThePlayer.PosZ;
                d = ((double)(Mc.ThePlayer.RotationYaw - 90F) * Math.PI) / 180D - Math.Atan2(d4, d2);

                if (!Mc.TheWorld.WorldProvider.Func_48217_e())
                {
                    d = (new Random(1)).NextDouble() * Math.PI * 2D;
                }
            }

            double d1;

            for (d1 = d - Field_4229_i; d1 < -Math.PI; d1 += (Math.PI * 2D))
            {
            }

            for (; d1 >= Math.PI; d1 -= (Math.PI * 2D))
            {
            }

            if (d1 < -1D)
            {
                d1 = -1D;
            }

            if (d1 > 1.0D)
            {
                d1 = 1.0D;
            }

            Field_4228_j += d1 * 0.10000000000000001D;
            Field_4228_j *= 0.80000000000000004D;
            Field_4229_i += Field_4228_j;
            double d3 = Math.Sin(Field_4229_i);
            double d5 = Math.Cos(Field_4229_i);

            for (int i2 = -4; i2 <= 4; i2++)
            {
                int k2 = (int)(8.5D + d5 * (double)i2 * 0.29999999999999999D);
                int i3 = (int)(7.5D - d3 * (double)i2 * 0.29999999999999999D * 0.5D);
                int k3 = i3 * 16 + k2;
                int i4 = 100;
                int k4 = 100;
                int i5 = 100;
                int c  = 377;

                if (AnaglyphEnabled)
                {
                    int k5 = (i4 * 30 + k4 * 59 + i5 * 11) / 100;
                    int i6 = (i4 * 30 + k4 * 70) / 100;
                    int k6 = (i4 * 30 + i5 * 70) / 100;
                    i4 = k5;
                    k4 = i6;
                    i5 = k6;
                }

                ImageData[k3 * 4 + 0] = (byte)i4;
                ImageData[k3 * 4 + 1] = (byte)k4;
                ImageData[k3 * 4 + 2] = (byte)i5;
                ImageData[k3 * 4 + 3] = (byte)c;
            }

            for (int j2 = -8; j2 <= 16; j2++)
            {
                int l2 = (int)(8.5D + d3 * (double)j2 * 0.29999999999999999D);
                int j3 = (int)(7.5D + d5 * (double)j2 * 0.29999999999999999D * 0.5D);
                int l3 = j3 * 16 + l2;
                int j4 = j2 < 0 ? 100 : 255;
                int l4 = j2 < 0 ? 100 : 20;
                int j5 = j2 < 0 ? 100 : 20;
                int c1 = 377;

                if (AnaglyphEnabled)
                {
                    int l5 = (j4 * 30 + l4 * 59 + j5 * 11) / 100;
                    int j6 = (j4 * 30 + l4 * 70) / 100;
                    int l6 = (j4 * 30 + j5 * 70) / 100;
                    j4 = l5;
                    l4 = j6;
                    j5 = l6;
                }

                ImageData[l3 * 4 + 0] = (byte)j4;
                ImageData[l3 * 4 + 1] = (byte)l4;
                ImageData[l3 * 4 + 2] = (byte)j5;
                ImageData[l3 * 4 + 3] = (byte)c1;
            }
        }
Exemplo n.º 11
0
        private bool Func_48574_b()
        {
            List <EntityPlayer> list = Field_48582_a.PlayerEntities;

            for (IEnumerator <EntityPlayer> iterator = list.GetEnumerator(); iterator.MoveNext();)
            {
                EntityPlayer entityplayer = iterator.Current;
                Field_48576_f = Field_48582_a.VillageCollectionObj.FindNearestVillage((int)entityplayer.PosX, (int)entityplayer.PosY, (int)entityplayer.PosZ, 1);

                if (Field_48576_f != null && Field_48576_f.GetNumVillageDoors() >= 10 && Field_48576_f.GetTicksSinceLastDoorAdding() >= 20 && Field_48576_f.GetNumVillagers() >= 20)
                {
                    ChunkCoordinates chunkcoordinates = Field_48576_f.GetCenter();
                    float            f    = Field_48576_f.GetVillageRadius();
                    bool             flag = false;
                    int i = 0;

                    do
                    {
                        if (i >= 10)
                        {
                            break;
                        }

                        Field_48577_g = chunkcoordinates.PosX + (int)((double)(MathHelper2.Cos(Field_48582_a.Rand.NextFloat() * (float)Math.PI * 2.0F) * f) * 0.90000000000000002D);
                        Field_48583_h = chunkcoordinates.PosY;
                        Field_48584_i = chunkcoordinates.PosZ + (int)((double)(MathHelper2.Sin(Field_48582_a.Rand.NextFloat() * (float)Math.PI * 2.0F) * f) * 0.90000000000000002D);
                        flag          = false;
                        IEnumerator <Village> iterator1 = Field_48582_a.VillageCollectionObj.Func_48554_b().GetEnumerator();

                        do
                        {
                            if (!iterator1.MoveNext())
                            {
                                break;
                            }

                            Village village = iterator1.Current;

                            if (village == Field_48576_f || !village.IsInRange(Field_48577_g, Field_48583_h, Field_48584_i))
                            {
                                continue;
                            }

                            flag = true;
                            break;
                        }while (true);

                        if (!flag)
                        {
                            break;
                        }

                        i++;
                    }while (true);

                    if (flag)
                    {
                        return(false);
                    }

                    Vec3D vec3d = Func_48572_a(Field_48577_g, Field_48583_h, Field_48584_i);

                    if (vec3d != null)
                    {
                        Field_48579_e = 0;
                        Field_48578_d = 20;
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 12
0
        private void InitWorld(net.minecraft.src.ISaveFormat isaveformat, string name, long seed)
        {
            if (isaveformat.IsOldSaveType(name))
            {
                logger.Info("Converting map!");
                isaveformat.ConverMapToMCRegion(name, new net.minecraft.src.ConvertProgressUpdater(this));
            }

            // CRAFTBUKKIT/SHARP start -- TODO Multiworld bukkit shit
            /* Initialize dimensions 0 and -1 (surface and nether) */
            worlds = new List <WorldServer>();// new net.minecraft.src.WorldServer[2];
            //net.minecraft.src.ServerNBTManager saveolddir = new net.minecraft.src.ServerNBTManager(".", name, true);
            for (int i = 0; i < (this.propertyManager.GetBoolean("allow-nether", true) ? 2 : 1); i++)
            {
                string      newname = i == 0 ? name : $"{name}_nether";
                WorldServer world;
                if (i == 0)
                {
                    world = new net.minecraft.src.WorldServer(this, new net.minecraft.src.ServerNBTManager(".", newname, true), newname, i != 0 ? -1 : 0, seed);
                }
                else
                {
                    string newpath = System.IO.Path.Combine(newname, "DIM-1");
                    string oldpath = System.IO.Path.Combine(name, "DIM-1");

                    if (System.IO.Directory.Exists(oldpath) && !System.IO.Directory.Exists(newpath))
                    {
                        logger.Info("---- Migration of old nether folder required ----");
                        logger.Info("Unfortunately due to the way that Minecraft implemented multiworld support in 1.6, Bukkit requires that you move your nether folder to a new location in order to operate correctly.");
                        logger.Info("We will move this folder for you, but it will mean that you need to move it back should you wish to stop using Bukkit in the future.");
                        logger.Info("Attempting to move " + oldpath + " to " + newpath + "...");

                        if (System.IO.File.Exists(newpath))
                        {
                            logger.Severe("A file or folder already exists at " + newpath + "!");
                            logger.Info("---- Migration of old nether folder failed ----");
                        }
                        else
                        {
                            try
                            {
                                System.IO.Directory.CreateDirectory(newname);
                                System.IO.Directory.Move(oldpath, newpath);

                                logger.Info("Success! To restore the nether in the future, simply move " + newpath + " to " + oldpath);
                                logger.Info("---- Migration of old nether folder complete ----");
                            }
                            catch (Exception e)
                            {
                                logger.Severe("An exception of type " + e.GetType().Name + " occurred!");
                                logger.Info("---- Migration of old nether folder failed ----");
                            }
                        }
                    }

                    world = new net.minecraft.src.SecondaryWorldServer(this, new net.minecraft.src.ServerNBTManager(".", newname, true), newname, i != 0 ? -1 : 0, seed, worlds[0]);
                }

                world.tracker = new EntityTracker(this, world);
                world.AddWorldAccess(new net.minecraft.src.WorldManager(this, world));
                world.difficultySetting = propertyManager.GetBoolean("spawn-monsters", true) ? 1 : 0;
                world.SetSpawnFlags(propertyManager.GetBoolean("spawn-monsters", true), spawnPeacefulMobs);
                worlds.Add(world);

                serverConfigurationManager.SetPlayerManager(worlds.ToArray());
            }
            // CRAFTBUKKIT/SHARP end

            short c         = 196;// '\304';
            long  timeStart = Sharpen.Runtime.CurrentTimeMillis();

            for (int i = 0; i < worlds.Count; i++)
            {
                //if (i != 0 && !propertyManagerObj.GetBooleanProperty("allow-nether", true))
                //    continue;

                Stopwatch sw = new Stopwatch();
                sw.Start();
                net.minecraft.src.WorldServer worldserver = worlds[i];

                logger.Info($"Preparing start region for level {i} (Seed: {worldserver.GetSeed()})");

                net.minecraft.src.ChunkCoordinates chunkcoordinates = worldserver.GetSpawnPoint();
                for (int k = -c; k <= c && serverRunning; k += 16)
                {
                    for (int i1 = -c; i1 <= c && serverRunning; i1 += 16)
                    {
                        long timeCurrent = Sharpen.Runtime.CurrentTimeMillis();
                        if (timeCurrent < timeStart)
                        {
                            timeStart = timeCurrent;
                        }
                        if (timeCurrent > timeStart + 1000L)
                        {
                            int j1 = (c * 2 + 1) * (c * 2 + 1);
                            int k1 = (k + c) * (c * 2 + 1) + (i1 + 1);
                            OutputPercentRemaining("Preparing spawn area", (k1 * 100) / j1);
                            timeStart = timeCurrent;
                        }
                        worldserver.chunkProviderServer.LoadChunk(chunkcoordinates.posX + k >> 4, chunkcoordinates.posZ + i1 >> 4);
                        while (worldserver.DoLighting() && serverRunning)
                        {
                        }
                    }
                }
                sw.Stop();
                logger.Fine($"Completed world gen {i} in {sw.Elapsed.TotalSeconds:0.000}s");
            }
            ClearCurrentTask();
        }