diff options
Diffstat (limited to '')
-rw-r--r-- | source/ChestEntity.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source/ChestEntity.h b/source/ChestEntity.h index cef53f037..03102a80b 100644 --- a/source/ChestEntity.h +++ b/source/ChestEntity.h @@ -16,18 +16,26 @@ namespace Json class cClientHandle; class cServer; class cItem; +class cLootProbab; class cNBTData; -class cChestEntity : // tolua_export - public cBlockEntity, // tolua_export - public cBlockEntityWindowOwner // tolua_export -{ // tolua_export +// tolua_begin +class cChestEntity : + public cBlockEntity, + public cBlockEntityWindowOwner +{ + typedef cBlockEntity super; + public: + cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ); // Used while generating + // tolua_end + cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); + virtual ~cChestEntity(); virtual void Destroy(); @@ -35,6 +43,11 @@ public: const cItem * GetSlot(int a_Slot) const; // tolua_export void SetSlot(int a_Slot, const cItem & a_Item ); // tolua_export + + /** Generates random loot from the specified loot probability table, with a chance of enchanted books added. + A total of a_NumSlots are taken by the loot + */ + void GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, int a_CountLootProbabs, int a_NumSlots, int a_Seed); bool LoadFromJson( const Json::Value& a_Value ); @@ -53,8 +66,8 @@ public: private: - cItem * m_Content; -}; // tolua_export + cItem m_Content[c_ChestWidth * c_ChestHeight]; // TODO: replace this by a generic ItemGridHolder +} ; // tolua_export |