summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-05-09 14:24:41 +0200
committerMattes D <github@xoft.cz>2017-05-09 14:24:41 +0200
commit7c4576a02591d8ebe41656c5cefb1eb25a086a10 (patch)
tree3c5bb3dd56d492f32306a65c790576670dc3c0b2 /src
parentFixed Lua bindings for const objects. (diff)
downloadcuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.tar
cuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.tar.gz
cuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.tar.bz2
cuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.tar.lz
cuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.tar.xz
cuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.tar.zst
cuberite-7c4576a02591d8ebe41656c5cefb1eb25a086a10.zip
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/AllToLua.pkg2
-rw-r--r--src/Bindings/CMakeLists.txt2
-rw-r--r--src/Entities/ExpOrb.h12
-rw-r--r--src/Entities/FallingBlock.h9
4 files changed, 20 insertions, 5 deletions
diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg
index 6ca9c8658..55f26bc60 100644
--- a/src/Bindings/AllToLua.pkg
+++ b/src/Bindings/AllToLua.pkg
@@ -75,6 +75,8 @@ $cfile "../Entities/ProjectileEntity.h"
$cfile "../Entities/ArrowEntity.h"
$cfile "../Entities/EntityEffect.h"
$cfile "../Entities/ExpBottleEntity.h"
+$cfile "../Entities/ExpOrb.h"
+$cfile "../Entities/FallingBlock.h"
$cfile "../Entities/FireChargeEntity.h"
$cfile "../Entities/FireworkEntity.h"
$cfile "../Entities/Floater.h"
diff --git a/src/Bindings/CMakeLists.txt b/src/Bindings/CMakeLists.txt
index ccd6f0a3f..349f15b08 100644
--- a/src/Bindings/CMakeLists.txt
+++ b/src/Bindings/CMakeLists.txt
@@ -94,8 +94,10 @@ set(BINDING_DEPENDENCIES
../Enchantments.h
../Entities/ArrowEntity.h
../Entities/Entity.h
+ ../Entities/ExpOrb.h
../Entities/EntityEffect.h
../Entities/ExpBottleEntity.h
+ ../Entities/FallingBlock.h
../Entities/FireChargeEntity.h
../Entities/FireworkEntity.h
../Entities/Floater.h
diff --git a/src/Entities/ExpOrb.h b/src/Entities/ExpOrb.h
index bb4c79c8e..83672ea02 100644
--- a/src/Entities/ExpOrb.h
+++ b/src/Entities/ExpOrb.h
@@ -25,17 +25,21 @@ public:
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void SpawnOn(cClientHandle & a_Client) override;
+ // tolua_begin
+
/** Returns the number of ticks that this entity has existed */
- int GetAge(void) const { return std::chrono::duration_cast<cTickTime>(m_Timer).count(); } // tolua_export
+ int GetAge(void) const { return std::chrono::duration_cast<cTickTime>(m_Timer).count(); }
/** Set the number of ticks that this entity has existed */
- void SetAge(int a_Age) { m_Timer = cTickTime(a_Age); } // tolua_export
+ void SetAge(int a_Age) { m_Timer = cTickTime(a_Age); }
/** Get the exp amount */
- int GetReward(void) const { return m_Reward; } // tolua_export
+ int GetReward(void) const { return m_Reward; }
/** Set the exp amount */
- void SetReward(int a_Reward) { m_Reward = a_Reward; } // tolua_export
+ void SetReward(int a_Reward) { m_Reward = a_Reward; }
+
+ // tolua_end
protected:
int m_Reward;
diff --git a/src/Entities/FallingBlock.h b/src/Entities/FallingBlock.h
index 3e80564e5..8bdf46ca0 100644
--- a/src/Entities/FallingBlock.h
+++ b/src/Entities/FallingBlock.h
@@ -13,6 +13,7 @@ class cItem;
+// tolua_begin
class cFallingBlock :
public cEntity
@@ -20,14 +21,20 @@ class cFallingBlock :
typedef cEntity super;
public:
+ // tolua_end
+
CLASS_PROTODEF(cFallingBlock)
/** Creates a new falling block. a_BlockPosition is expected in world coords */
cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+ // tolua_begin
+
BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
NIBBLETYPE GetBlockMeta(void) const { return m_BlockMeta; }
+ // tolua_end
+
// cEntity overrides:
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
@@ -36,7 +43,7 @@ private:
BLOCKTYPE m_BlockType;
NIBBLETYPE m_BlockMeta;
Vector3i m_OriginalPosition; // Position where the falling block has started, in world coords
-} ;
+} ; // tolua_export