summaryrefslogtreecommitdiffstats
path: root/src/Simulator/Simulator.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-07-29 01:12:45 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-02 16:52:06 +0200
commit99856df6869d32731e6fdcfeb1460297410f5820 (patch)
treec93afdb7dac377ff6c04732190a3efbe3a091c4b /src/Simulator/Simulator.cpp
parentDo not impose redstone wakup penalty for all blocks (diff)
downloadcuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.gz
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.bz2
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.lz
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.xz
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.zst
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.zip
Diffstat (limited to 'src/Simulator/Simulator.cpp')
-rw-r--r--src/Simulator/Simulator.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/Simulator/Simulator.cpp b/src/Simulator/Simulator.cpp
index ac2e757e4..e55b77f0f 100644
--- a/src/Simulator/Simulator.cpp
+++ b/src/Simulator/Simulator.cpp
@@ -1,33 +1,38 @@
#include "Globals.h"
-#include "../World.h"
-#include "../Defines.h"
+#include "Simulator.h"
#include "../Chunk.h"
#include "../Cuboid.h"
+#include "../World.h"
-#ifdef __clang__
- #pragma clang diagnostic ignored "-Wweak-template-vtables"
-#endif // __clang__
-#include "Simulator.h"
+void cSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block)
+{
+ ASSERT(a_Chunk.IsValid());
+
+ AddBlock(a_Chunk, a_Position, a_Block);
+}
-void cSimulator::WakeUp(Vector3i a_Block, cChunk * a_Chunk)
+
+void cSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, Vector3i a_Offset, BLOCKTYPE a_Block)
{
- AddBlock(a_Block, a_Chunk);
+ ASSERT(a_Chunk.IsValid());
+
+ WakeUp(a_Chunk, a_Position, a_Block);
}
-void cSimulator::WakeUpArea(const cCuboid & a_Area)
+void cSimulator::WakeUp(const cCuboid & a_Area)
{
cCuboid area(a_Area);
area.Sort();
@@ -60,7 +65,8 @@ void cSimulator::WakeUpArea(const cCuboid & a_Area)
{
for (int x = startX; x <= endX; ++x)
{
- AddBlock({x, y, z}, &a_CBChunk);
+ const auto Position = cChunkDef::AbsoluteToRelative({ x, y, z });
+ AddBlock(a_CBChunk, Position, a_CBChunk.GetBlock(Position));
} // for x
} // for z
} // for y
@@ -70,7 +76,3 @@ void cSimulator::WakeUpArea(const cCuboid & a_Area)
} // for cx
} // for cz
}
-
-
-
-