summaryrefslogtreecommitdiffstats
path: root/src/Entities/Minecart.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-01-02 14:50:34 +0100
committerGitHub <noreply@github.com>2021-01-02 14:50:34 +0100
commit16aeb84cd35996a6b41f10cbc48a677eeccc911c (patch)
treeae877926559d59a534bbf3c22651e6df7ffe8d71 /src/Entities/Minecart.h
parentFix version typo in CMakeLists.txt (#5098) (diff)
downloadcuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar
cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.gz
cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.bz2
cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.lz
cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.xz
cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.tar.zst
cuberite-16aeb84cd35996a6b41f10cbc48a677eeccc911c.zip
Diffstat (limited to 'src/Entities/Minecart.h')
-rw-r--r--src/Entities/Minecart.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/Entities/Minecart.h b/src/Entities/Minecart.h
index ad3b3d40d..73011b7b5 100644
--- a/src/Entities/Minecart.h
+++ b/src/Entities/Minecart.h
@@ -40,12 +40,12 @@ public:
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual bool DoTakeDamage(TakeDamageInfo & TDI) override;
- virtual void Destroyed() override;
+ virtual void KilledBy(TakeDamageInfo & a_TDI) override;
+ virtual void OnRemoveFromWorld(cWorld & a_World) override;
int LastDamage(void) const { return m_LastDamage; }
ePayload GetPayload(void) const { return m_Payload; }
-
protected:
ePayload m_Payload;
@@ -99,7 +99,7 @@ protected:
-class cRideableMinecart :
+class cRideableMinecart final :
public cMinecart
{
using Super = cMinecart;
@@ -114,6 +114,7 @@ public:
int GetBlockHeight(void) const {return m_Height;}
// cEntity overrides:
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
virtual void OnRightClicked(cPlayer & a_Player) override;
protected:
@@ -127,7 +128,7 @@ protected:
-class cMinecartWithChest :
+class cMinecartWithChest final :
public cMinecart,
public cItemGrid::cListener,
public cEntityWindowOwner
@@ -154,7 +155,6 @@ protected:
cItemGrid m_Contents;
void OpenNewWindow(void);
- virtual void Destroyed() override;
// cItemGrid::cListener overrides:
virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override
@@ -173,6 +173,8 @@ protected:
}
// cEntity overrides:
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
+ virtual void OnRemoveFromWorld(cWorld & a_World) override;
virtual void OnRightClicked(cPlayer & a_Player) override;
} ;
@@ -180,7 +182,7 @@ protected:
-class cMinecartWithFurnace :
+class cMinecartWithFurnace final :
public cMinecart
{
using Super = cMinecart;
@@ -192,6 +194,7 @@ public:
cMinecartWithFurnace(Vector3d a_Pos);
// cEntity overrides:
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
virtual void OnRightClicked(cPlayer & a_Player) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
@@ -213,22 +216,27 @@ private:
-class cMinecartWithTNT :
+class cMinecartWithTNT final :
public cMinecart
{
using Super = cMinecart;
public:
+
CLASS_PROTODEF(cMinecartWithTNT)
cMinecartWithTNT(Vector3d a_Pos);
+
+private:
+
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
} ;
-class cMinecartWithHopper :
+class cMinecartWithHopper final :
public cMinecart
{
using Super = cMinecart;
@@ -238,4 +246,8 @@ public:
CLASS_PROTODEF(cMinecartWithHopper)
cMinecartWithHopper(Vector3d a_Pos);
+
+private:
+
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
} ;