summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/launch/CreateServerResourcePacksFolder.cpp
blob: 5398f7d03a62b38f7c6315605de2ccbe4db88fb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "CreateServerResourcePacksFolder.h"
#include "minecraft/MinecraftInstance.h"
#include "launch/LaunchTask.h"
#include "FileSystem.h"

CreateServerResourcePacksFolder::CreateServerResourcePacksFolder(LaunchTask* parent): LaunchStep(parent)
{
}

void CreateServerResourcePacksFolder::executeTask()
{
	auto instance = m_parent->instance();
	std::shared_ptr<MinecraftInstance> minecraftInstance = std::dynamic_pointer_cast<MinecraftInstance>(instance);
	if(!FS::ensureFolderPathExists(FS::PathCombine(minecraftInstance->minecraftRoot(), "server-resource-packs")))
	{
		emit logLine(tr("Couldn't create the 'server-resource-packs' folder"), MessageLevel::Error);
	}
	emitSucceeded();
}