• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MiNET.Player类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MiNET.Player的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Player类属于MiNET命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PlayerInventory

        public PlayerInventory(Player player)
        {
            Player = player;
            Slots = Enumerable.Repeat(new ItemStack(), 35).ToList();
            //int c = 0;
            //Slots[++c] = new ItemStack(new ItemBow(0), 3);
            //Slots[++c] = new ItemStack(262, 64);
            //Slots[++c] = new ItemStack(new ItemSteak(), 1);
            //Slots[++c] = new ItemStack(new ItemApple(), 1);
            //Slots[++c] = new ItemStack(new ItemBakedPotato(), 1);
            //Slots[++c] = new ItemStack(new ItemBakedPotato(), 1);
            //Slots[++c] = new ItemStack(new ItemBakedPotato(), 1);

            ItemHotbar = new int[6];
            InHandSlot = 0;

            //Boots = new ItemDiamondBoots(0);
            //Leggings = new ItemDiamondLeggings(0);
            //Chest = new ItemDiamondChestplate(0);
            //Helmet = new ItemDiamondHelmet(0);

            Boots = new Item(0, 0);
            Leggings = new Item(0, 0);
            Chest = new Item(0, 0);
            Helmet = new Item(0, 0);

            for (byte i = 0; i < 6; i++)
            {
                ItemHotbar[i] = i;
            }
        }
开发者ID:ruslan81,项目名称:MiNET,代码行数:31,代码来源:PlayerInventory.cs


示例2: Player

 public Player()
 {
     _chunksUsed = new Dictionary<Tuple<int, int>, ChunkColumn>();
     HealthManager = new PCHealthManager(this);
     if (PlayerEntity == null) PlayerEntity = new MiNET.Player(null, null, PluginGlobals.Level[0], null, -1);
     PlayerInventory = new PlayerInventory(this);
 }
开发者ID:EmreTr1,项目名称:MiNET-PC,代码行数:7,代码来源:Player.cs


示例3: RegisterCommand

        public void RegisterCommand(Player player, string password)
        {
            var userManager = Context.Server.UserManager;

            var user = userManager.FindByNameAsync(player.Username).Result;

            if (user == null)
            {
                if (password == null && password.IndexOf(' ') > -1)
                {
                    player.SendMessage($"Do not add any space in your password!");
                    return;
                }
                user = new User(player.Username);
                Context.Server.UserManager.CreateAsync(user, password);
                user.IsAuthenticated = true;
                userManager.UpdateAsync(user);
            }
            else if (user.IsAuthenticated)
            {
                player.SendMessage($"{ChatColors.Red}You has been Login!");
            }
            else if (Context.Server.UserManager.HasPasswordAsync(user.Id).Result)
            {
                player.SendMessage($"You has been register,Plz Type your password to login");
            }
        }
开发者ID:MiNETPlugins,项目名称:MiNetAuth,代码行数:27,代码来源:Register.cs


示例4: PlaceBlock

        public override bool PlaceBlock(Level world, Player player, BlockCoordinates blockCoordinates, BlockFace face, Vector3 faceCoords)
        {
            byte direction = player.GetDirection();

            switch (face)
            {
                case BlockFace.South: // ok
                    Metadata = 0;
                    break;
                case BlockFace.North:
                    Metadata = 1;
                    break;
                case BlockFace.West:
                    Metadata = 2;
                    break;
                case BlockFace.East: // ok
                    Metadata = 3;
                    break;
            }

            Log.Warn($"Direction={direction}, face={face}, metadata={Metadata}");

            world.SetBlock(this);

            return true;
        }
开发者ID:CRBairdUSA,项目名称:MiNET,代码行数:26,代码来源:CustomItemFrame.cs


示例5: PM

		public void PM(Player source, string[] arguments)
		{
			if (arguments.Length >= 2)
			{
				Player target = getPlayer(arguments[0], source);
				if (target != source)
				{
					string message = string.Empty;
					for (int i = 1; i < arguments.Length; i++)
					{
						message += arguments[i];
					}
					target.SendMessage("[MailPE] " + source.Username + ": " + message);
					source.SendMessage("[MailPE] Message to " + target.Username + " was sent!");
				}
				else
				{
					source.SendMessage("[MailPE] Player not found!");
				}
			}
			else
			{
				source.SendMessage("[MailPE] Wrong command usage!");
			}
		}
开发者ID:PocketRealms,项目名称:MailPE,代码行数:25,代码来源:Class1.cs


示例6: BroadCastMovement

        protected override void BroadCastMovement(Player[] players, Player[] updatedPlayers)
        {
            if (updatedPlayers.Length == 0) return;

            var moveEntity = McpeMoveEntity.CreateObject(players.Count());
            moveEntity.entities = new EntityLocations();

            //var rotateHead = McpeRotateHead.CreateObject(players.Count());
            //rotateHead.entities = new EntityHeadRotations();

            foreach (var player in updatedPlayers)
            {
                Entity entity;
                if (!_playerEntities.TryGetValue(player, out entity)) continue;

                entity.KnownPosition = (PlayerLocation) player.KnownPosition.Clone();
                if (entity.EntityTypeId == 10)
                {
                    //BUG: Duck has it's value reversed
                    entity.KnownPosition.Pitch = -player.KnownPosition.Pitch;
                }
                moveEntity.entities.Add(entity.EntityId, entity.KnownPosition);
                //rotateHead.entities.Add(entity.EntityId, entity.KnownPosition);
            }

            moveEntity.Encode();
            //rotateHead.Encode();

            new Task(() => RelayBroadcast(moveEntity)).Start();
            //new Task(() => RelayBroadcast(rotateHead)).Start();
        }
开发者ID:WilliamGao1,项目名称:MiNET,代码行数:31,代码来源:MobHuntLevel.cs


示例7: PlayerJoin

 public Package PlayerJoin(McpeLogin package, Player player)
 {
     if (!_notdefaultlevel)
     {
         player.Level.BlockBreak += OnBreak;
         player.Level.BlockPlace += OnPlace;
         _notdefaultlevel = true;
     }
     if (!(_registerlist.Contains(player.User)))
     {
         player.AddPopup(new Popup()
         {
             Message = "Используй /reg [пароль] для регистрации",
             MessageType = MessageType.Popup
         });
     }
     else
     {
         player.User = _registerlist.Find(t => t.UserName == player.Username);
         if (!player.User.IsAuthenticated)
             player.AddPopup(new Popup()
             {
                 Message = "Используй /auth [пароль] чтобы войти",
                 MessageType = MessageType.Popup
             });
     }
     return package;
 }
开发者ID:xpyctum,项目名称:MiNetAuth,代码行数:28,代码来源:MiNetAuth.cs


示例8: Interact

        public override bool Interact(Level currentLevel, Player player, BlockCoordinates blockCoordinates, BlockFace face)
        {
            Sign signEntity = currentLevel.GetBlockEntity(blockCoordinates) as Sign;
            if (signEntity == null) return false;

            string world = signEntity.Text1;

            if (player.Level.LevelId.Equals(world)) return true;

            if (!Worlds.ContainsKey(player.Level.LevelId))
            {
                Worlds.Add(player.Level.LevelId, player.Level);
            }

            if (!Worlds.ContainsKey(world))
            {
                var mobHuntLevel = new MobHuntLevel(world, new FlatlandWorldProvider());
                mobHuntLevel.Initialize();
                Worlds.Add(world, mobHuntLevel);
            }

            Level level = Worlds[world];
            player.SpawnLevel(level);
            level.BroadcastTextMessage(string.Format("{0} teleported to world <{1}>.", player.Username, level.LevelId));

            return true;
        }
开发者ID:WilliamGao1,项目名称:MiNET,代码行数:27,代码来源:CustomStandingSign.cs


示例9: RemovePlayer

        public override void RemovePlayer(Player player, bool despawn = true)
        {
            base.RemovePlayer(player, despawn);

            Entity entity;
            if (!_playerEntities.TryGetValue(player, out entity)) return;
            entity.DespawnEntity();
        }
开发者ID:WilliamGao1,项目名称:MiNET,代码行数:8,代码来源:MobHuntLevel.cs


示例10: Pet

		public Pet(Player owner, Level level, int id = 12) : base(id, level)
		{
			IsBaby = true;
			IsInRage = false;
			Owner = owner;
			HealthManager = new PetHealthManager(this);
			Age = 0;
		}
开发者ID:TheDiamondYT2,项目名称:MiNET,代码行数:8,代码来源:Pet.cs


示例11: PlayerDisconnect

 public Package PlayerDisconnect(McpeDisconnect package, Player player)
 {
     if (_registerlist.Contains(player.User))
     {
         player.User.IsAuthenticated = false;
     }
     return package;
 }
开发者ID:xpyctum,项目名称:MiNetAuth,代码行数:8,代码来源:MiNetAuth.cs


示例12: Fuck

 public void Fuck(Player player)
 {
     //player.SendSetHealth();
     player.Level.BroadcastMessage(string.Format("{0} current health is {1} with {2} hearts!", player.Username, player.HealthManager.Health, player.HealthManager.Hearts), type: MessageType.Raw);
     player.HealthManager.Health -= 5;
     player.SendSetHealth();
     player.Level.BroadcastMessage(string.Format("{0} health after reset is {1} with {2} hearts!", player.Username, player.HealthManager.Health, player.HealthManager.Hearts), type: MessageType.Raw);
 }
开发者ID:HungerBoatz,项目名称:MiNET,代码行数:8,代码来源:NiceLobbyPlugin.cs


示例13: PlayerInventory

		public PlayerInventory(Player player)
		{
			Player = player;

			Slots = Enumerable.Repeat(new ItemStack(), InventorySize).ToList();
			//Slots = Enumerable.Repeat(new ItemStack(new ItemIronSword(0), 1), InventorySize).ToList();
			//Slots[Slots.Count-10] = new ItemStack(new ItemDiamondAxe(0), 1);
			//Slots[Slots.Count-9] = new ItemStack(new ItemDiamondAxe(0), 1);
			//int c = -1;
			//Slots[++c] = new ItemStack(new ItemIronSword(0), 1);
			//Slots[++c] = new ItemStack(new ItemBow(0), 1);
			//Slots[++c] = new ItemStack(new ItemSnowball(0), 64);
			//Slots[++c] = new ItemStack(new ItemEgg(0), 64);
			//Slots[++c] = new ItemStack(262, 32);
			//Slots[++c] = new ItemStack(new ItemBucket(10), 1);
			//Slots[++c] = new ItemStack(new ItemChest(0), 1);
			////Slots[++c] = new ItemStack(new ItemBlock(new DiamondOre(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new GoldBlock(), 0), 64);
			//Slots[++c] = new ItemStack(new ItemBlock(new CoalBlock(), 0), 64);

			//Slots = new List<ItemStack>();
			//for (int i = 0; i < 100; i++)
			//{
			//	Slots.Add(new ItemStack(ItemFactory.GetItem(i, 0), 1));
			//}

			ItemHotbar = new int[HotbarSize];
			InHandSlot = 0;

			for (byte i = 0; i < ItemHotbar.Length; i++)
			{
				ItemHotbar[i] = i;
			}

			Boots = new Item(0, 0);
			Leggings = new Item(0, 0);
			Chest = new Item(0, 0);
			Helmet = new Item(0, 0);

			//Boots = new ItemDiamondBoots(0);
			//Leggings = new ItemDiamondLeggings(0);
			//Chest = new ItemDiamondChestplate(0);
			//Helmet = new ItemDiamondHelmet(0);
		}
开发者ID:TheDiamondYT2,项目名称:MiNET,代码行数:58,代码来源:PlayerInventory.cs


示例14: AddPlayerHandler

        public Package AddPlayerHandler(McpeAddPlayer packet, Player player)
        {
            if (_playerEntities.Keys.FirstOrDefault(p => p.EntityId == packet.entityId) != null)
            {
                return null;
            }

            return packet;
        }
开发者ID:GoldishKirby,项目名称:MiNET,代码行数:9,代码来源:NiceLobbyPlugin.cs


示例15: SetSlot

		public void SetSlot(Player player, byte slot, ItemStack itemStack)
		{
			Slots[slot] = new MetadataSlot(itemStack);

			NbtCompound compound = BlockEntity.GetCompound();
			compound["Items"] = GetSlots();

			OnInventoryChange(player, slot, itemStack);
		}
开发者ID:TheDiamondYT2,项目名称:MiNET,代码行数:9,代码来源:Inventory.cs


示例16: SetHome

        public void SetHome(Player player, Level level, string[] args)
        {
            if (args.Length > 0)
            {

            }
            else
            {

            }
        }
开发者ID:CavinMiana,项目名称:MiNETEssentials,代码行数:11,代码来源:Home.cs


示例17: getPlayer

		private Player getPlayer(string name, Player source)
		{
			foreach (var user in source.Level.Players)
			{
				if (user.Username.Contains(name))
				{
					return user;
				}
			}
			return source;
		}
开发者ID:PocketRealms,项目名称:MailPE,代码行数:11,代码来源:Class1.cs


示例18: SetHome

		public void SetHome(Player source, string[] arguments)
		{
			if (PluginGlobals.Homes.ContainsKey(source))
			{
				PluginGlobals.Homes.Remove(source);
			}
			PlayerLocation p = source.KnownPosition;
			p.Y += 2; //Do not spawn underground....

			PluginGlobals.Homes.Add(source, p);
			source.SendMessage("[SetHome] Home set!");
		}
开发者ID:PocketRealms,项目名称:SetHome,代码行数:12,代码来源:Commands.cs


示例19: GetLevel

        public virtual Level GetLevel(Player player, string name)
        {
            Level level = Levels.FirstOrDefault(l => l.LevelId.Equals(name, StringComparison.InvariantCultureIgnoreCase));
            if (level == null)
            {
                level = new Level(name);
                level.Initialize();
                Levels.Add(level);
            }

            return level;
        }
开发者ID:ruslan81,项目名称:MiNET,代码行数:12,代码来源:LevelManager.cs


示例20: Human

        public void Human(Player player, string name)
        {
            //TODO: Fix space in pets name, too difficult damn..
            PlayerMob p = new PlayerMob(name, player.Level)
            {
                NameTag = name,
                KnownPosition = (PlayerLocation)player.KnownPosition.Clone()
            };

            p.SpawnEntity();
            //});
        }
开发者ID:uniaspiex,项目名称:MiNET,代码行数:12,代码来源:PetsPlugin.cs



注:本文中的MiNET.Player类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Worlds.Level类代码示例发布时间:2022-05-26
下一篇:
C# Html.CssBox类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap