From d7068b35a85f0c0248a5533240087747d02e1a17 Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Sun, 1 Jan 2012 04:55:17 +0000 Subject: - implemented separated inventory for creative mode (cSurvivalInventory and cCreativeInventory) (Separation is not perfect yet, because maybe there are some mayor changes needed :D) - implemented CreativeInventoryAction (was mistakenly called CreateInventoryAction) -> Fixed meta data for creative selected blocks ->->Slabs/Steps are now placed correctly - slabs can now be build to a double slab - fixed a bug in the inventory which put items with different meta values in the same slot git-svn-id: http://mc-server.googlecode.com/svn/trunk@160 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cCreativeInventory.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/cCreativeInventory.cpp (limited to 'source/cCreativeInventory.cpp') diff --git a/source/cCreativeInventory.cpp b/source/cCreativeInventory.cpp new file mode 100644 index 000000000..b1606f077 --- /dev/null +++ b/source/cCreativeInventory.cpp @@ -0,0 +1,38 @@ +#include "cCreativeInventory.h" +#include //memset +#include "cPlayer.h" +#include "cClientHandle.h" +#include "cMCLogger.h" +#include "cWindow.h" +#include "cItem.h" +#include "cRecipeChecker.h" +#include "cRoot.h" + +#include + +#include "packets/cPacket_CreativeInventoryAction.h" +#include "packets/cPacket_WholeInventory.h" +#include "packets/cPacket_InventorySlot.h" + +cCreativeInventory::~cCreativeInventory() +{ +} + +cCreativeInventory::cCreativeInventory(cPlayer* a_Owner) + : cInventory(a_Owner) +{ + +} + +void cCreativeInventory::Clicked( cPacket* a_ClickPacket ) +{ + cPacket_CreativeInventoryAction* Packet = reinterpret_cast(a_ClickPacket); + short Slot = Packet->m_Slot; + + cItem* SlotItem = &(this->m_Slots[Slot]); + + SlotItem->m_ItemID = (ENUM_ITEM_ID) Packet->m_ItemID; + SlotItem->m_ItemHealth = Packet->m_Damage; + SlotItem->m_ItemCount = Packet->m_Quantity; +} + -- cgit v1.2.3