From ee929793f09c431693e1bef7edd77213ba412f60 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 25 May 2014 13:46:34 +0100 Subject: Hopefully fixed piston duplication issues * Fixes #879 * Fixes #714 --- src/World.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index 86cbb3e7e..5ef63a540 100644 --- a/src/World.h +++ b/src/World.h @@ -117,6 +117,22 @@ public: }; + class cTaskSendBlockToAllPlayers : + public cTask + { + public: + cTaskSendBlockToAllPlayers(int a_BlockX, int a_BlockY, int a_BlockZ); + + protected: + // cTask overrides: + virtual void Run(cWorld & a_World) override; + + int m_BlockX; + int m_BlockY; + int m_BlockZ; + }; + + static const char * GetClassStatic(void) // Needed for ManualBindings's ForEach templates { return "cWorld"; @@ -373,7 +389,7 @@ public: /** Sets the block at the specified coords to the specified value. Full processing, incl. updating neighbors, is performed. */ - void SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); + void SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, bool a_SendToClients = true); /** Sets the block at the specified coords to the specified value. The replacement doesn't trigger block updates. -- cgit v1.2.3 From 365c6f50bd057eb62c66b9b222a07ca6efcb2c47 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 29 May 2014 11:57:06 +0100 Subject: Changed block send queue to use vectors As suggested by @worktycho. --- src/World.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index 5ef63a540..98b241a2b 100644 --- a/src/World.h +++ b/src/World.h @@ -121,15 +121,13 @@ public: public cTask { public: - cTaskSendBlockToAllPlayers(int a_BlockX, int a_BlockY, int a_BlockZ); + cTaskSendBlockToAllPlayers(std::vector & a_SendQueue); protected: // cTask overrides: virtual void Run(cWorld & a_World) override; - int m_BlockX; - int m_BlockY; - int m_BlockZ; + std::vector m_SendQueue; }; -- cgit v1.2.3