Example #1
0
        public void Clear()
        {
            for (int i = 0; i < Slots.Count; ++i)
            {
                if (Slots[i] == null || Slots[i].Id != 0)
                {
                    Slots[i] = new ItemAir();
                }
            }

            if (Helmet.Id != 0)
            {
                Helmet = new ItemAir();
            }
            if (Chest.Id != 0)
            {
                Chest = new ItemAir();
            }
            if (Leggings.Id != 0)
            {
                Leggings = new ItemAir();
            }
            if (Boots.Id != 0)
            {
                Boots = new ItemAir();
            }

            Player.SendPlayerInventory();
        }
Example #2
0
 public void SendSetSlot(int slot)
 {
     if (slot < HotbarSize && (ItemHotbar[slot] == -1 || ItemHotbar[slot] == slot))
     {
         ItemHotbar[slot] = slot /* + HotbarSize*/;
         Player.SendPlayerInventory();
     }
     else
     {
         McpeContainerSetSlot sendSlot = new McpeContainerSetSlot();
         sendSlot.NoBatch = true;
         sendSlot.slot    = (short)slot;
         sendSlot.item    = Slots[slot];
         Player.SendPackage(sendSlot);
     }
 }
Example #3
0
        public void SendSetSlot(int slot)
        {
            if (slot < HotbarSize && (ItemHotbar[slot] == -1 || ItemHotbar[slot] == slot))
            {
                ItemHotbar[slot] = slot /* + HotbarSize*/;
                Player.SendPlayerInventory();

                McpeMobEquipment order = McpeMobEquipment.CreateObject();
                order.runtimeEntityId = EntityManager.EntityIdSelf;
                order.item            = GetItemInHand();
                order.selectedSlot    = (byte)slot;               // Selected hotbar slot
                Player.SendPackage(order);
            }
            else
            {
                McpeInventorySlot sendSlot = McpeInventorySlot.CreateObject();
                sendSlot.inventoryId = 0;
                sendSlot.slot        = slot;
                sendSlot.item        = GetItemInHand();
                Player.SendPackage(sendSlot);
            }
        }
Example #4
0
        public void SendSetSlot(int slot)
        {
            if (slot < HotbarSize && (ItemHotbar[slot] == -1 || ItemHotbar[slot] == slot))
            {
                ItemHotbar[slot] = slot /* + HotbarSize*/;
                Player.SendPlayerInventory();

                McpeMobEquipment order = McpeMobEquipment.CreateObject();
                order.entityId     = 0;
                order.item         = GetItemInHand();
                order.selectedSlot = (byte)slot;                  // Selected hotbar slot
                Player.SendPackage(order);
            }
            else
            {
                McpeContainerSetSlot sendSlot = McpeContainerSetSlot.CreateObject();
                sendSlot.windowId = 0;
                sendSlot.slot     = (short)slot;
                sendSlot.item     = Slots[slot];
                Player.SendPackage(sendSlot);
            }
        }
Example #5
0
        public void VideoX(Player player, int numberOfFrames, bool color)
        {
            Task.Run(delegate
            {
                try
                {
                    Dictionary<Tuple<int, int>, MapEntity> entities = new Dictionary<Tuple<int, int>, MapEntity>();

                    int width = 1;
                    int height = 1;
                    int frameCount = numberOfFrames;
                    //int frameOffset = 0;
                    int frameOffset = 120;

                    var frameTicker = new FrameTicker(frameCount);

                    // 768x384
                    for (int frame = frameOffset; frame < frameCount + frameOffset; frame++)
                    {
                        Log.Info($"Generating frame {frame}");

                        string file = Path.Combine(@"D:\Development\Other\Smash Heroes 3x6 (128)\Smash Heroes 3x6 (128)", $"Smash Heroes Trailer{frame:D4}.bmp");
                        //string file = Path.Combine(@"D:\Development\Other\2 by 1 PE test app ad for Gurun-2\exported frames 2", $"pe app ad{frame:D2}.bmp");
                        if (!File.Exists(file)) continue;

                        Bitmap image = new Bitmap((Bitmap) Image.FromFile(file), width*128, height*128);

                        for (int x = 0; x < width; x++)
                        {
                            for (int y = 0; y < height; y++)
                            {
                                var key = new Tuple<int, int>(x, y);
                                if (!entities.ContainsKey(key))
                                {
                                    entities.Add(key, new MapEntity(player.Level) {ImageProvider = new VideoImageProvider(frameTicker)});
                                }

                                var croppedImage = CropImage(image, new Rectangle(new Point(x*128, y*128), new Size(128, 128)));
                                byte[] bitmapToBytes = BitmapToBytes(croppedImage, color);

                                if (bitmapToBytes.Length != 128*128*4) return;

                                ((VideoImageProvider) entities[key].ImageProvider).Frames.Add(CreateCachedPacket(entities[key].EntityId, bitmapToBytes));
                            }
                        }
                    }

                    int i = 0;

                    player.Inventory.Slots[i++] = new ItemBlock(new Planks(), 0) {Count = 64};
                    player.Inventory.Slots[i++] = new ItemItemFrame {Count = 64};

                    foreach (MapEntity entity in entities.Values)
                    {
                        entity.SpawnEntity();
                        player.Inventory.Slots[i++] = new ItemMap(entity.EntityId);
                    }

                    player.SendPlayerInventory();
                    player.SendMessage("Done generating video.", MessageType.Raw);
                }
                catch (Exception e)
                {
                    Log.Error("Aborted video generation", e);
                }
            });

            player.SendMessage("Generating video...", MessageType.Raw);
        }
Example #6
0
        public void Video2X(Player player, int numberOfFrames, bool color)
        {
            Task.Run(delegate
            {
                try
                {
                    Dictionary<Tuple<int, int>, List<MapEntity>> entities = new Dictionary<Tuple<int, int>, List<MapEntity>>();

                    int width = 3;
                    int height = 2;
                    int frameCount = numberOfFrames;
                    //int frameOffset = 0;
                    int frameOffset = 120;

                    var frameTicker = new FrameTicker(frameCount);

                    // 768x384
                    for (int frame = frameOffset; frame < frameCount + frameOffset; frame++)
                    {
                        Log.Info($"Generating frame {frame}");

                        string file = Path.Combine(@"D:\Development\Other\Smash Heroes 3x6 (128)\Smash Heroes 3x6 (128)", $"Smash Heroes Trailer{frame:D4}.bmp");
                        //string file = Path.Combine(@"D:\Development\Other\2 by 1 PE test app ad for Gurun-2\exported frames 2", $"pe app ad{frame:D2}.bmp");
                        if (!File.Exists(file)) continue;

                        Bitmap image = new Bitmap((Bitmap) Image.FromFile(file), width*128, height*128);

                        for (int x = 0; x < width; x++)
                        {
                            for (int y = 0; y < height; y++)
                            {
                                var key = new Tuple<int, int>(x, y);
                                if (!entities.ContainsKey(key))
                                {
                                    entities.Add(key, new List<MapEntity>());
                                }

                                List<MapEntity> frames = entities[key];

                                var croppedImage = CropImage(image, new Rectangle(new Point(x*128, y*128), new Size(128, 128)));
                                byte[] bitmapToBytes = BitmapToBytes(croppedImage, color);

                                if (bitmapToBytes.Length != 128*128*4) return;

                                MapEntity entity = new MapEntity(player.Level);
                                entity.ImageProvider = new MapImageProvider {Batch = CreateCachedPacket(entity.EntityId, bitmapToBytes)};
                                entity.SpawnEntity();
                                frames.Add(entity);
                            }
                        }
                    }

                    int i = 0;

                    player.Inventory.Slots[i++] = new ItemBlock(new Planks(), 0) {Count = 64};

                    foreach (var entites in entities.Values)
                    {
                        player.Inventory.Slots[i++] = new CustomItemItemFrame(entites, frameTicker) {Count = 64};
                    }

                    player.SendPlayerInventory();
                    player.SendMessage("Done generating video.", MessageType.Raw);

                    BlockCoordinates center = player.KnownPosition.GetCoordinates3D();
                    var level = player.Level;

                    for (int x = 0; x < width; x++)
                    {
                        for (int y = 0; y < height; y++)
                        {
                            var key = new Tuple<int, int>(x, y);
                            List<MapEntity> frames = entities[key];

                            BlockCoordinates bc = new BlockCoordinates(center.X - x, center.Y + height - y - 1, center.Z + 2);
                            var wood = new Planks {Coordinates = bc};
                            level.SetBlock(wood);

                            BlockCoordinates frambc = new BlockCoordinates(center.X - x, center.Y + height - y - 1, center.Z + 1);
                            ItemFrameBlockEntity itemFrameBlockEntity = new ItemFrameBlockEntity
                            {
                                Coordinates = frambc
                            };

                            var itemFrame = new CustomItemFrame(frames, itemFrameBlockEntity, level, frameTicker) {Coordinates = frambc, Metadata = 3};
                            level.SetBlock(itemFrame);
                            level.SetBlockEntity(itemFrameBlockEntity);
                        }
                    }
                }
                catch (Exception e)
                {
                    Log.Error("Aborted video generation", e);
                }
            });

            player.SendMessage("Generating video...", MessageType.Raw);
        }
Example #7
0
        public void Kit(Player player, int kitId)
        {
            var inventory = player.Inventory;

            switch (kitId)
            {
                case 0:
                    // Kit leather tier
                    break;
                case 1:
                    // Kit gold tier
                    break;
                case 2:
                    // Kit chain tier
                    break;
                case 3:
                    // Kit iron tier
                    inventory.Boots = new ItemIronBoots(0);
                    inventory.Leggings = new ItemIronLeggings(0);
                    inventory.Chest = new ItemIronChestplate(0);
                    inventory.Helmet = new ItemIronHelmet(0);
                    break;
                case 4:
                    // Kit diamond tier
                    inventory.Boots = new ItemDiamondBoots(0);
                    inventory.Leggings = new ItemDiamondLeggings(0);
                    inventory.Chest = new ItemDiamondChestplate(0);
                    inventory.Helmet = new ItemDiamondHelmet(0);
                    break;
            }

            byte c = 0;
            inventory.Slots[c++] = (new ItemStack(268, 1)); // Wooden Sword
            inventory.Slots[c++] = (new ItemStack(283, 1)); // Golden Sword
            inventory.Slots[c++] = (new ItemStack(272, 1)); // Stone Sword
            inventory.Slots[c++] = (new ItemStack(267, 1)); // Iron Sword
            inventory.Slots[c++] = (new ItemStack(276, 1)); // Diamond Sword

            inventory.Slots[c++] = (new ItemStack(261, 1)); // Bow
            inventory.Slots[c++] = (new ItemStack(262, 64)); // Arrows
            inventory.Slots[c++] = (new ItemStack(344, 64)); // Eggs
            inventory.Slots[c++] = (new ItemStack(332, 64)); // Snowballs

            player.SendPlayerInventory();
            SendEquipmentForPlayer(player);
            SendArmorForPlayer(player);

            player.Level.BroadcastMessage(string.Format("Player {0} changed kit.", player.Username), type: MessageType.Raw);
        }
Example #8
0
        public void Kit(Player player, int kitId)
        {
            var inventory = player.Inventory;

            switch (kitId)
            {
                case 0:
                    // Kit leather tier
                    break;
                case 1:
                    // Kit gold tier
                    break;
                case 2:
                    // Kit chain tier
                    break;
                case 3:
                    // Kit iron tier
                    inventory.Boots = new ItemIronBoots(0);
                    inventory.Leggings = new ItemIronLeggings(0);
                    inventory.Chest = new ItemIronChestplate(0);
                    inventory.Helmet = new ItemIronHelmet(0);
                    break;
                case 4:
                    // Kit diamond tier
                    inventory.Boots = new ItemDiamondBoots(0);
                    inventory.Leggings = new ItemDiamondLeggings(0);
                    inventory.Chest = new ItemDiamondChestplate(0);
                    inventory.Helmet = new ItemDiamondHelmet(0);
                    break;
            }

            var command = new ItemCommand(41, 0, delegate(ItemCommand itemCommand, Level level, Player arg3, BlockCoordinates arg4) { Log.Info("Clicked on command"); });

            // Hotbar
            byte c = 0;
            //inventory.Slots[c++] = new ItemStack(command, 1); // Wooden Sword
            inventory.Slots[c++] = new ItemStack(268, 1); // Wooden Sword
            inventory.Slots[c++] = new ItemStack(272, 1); // Stone Sword
            inventory.Slots[c++] = new ItemStack(283, 1); // Golden Sword
            inventory.Slots[c++] = new ItemStack(267, 1); // Iron Sword
            inventory.Slots[c++] = new ItemStack(276, 1); // Diamond Sword
            inventory.Slots[c++] = new ItemStack(261, 1); // Bow
            inventory.Slots[c++] = new ItemStack(262, 64); // Arrows
            inventory.Slots[c++] = new ItemStack(344, 64); // Eggs
            inventory.Slots[c++] = new ItemStack(332, 64); // Snowballs

            inventory.Slots[c++] = new ItemStack(new ItemChest(0), 1);
            inventory.Slots[c++] = new ItemStack(new ItemStoneAxe(0), 1);
            inventory.Slots[c++] = new ItemStack(new ItemWoodenPickaxe(0), 1);
            inventory.Slots[c++] = new ItemStack(new ItemBread(), 5);
            inventory.Slots[c++] = new ItemStack(new ItemBlock(new Block(35), 0), 64);
            inventory.Slots[c++] = new ItemStack(new ItemBucket(8), 1);

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

            player.SendPlayerInventory();
            SendEquipmentForPlayer(player);
            SendArmorForPlayer(player);

            player.Level.BroadcastMessage(string.Format("Player {0} changed kit.", player.Username), type: MessageType.Raw);
        }
Example #9
0
 public void SendInventory(Player player)
 {
     player.SendPlayerInventory();
 }
Example #10
0
        public void Potions(Player player)
        {
            var inventory = player.Inventory;

            byte c = 0;
            //inventory.Slots[c++] = new ItemStack(command, 1); // Custom command block
            for (short i = 5; i < 36; i++)
            {
                inventory.Slots[c++] = new ItemPotion(i);
            }

            player.SendPlayerInventory();
            SendEquipmentForPlayer(player);
            SendArmorForPlayer(player);

            player.Level.BroadcastMessage($"{player.Username} got potions.", type: MessageType.Raw);
        }
Example #11
0
        public void Kit(Player player, int kitId)
        {
            var inventory = player.Inventory;

            switch (kitId)
            {
                case 0:
                    // Kit leather tier
                    inventory.Boots = new ItemLeatherBoots();
                    inventory.Leggings = new ItemLeatherLeggings();
                    inventory.Chest = new ItemLeatherChestplate();
                    inventory.Helmet = new ItemLeatherHelmet();
                    break;
                case 1:
                    // Kit gold tier
                    inventory.Boots = new ItemGoldBoots();
                    inventory.Leggings = new ItemGoldLeggings();
                    inventory.Chest = new ItemGoldChestplate();
                    inventory.Helmet = new ItemGoldHelmet();
                    break;
                case 2:
                    // Kit chain tier
                    inventory.Boots = new ItemChainmailBoots();
                    inventory.Leggings = new ItemChainmailLeggings();
                    inventory.Chest = new ItemChainmailChestplate();
                    inventory.Helmet = new ItemChainmailHelmet();
                    break;
                case 3:
                    // Kit iron tier
                    inventory.Boots = new ItemIronBoots();
                    inventory.Leggings = new ItemIronLeggings();
                    inventory.Chest = new ItemIronChestplate();
                    inventory.Helmet = new ItemIronHelmet();
                    break;
                case 4:
                    // Kit diamond tier
                    inventory.Boots = new ItemDiamondBoots();
                    inventory.Leggings = new ItemDiamondLeggings();
                    inventory.Chest = new ItemDiamondChestplate();
                    inventory.Helmet = new ItemDiamondHelmet();
                    break;
            }

            // 0 = protection
            // 1 = Fire protection
            // 2 = Feather falling
            // 3 = Blast protection
            // 4 = Projectile protection
            // 5 = Thorns

            EnchantArmor(player.Inventory, 0, 2);

            var command = new ItemCommand(41, 0, delegate(ItemCommand itemCommand, Level level, Player arg3, BlockCoordinates arg4) { Log.Info("Clicked on command"); });

            // Hotbar
            byte c = 0;
            //inventory.Slots[c++] = new ItemStack(command, 1); // Custom command block

            //2016 - 02 - 26 02:59:08,740[6] INFO MiNET.Client.MiNetClient - Item Type = Item, Id = 358, Metadata = 0, Count = 1,
            // ExtraData = TAG_Compound("tag"): 1 entries {
            //	TAG_String("map_uuid"): "-4294967268"
            //}

            //inventory.Slots[c++] = new ItemItemFrame() { Count = 64 };
            //inventory.Slots[c++] = new ItemBlock(new WoodenPlanks(), 0) { Count = 64 };
            inventory.Slots[c++] = new ItemCompass(); // Wooden Sword
            inventory.Slots[c++] = new ItemWoodenSword(); // Wooden Sword
            inventory.Slots[c++] = new ItemStoneSword(); // Stone Sword
            inventory.Slots[c++] = new ItemGoldSword(); // Golden Sword
            inventory.Slots[c++] = new ItemIronSword(); // Iron Sword
            inventory.Slots[c++] = new ItemDiamondSword(); // Diamond Sword
            inventory.Slots[c++] = new ItemBow(); // Bow
            inventory.Slots[c++] = new ItemArrow {Count = 64}; // Arrows
            inventory.Slots[c++] = new ItemEgg {Count = 64}; // Eggs
            inventory.Slots[c++] = new ItemSnowball {Count = 64}; // Snowballs
            inventory.Slots[c++] = new ItemIronSword
            {
                ExtraData = new NbtCompound {new NbtList("ench") {new NbtCompound {new NbtShort("id", 9), new NbtShort("lvl", 1)}}}
            };

            inventory.Slots[c++] = new ItemIronSword
            {
                ExtraData = new NbtCompound {{new NbtCompound("display") {new NbtString("Name", "test")}}}
            };

            //inventory.Slots[c++] = new ItemEmptyMap { Count = 64 }; // Wooden Sword
            inventory.Slots[c++] = new ItemStoneAxe();
            inventory.Slots[c++] = new ItemStoneAxe();
            inventory.Slots[c++] = new ItemWoodenPickaxe();
            inventory.Slots[c++] = new ItemBread {Count = 5};
            //inventory.Slots[c++] = new ItemBlock(new Block(35), 0) {Count = 64};
            //inventory.Slots[c++] = new ItemBucket(8);

            //inventory.Slots[c++] = ItemFactory.GetItem(39, 0) { Count = 1};
            //inventory.Slots[c++] = ItemFactory.GetItem(40, 0), 4);
            //inventory.Slots[c++] = ItemFactory.GetItem(281, 0), 4);

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

            player.SendPlayerInventory();
            SendEquipmentForPlayer(player);
            SendArmorForPlayer(player);

            player.Level.BroadcastMessage(string.Format("Player {0} changed kit.", player.Username), type: MessageType.Raw);
        }
Example #12
0
        public void Furnace(Player player)
        {
            var inventory = player.Inventory;

            byte c = 0;
            inventory.Slots[c++] = new ItemFurnace() {Count = 64}; // Custom command block
            inventory.Slots[c++] = new ItemCoal() {Count = 64}; // Custom command block
            inventory.Slots[c++] = new ItemBlock(new IronOre(), 0) {Count = 64}; // Custom command block

            player.SendPlayerInventory();
            SendEquipmentForPlayer(player);
            SendArmorForPlayer(player);

            player.Level.BroadcastMessage($"{player.Username} got potions.", type: MessageType.Raw);
        }
Example #13
0
        public void Kit(Player player, int kitId)
        {
            var inventory = player.Inventory;

            switch (kitId)
            {
                case 0:
                    // Kit leather tier
                    break;
                case 1:
                    // Kit gold tier
                    break;
                case 2:
                    // Kit chain tier
                    break;
                case 3:
                    // Kit iron tier
                    inventory.Boots = new ItemIronBoots();
                    inventory.Leggings = new ItemIronLeggings();
                    inventory.Chest = new ItemIronChestplate();
                    inventory.Helmet = new ItemIronHelmet();
                    break;
                case 4:
                    // Kit diamond tier
                    inventory.Boots = new ItemDiamondBoots();
                    inventory.Leggings = new ItemDiamondLeggings();
                    inventory.Chest = new ItemDiamondChestplate();
                    inventory.Helmet = new ItemDiamondHelmet();
                    break;
            }

            var command = new ItemCommand(41, 0, delegate(ItemCommand itemCommand, Level level, Player arg3, BlockCoordinates arg4) { Log.Info("Clicked on command"); });

            // Hotbar
            byte c = 0;
            //inventory.Slots[c++] = new ItemStack(command, 1); // Custom command block
            inventory.Slots[c++] = new ItemPotion(1);
            inventory.Slots[c++] = new ItemPotion(2);
            inventory.Slots[c++] = new ItemPotion(3);
            inventory.Slots[c++] = new ItemPotion(4);
            inventory.Slots[c++] = new ItemPotion(5);
            inventory.Slots[c++] = new ItemPotion(6);
            inventory.Slots[c++] = new ItemPotion(7);
            inventory.Slots[c++] = new ItemPotion(8);
            inventory.Slots[c++] = new ItemPotion(9);
            inventory.Slots[c++] = new ItemWoodenSword(); // Wooden Sword
            inventory.Slots[c++] = new ItemStoneSword(); // Stone Sword
            inventory.Slots[c++] = new ItemGoldSword(); // Golden Sword
            inventory.Slots[c++] = new ItemIronSword(); // Iron Sword
            inventory.Slots[c++] = new ItemDiamondSword(); // Diamond Sword
            inventory.Slots[c++] = new ItemBow(); // Bow
            inventory.Slots[c++] = ItemFactory.GetItem(262, 0, 64); // Arrows
            inventory.Slots[c++] = ItemFactory.GetItem(344, 0, 64); // Eggs
            inventory.Slots[c++] = ItemFactory.GetItem(332, 0, 64); // Snowballs
            Item item = ItemFactory.GetItem(267, 0, 64);
            item.ExtraData = new NbtCompound {new NbtList("ench") {new NbtCompound {new NbtShort("id", 0), new NbtShort("lvl", 2)}}};
            inventory.Slots[c++] = item;

            inventory.Slots[c++] = new ItemChest();
            inventory.Slots[c++] = new ItemStoneAxe();
            inventory.Slots[c++] = new ItemWoodenPickaxe();
            inventory.Slots[c++] = new ItemBread {Count = 5};
            inventory.Slots[c++] = new ItemBlock(new Block(35), 0) {Count = 64};
            inventory.Slots[c++] = new ItemBucket(8);

            //inventory.Slots[c++] = ItemFactory.GetItem(39, 0) { Count = 1};
            //inventory.Slots[c++] = ItemFactory.GetItem(40, 0), 4);
            //inventory.Slots[c++] = ItemFactory.GetItem(281, 0), 4);

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

            player.SendPlayerInventory();
            SendEquipmentForPlayer(player);
            SendArmorForPlayer(player);

            player.Level.BroadcastMessage(string.Format("Player {0} changed kit.", player.Username), type: MessageType.Raw);
        }
Example #14
0
        public void Kit(Player player, string kitName)
        {
            var inventory = player.Inventory;
            var InHandItem = inventory.GetItemInHand();

            if (!PlayersKitActivated.Contains(player.Username))
            {
                switch (kitName)
                {

                    case "Leather":
                        // Kit leather tier
                        inventory.Boots = new ItemLeatherBoots();
                        inventory.Leggings = new ItemLeatherLeggings();
                        inventory.Chest = new ItemLeatherChestplate();
                        inventory.Helmet = new ItemLeatherHelmet();
                        InHandItem = new ItemWoodenSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Leather"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Gold":
                        // Kit gold tier
                        inventory.Boots = new ItemGoldBoots();
                        inventory.Leggings = new ItemGoldLeggings();
                        inventory.Chest = new ItemGoldChestplate();
                        inventory.Helmet = new ItemGoldHelmet();
                        InHandItem = new ItemGoldSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Gold"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Chain":
                        // Kit chain tier
                        inventory.Boots = new ItemChainmailBoots();
                        inventory.Leggings = new ItemChainmailLeggings();
                        inventory.Chest = new ItemChainmailChestplate();
                        inventory.Helmet = new ItemChainmailHelmet();
                        InHandItem = new ItemStoneSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Chain"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Iron":
                        // Kit iron tier
                        inventory.Boots = new ItemIronBoots();
                        inventory.Leggings = new ItemIronLeggings();
                        inventory.Chest = new ItemIronChestplate();
                        inventory.Helmet = new ItemIronHelmet();
                        InHandItem = new ItemIronSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Iron"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                    case "Diamond":
                        // Kit diamond tier
                        inventory.Boots = new ItemDiamondBoots();
                        inventory.Leggings = new ItemDiamondLeggings();
                        inventory.Chest = new ItemDiamondChestplate();
                        inventory.Helmet = new ItemDiamondHelmet();
                        InHandItem = new ItemDiamondSword();
                        player.SendMessage(string.Format(ChatColors.Blue + "You have selected kit: Diamond"), type: MessageType.Raw);
                        SendArmorForPlayer(player);
                        player.SendPlayerInventory();
                        //set player kit var to true.
                        PlayersKitActivated.Add(player.Username);
                        break;
                }
            }
            else if (PlayersKitActivated.Contains(player.Username))
            {
                player.SendMessage(string.Format(ChatColors.Blue + "You have already selected a kit, only one kit per life."), type: MessageType.Raw);
            }
        }
Example #15
0
 public void test(Player player)
 {
     player.SendMessage(string.Format(ChatColors.Yellow + "Hi " + player.Username + " this is test command :-)"), type: MessageType.Raw);
     var inventory = player.Inventory;
     inventory.Boots = new ItemLeatherBoots();
     inventory.Leggings = new ItemLeatherLeggings();
     inventory.Chest = new ItemLeatherChestplate();
     inventory.Helmet = new ItemLeatherHelmet();
     player.SendPlayerInventory();
     SendArmorForPlayer(player);
 }