public void SpawnLobby(Player player) { if (player.Level is xCoreLevel) { if (player.GameMode != GameMode.Survival || player.AllowFly) { player.IsSpectator = false; player.AllowFly = false; //player.SetAllowFly(true); player.IsAlwaysShowName = true; //player.SetGameMode(GameMode.Survival); player.GameMode = GameMode.Survival; } player.IsInvisible = false; player.NameTag = player.Username; //lock (((xPlayer)player).DynamicInvSync) // player.DynInventory = null; player.HealthManager.MaxHealth = 200; player.HealthManager.ResetHealth(); ((xCoreHungerManager)player.HungerManager).SetProcess(); ((xCoreHungerManager)player.HungerManager).Regen = true; player.IsWorldImmutable = true; player.NoAi = false; player.RemoveAllEffects(); Action action = new Action(() => { /*byte x = 0; * foreach (var d in Auth.DynManager.Inv) * { * if (d.Value.Start) * player.Inventory.Slots[x++] = d.Value.getItem(player); * } * Item item = ItemFactory.GetItem(131); * player.Inventory.Slots[x++] = item;*/ }); Task.Run(() => { ((xPlayer)player).SpawnLevelAction(Context.Server.LevelManager.GetLevel(null, "overworld"), true, action); BossBar.SendBossEventBar(player, 0); BossBar.SendName(player, "§l§eДобро пожаловать на §3Cristalix §aPocket Edition"); BossBar.SendBossEventBar(player, 0); }); } }