private void OnCreativeInventoryAction(CreativeInventoryActionPacket p) { if (CreativeInventoryAction != null) CreativeInventoryAction.Invoke(this, new PacketEventArgs<CreativeInventoryActionPacket>(p)); }
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"); }
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"); }
public static void ReadCreativeInventoryAction(Client client, PacketReader reader) { CreativeInventoryActionPacket ci = new CreativeInventoryActionPacket(); ci.Read(reader); if (!reader.Failed) Client.HandlePacketCreativeInventoryAction(client, ci); }
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"); }