summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-02-08 22:21:48 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-02-08 22:21:48 +0100
commit3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0 (patch)
tree263dd59173d388fa8e7c83d51c928004a230737a /src/World.cpp
parentProtocol 1.7: Fixed Coverity issues. (diff)
downloadcuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.gz
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.bz2
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.lz
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.xz
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.tar.zst
cuberite-3869f76cc23c6ed1df1ad4f6de9c2561f95e08f0.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 474f77b81..0f3740877 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -47,6 +47,7 @@
#include "Generating/Trees.h"
#include "Bindings/PluginManager.h"
#include "Blocks/BlockHandler.h"
+#include "Blocks/BlockBed.cpp"
#include "Tracer.h"
@@ -3578,7 +3579,7 @@ void cWorld::cTaskUnloadUnusedChunks::Run(cWorld & a_World)
////////////////////////////////////////////////////////////////////////////////
-// cWorld::cTaskSendBlockTo
+// cWorld::cTaskSendBlockToAllPlayers
cWorld::cTaskSendBlockToAllPlayers::cTaskSendBlockToAllPlayers(std::vector<Vector3i> & a_SendQueue) :
m_SendQueue(a_SendQueue)
@@ -3621,6 +3622,30 @@ void cWorld::cTaskSendBlockToAllPlayers::Run(cWorld & a_World)
////////////////////////////////////////////////////////////////////////////////
+// cWorld::cTaskSendBlockToAllPlayers
+
+cWorld::cTaskTryAwakeSleepingPlayers::cTaskTryAwakeSleepingPlayers(const Vector3i & a_Position, cChunkInterface & a_ChunkInterface) :
+ m_Position(a_Position),
+ m_ChunkInterface(a_ChunkInterface)
+{
+}
+
+void cWorld::cTaskTryAwakeSleepingPlayers::Run(cWorld & a_World)
+{
+ cTimeFastForwardTester Tester;
+ if (a_World.ForEachPlayer(Tester))
+ {
+ cPlayerBedStateUnsetter Unsetter(m_Position, m_ChunkInterface);
+ a_World.ForEachPlayer(Unsetter);
+ a_World.SetTimeOfDay(0);
+ }
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
// cWorld::cChunkGeneratorCallbacks:
cWorld::cChunkGeneratorCallbacks::cChunkGeneratorCallbacks(cWorld & a_World) :