public override void Tick(ScheduledTask task) { if (Disconnected) { return; } physics.Tick(); CheckAsyncResources(); if (generator == null) { return; } if (generator.Done) { EndGeneration(); return; } string state = generator.CurrentState; float progress = generator.CurrentProgress; LoadingMapScreen screen = ((LoadingMapScreen)game.Gui.UnderlyingScreen); screen.SetProgress(progress); if (state == lastState) { return; } lastState = state; screen.SetMessage(state); }
public override void Tick(ScheduledTask task) { if (Disconnected) { return; } physics.Tick(); CheckAsyncResources(); }
public override void Tick(ScheduledTask task) { if (Disconnected) { return; } // Network ticked 60 times a second, only do physics 20 times a second if ((netTicks % 3) == 0) { physics.Tick(); CheckAsyncResources(); } netTicks++; }
public override void Tick(ScheduledTask task) { if (Disconnected) { return; } // Network ticked 60 times a second, only do physics 20 times a second if ((netTicks % 3) == 0) { if (DoDayNightCycle) { Ticks++; } physics.Tick(); game.Mode.Tick(); CheckAsyncResources(); int x, y; if (game.World.ChunkHandler != null) { game.World.ChunkHandler.GetChunkCoords(game.LocalPlayer.Position, out x, out y); if (x != curChunkX || y != curChunkY) { curChunkX = x; curChunkY = y; int cenChunk = game.World.ChunkHandler.ChunkArray.GetLength(0) / 2; int maxChunk = game.World.ChunkHandler.ChunkArray.GetLength(0); int minChunk = 0; //Console.WriteLine("curChunkX: " + curChunkX + ", curChunkY: " + curChunkY); if (curChunkX == cenChunk && curChunkY == cenChunk) { //Console.WriteLine("In center chunk"); //Console.WriteLine(maxChunk); } else if (curChunkX >= ((maxChunk - 1) + maxChunk) || curChunkY >= ((maxChunk - 1) + maxChunk) || curChunkX <= (minChunk - maxChunk) || curChunkY <= (minChunk - maxChunk)) { //Console.WriteLine("outside max bounds"); } } } } netTicks++; }