diff options
author | Mattes D <github@xoft.cz> | 2014-01-17 11:27:56 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-01-17 11:27:56 +0100 |
commit | 79c1f6f43844a85abac53f4c61bff398b88b669d (patch) | |
tree | f938528aed92ffdbea0c5d15f84f738c65c9d8d4 /src/Entities | |
parent | Fixed SIGABRT_COMPAT on other architectures. (diff) | |
parent | Changed GetContent function. (diff) | |
download | cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.gz cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.bz2 cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.lz cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.xz cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.tar.zst cuberite-79c1f6f43844a85abac53f4c61bff398b88b669d.zip |
Diffstat (limited to 'src/Entities')
-rw-r--r-- | src/Entities/Minecart.cpp | 11 | ||||
-rw-r--r-- | src/Entities/Minecart.h | 12 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp index 2c1287d40..d0d384481 100644 --- a/src/Entities/Minecart.cpp +++ b/src/Entities/Minecart.cpp @@ -54,6 +54,7 @@ void cMinecart::SpawnOn(cClientHandle & a_ClientHandle) } } a_ClientHandle.SendSpawnVehicle(*this, 10, SubType); // 10 = Minecarts, SubType = What type of Minecart + a_ClientHandle.SendEntityMetadata(*this); } @@ -672,10 +673,12 @@ void cMinecart::Destroyed() /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// cEmptyMinecart: +// cRideableMinecart: -cEmptyMinecart::cEmptyMinecart(double a_X, double a_Y, double a_Z) : - super(mpNone, a_X, a_Y, a_Z) +cRideableMinecart::cRideableMinecart(double a_X, double a_Y, double a_Z, const cItem & a_Content, int a_Height) : + super(mpNone, a_X, a_Y, a_Z), + m_Content(a_Content), + m_Height(a_Height) { } @@ -683,7 +686,7 @@ cEmptyMinecart::cEmptyMinecart(double a_X, double a_Y, double a_Z) : -void cEmptyMinecart::OnRightClicked(cPlayer & a_Player) +void cRideableMinecart::OnRightClicked(cPlayer & a_Player) { if (m_Attachee != NULL) { diff --git a/src/Entities/Minecart.h b/src/Entities/Minecart.h index 1ebddfdda..874d0204e 100644 --- a/src/Entities/Minecart.h +++ b/src/Entities/Minecart.h @@ -90,18 +90,24 @@ protected: -class cEmptyMinecart : +class cRideableMinecart : public cMinecart { typedef cMinecart super; public: - CLASS_PROTODEF(cEmptyMinecart); + CLASS_PROTODEF(cRideableMinecart); - cEmptyMinecart(double a_X, double a_Y, double a_Z); + cRideableMinecart(double a_X, double a_Y, double a_Z, const cItem & a_Content, int a_Height); + const cItem & GetContent(void) const {return m_Content;} + int GetBlockHeight(void) const {return m_Height;} // cEntity overrides: virtual void OnRightClicked(cPlayer & a_Player) override; +protected: + + cItem m_Content; + int m_Height; } ; |