2016-07-23 17:06:31 +05:30
|
|
|
#include "CreateServerResourcePacksFolder.h"
|
|
|
|
#include "minecraft/MinecraftInstance.h"
|
|
|
|
#include "launch/LaunchTask.h"
|
2016-12-12 19:06:42 +05:30
|
|
|
#include "FileSystem.h"
|
2016-07-23 17:06:31 +05:30
|
|
|
|
|
|
|
CreateServerResourcePacksFolder::CreateServerResourcePacksFolder(LaunchTask* parent): LaunchStep(parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CreateServerResourcePacksFolder::executeTask()
|
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
auto instance = m_parent->instance();
|
|
|
|
std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
|
2018-07-28 03:27:09 +05:30
|
|
|
if(!FS::ensureFolderPathExists(FS::PathCombine(minecraftInstance->gameRoot(), "server-resource-packs")))
|
2018-07-15 18:21:05 +05:30
|
|
|
{
|
|
|
|
emit logLine(tr("Couldn't create the 'server-resource-packs' folder"), MessageLevel::Error);
|
|
|
|
}
|
|
|
|
emitSucceeded();
|
2016-07-23 17:06:31 +05:30
|
|
|
}
|