Esempio n. 1
0
 private void OnCreativeInventoryAction(CreativeInventoryActionPacket p)
 {
     if (CreativeInventoryAction != null) CreativeInventoryAction.Invoke(this, new PacketEventArgs<CreativeInventoryActionPacket>(p));
 }
Esempio n. 2
0
 public static void HandlePacketCreativeInventoryAction(Client client, CreativeInventoryActionPacket packet)
 {
     if (client.Owner.GameMode == 1)
         client.Owner.Inventory[packet.Slot] = new ItemStack(packet.ItemID, (sbyte)packet.Quantity, packet.Damage);
     else
         client.Kick("Invalid action: CreativeInventoryAction");
 }
Esempio n. 3
0
        public static void HandlePacketCreativeInventoryAction(Client client, CreativeInventoryActionPacket packet)
        {
            if (client.Owner.GameMode == 1)

                if (packet.Item.Type == -1 && packet.Item.Durability == 0 && packet.Item.Count == 0) // We are adding an item to our mouse cursor from the quick bar
                {
                    //may need to do something here
                    return;
                }
                else
                {
                    if (packet.Slot != -1)// mouse cursor mode
                    {
                        client.Owner.Inventory[packet.Slot] = packet.Item;
                    }

                }
            else
                client.Kick("Invalid action: CreativeInventoryAction");
        }
Esempio n. 4
0
        public static void ReadCreativeInventoryAction(Client client, PacketReader reader)
        {
            CreativeInventoryActionPacket ci = new CreativeInventoryActionPacket();
            ci.Read(reader);

            if (!reader.Failed)
                Client.HandlePacketCreativeInventoryAction(client, ci);
        }
Esempio n. 5
0
        public static void HandlePacketCreativeInventoryAction(Client client, CreativeInventoryActionPacket packet)
        {
            if (client.Owner.GameMode == 1)

                if (packet.ItemID == -1 && packet.Damage == 0 && packet.Quantity == 0) // We are adding an item to our mouse cursor from the quick bar
                {
                    //may need to do something here
                    return;
                }
                else
                {
                    if (packet.Slot != -1)// mouse cursor mode
                    {
                        client.Owner.Inventory[packet.Slot] = new ItemStack(packet.ItemID, (sbyte)packet.Quantity, packet.Damage);
                    }

                }
            else
                client.Kick("Invalid action: CreativeInventoryAction");
        }