From 5fabb4f2546fa6b79a4e2c29679f506e587a0070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 27 Mar 2017 03:34:39 +0200 Subject: NOISSUE Rough refactor of ProfilePatch and VersionFile internals. They are now distinct classes with distinct responsibilities. * ProfilePatch is an entry in MinecraftProfile and can hold VersionFile or Meta::Version. * VersionFile is the basic element that holds version information loaded from JSON. * Meta::Version is the loader class for VersionFile(s) from a server. --- api/logic/minecraft/ftb/FTBProfileStrategy.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'api/logic/minecraft/ftb') diff --git a/api/logic/minecraft/ftb/FTBProfileStrategy.cpp b/api/logic/minecraft/ftb/FTBProfileStrategy.cpp index 45765cd4..c3d9cc6a 100644 --- a/api/logic/minecraft/ftb/FTBProfileStrategy.cpp +++ b/api/logic/minecraft/ftb/FTBProfileStrategy.cpp @@ -29,7 +29,6 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches() auto file = ProfileUtils::parseJsonFile(QFileInfo(mcJson), false); file->uid = "net.minecraft"; file->name = QObject::tr("Minecraft (tracked)"); - file->setVanilla(true); if(file->version.isEmpty()) { file->version = mcVersion; @@ -39,7 +38,8 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches() addLib->setHint("local"); addLib->setStoragePrefix(nativeInstance->librariesPath().absolutePath()); } - minecraftPatch = std::dynamic_pointer_cast(file); + minecraftPatch = std::make_shared(file); + minecraftPatch->setVanilla(true); } else { @@ -65,7 +65,6 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches() addLib->setStoragePrefix(nativeInstance->librariesPath().absolutePath()); } file->uid = "org.multimc.ftb.pack"; - file->setVanilla(true); file->name = QObject::tr("%1 (FTB pack)").arg(m_instance->name()); if(file->version.isEmpty()) { @@ -81,7 +80,8 @@ void FTBProfileStrategy::loadDefaultBuiltinPatches() } } } - packPatch = std::dynamic_pointer_cast(file); + packPatch = std::make_shared(file); + packPatch->setVanilla(true); } else { -- cgit v1.2.3