Use SimulateChunk in redstone simulator
+ Improved performance, reduces bottleneck in chunkmap lookup * Stop allocating and throwing away lots of small vectors in Update/GetValidSourcePositions return values - Remove unused GetPowerLevel virtual
This commit is contained in:
@@ -34,10 +34,13 @@ public:
|
||||
const Vector3i a_CursorPos
|
||||
) override
|
||||
{
|
||||
const auto Meta = a_ChunkInterface.GetBlockMeta(a_BlockPos);
|
||||
|
||||
// Toggle the 3rd bit (addition / subtraction):
|
||||
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockPos);
|
||||
Meta ^= 0x04;
|
||||
a_ChunkInterface.SetBlockMeta(a_BlockPos, Meta);
|
||||
a_ChunkInterface.SetBlockMeta(a_BlockPos, Meta ^ 0x04);
|
||||
|
||||
// Update simulators:
|
||||
a_WorldInterface.WakeUpSimulators(a_BlockPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,6 +59,7 @@ public:
|
||||
UNUSED(a_ChunkInterface);
|
||||
UNUSED(a_BlockFace);
|
||||
|
||||
a_WorldInterface.WakeUpSimulators(a_BlockPos);
|
||||
a_WorldInterface.SendBlockTo(a_BlockPos, a_Player);
|
||||
}
|
||||
|
||||
@@ -120,15 +124,6 @@ public:
|
||||
|
||||
|
||||
|
||||
inline static bool IsOn(NIBBLETYPE a_Meta)
|
||||
{
|
||||
return ((a_Meta & 0x8) == 0x8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
inline static Vector3i GetSideCoordinate(Vector3i a_Position, NIBBLETYPE a_Meta, bool a_bInverse)
|
||||
{
|
||||
if (!a_bInverse)
|
||||
|
||||
Reference in New Issue
Block a user