Wake up redstone simulator on slot changes for blockentities (#4348)
Fix #1898 Fix #2194 Fix #3063
This commit is contained in:
parent
528db6eea7
commit
4de232bdae
@ -8,6 +8,7 @@
|
||||
|
||||
#include "Globals.h"
|
||||
#include "BlockEntityWithItems.h"
|
||||
#include "../Simulator/RedstoneSimulator.h"
|
||||
|
||||
|
||||
|
||||
@ -68,5 +69,12 @@ void cBlockEntityWithItems::OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
|
||||
}
|
||||
|
||||
m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
|
||||
auto Pos = Vector3i(m_PosX, m_PosY, m_PosZ);
|
||||
m_World->DoWithChunkAt(Pos, [&](cChunk & a_Chunk)
|
||||
{
|
||||
m_World->GetRedstoneSimulator()->WakeUp(Pos, &a_Chunk);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "BlockEntityWithItems.h"
|
||||
#include "../Simulator/RedstoneSimulator.h"
|
||||
|
||||
|
||||
|
||||
@ -89,6 +90,13 @@ private:
|
||||
}
|
||||
|
||||
m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
|
||||
auto Pos = Vector3i(m_PosX, m_PosY, m_PosZ);
|
||||
m_World->DoWithChunkAt(Pos, [&](cChunk & a_Chunk)
|
||||
{
|
||||
m_World->GetRedstoneSimulator()->WakeUp(Pos, &a_Chunk);
|
||||
return true;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user