summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 3e7c0ef74..6520702c7 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -871,16 +871,11 @@ void cWorld::TickScheduledTasks()
// Make a copy of the tasks to avoid deadlocks on accessing m_Tasks
{
cCSLock Lock(m_CSScheduledTasks);
- ScheduledTaskList::iterator itr = m_ScheduledTasks.begin();
- while (itr != m_ScheduledTasks.end() && (*itr)->Ticks > 0)
+ while (!m_ScheduledTasks.empty() && m_ScheduledTasks.front()->Ticks < m_WorldAge)
{
Tasks.push_back(m_ScheduledTasks.front());
m_ScheduledTasks.pop_front();
}
- for(;itr != m_ScheduledTasks.end(); itr++)
- {
- (*itr)->Ticks--;
- }
}
// Execute and delete each task:
@@ -1149,6 +1144,15 @@ bool cWorld::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBl
+bool cWorld::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback)
+{
+ return m_ChunkMap->DoWithCommandBlockAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback);
+}
+
+
+
+
+
bool cWorld::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4)
{
return m_ChunkMap->GetSignLines(a_BlockX, a_BlockY, a_BlockZ, a_Line1, a_Line2, a_Line3, a_Line4);
@@ -2625,6 +2629,7 @@ void cWorld::QueueTask(cTask * a_Task)
void cWorld::ScheduleTask(cScheduledTask * a_Task)
{
+ a_Task->Ticks = a_Task->Ticks + m_WorldAge;
cCSLock Lock(m_CSScheduledTasks);
for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++)
{
@@ -2766,9 +2771,6 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp
{
Monster->SetPosition(a_PosX, a_PosY, a_PosZ);
}
-
- // Because it's logical that ALL mob spawns need spawn effects, not just spawners
- BroadcastSoundParticleEffect(2004, (int)a_PosX, (int)a_PosY, (int)a_PosZ, 0);
return SpawnMobFinalize(Monster);
}