diff options
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/World.cpp b/src/World.cpp index 0ae115001..a1e392fd1 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -465,6 +465,10 @@ void cWorld::Start(void) m_bCommandBlocksEnabled = IniFile.GetValueSetB("Mechanics", "CommandBlocksEnabled", false); m_bEnabledPVP = IniFile.GetValueSetB("Mechanics", "PVPEnabled", true); m_bUseChatPrefixes = IniFile.GetValueSetB("Mechanics", "UseChatPrefixes", true); + m_MinNetherPortalWidth = IniFile.GetValueSetI("Mechanics", "MinNetherPortalWidth", 2); + m_MaxNetherPortalWidth = IniFile.GetValueSetI("Mechanics", "MaxNetherPortalWidth", 21); + m_MinNetherPortalHeight = IniFile.GetValueSetI("Mechanics", "MinNetherPortalHeight", 3); + m_MaxNetherPortalHeight = IniFile.GetValueSetI("Mechanics", "MaxNetherPortalHeight", 21); m_VillagersShouldHarvestCrops = IniFile.GetValueSetB("Monsters", "VillagersShouldHarvestCrops", true); m_IsDaylightCycleEnabled = IniFile.GetValueSetB("General", "IsDaylightCycleEnabled", true); int GameMode = IniFile.GetValueSetI("General", "Gamemode", (int)m_GameMode); @@ -3080,7 +3084,11 @@ void cWorld::QueueTask(cTaskPtr a_Task) } - +void cWorld::ScheduleTask(int a_DelayTicks, std::function<void (cWorld&)> a_Func) +{ + cTaskLambda task(a_Func); + ScheduleTask(a_DelayTicks, static_cast<cTaskPtr>(std::make_shared<cTaskLambda>(task))); +} void cWorld::ScheduleTask(int a_DelayTicks, cTaskPtr a_Task) @@ -3583,8 +3591,10 @@ void cWorld::cTaskSendBlockToAllPlayers::Run(cWorld & a_World) a_World.ForEachPlayer(PlayerCallback); } - - +void cWorld::cTaskLambda::Run(cWorld & a_World) +{ + m_func(a_World); +} //////////////////////////////////////////////////////////////////////////////// |