summaryrefslogtreecommitdiffstats
path: root/source/ChestEntity.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-06 23:21:57 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-06 23:21:57 +0200
commit502935c061ea913180f0a77a7406f5292e697c79 (patch)
treea74e562a772b89db12985d6f1744ae91ff4890d6 /source/ChestEntity.h
parentAdded a tab in the serversettings where you can edit the world.ini of all your worlds. (diff)
downloadcuberite-502935c061ea913180f0a77a7406f5292e697c79.tar
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.gz
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.bz2
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.lz
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.xz
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.zst
cuberite-502935c061ea913180f0a77a7406f5292e697c79.zip
Diffstat (limited to '')
-rw-r--r--source/ChestEntity.h25
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