Use minecraft
instead of .minecraft
for better accessibility
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
4cda04271f
commit
f54ac25614
@ -43,10 +43,10 @@ void InstanceCopyTask::executeTask()
|
|||||||
QFileInfo dotMCDir(FS::PathCombine(m_stagingPath, ".minecraft"));
|
QFileInfo dotMCDir(FS::PathCombine(m_stagingPath, ".minecraft"));
|
||||||
|
|
||||||
QString staging_mc_dir;
|
QString staging_mc_dir;
|
||||||
if (mcDir.exists() && !dotMCDir.exists())
|
if (dotMCDir.exists() && !mcDir.exists())
|
||||||
staging_mc_dir = mcDir.filePath();
|
|
||||||
else
|
|
||||||
staging_mc_dir = dotMCDir.filePath();
|
staging_mc_dir = dotMCDir.filePath();
|
||||||
|
else
|
||||||
|
staging_mc_dir = mcDir.filePath();
|
||||||
|
|
||||||
FS::copy savesCopy(FS::PathCombine(m_origInstance->gameRoot(), "saves"), FS::PathCombine(staging_mc_dir, "saves"));
|
FS::copy savesCopy(FS::PathCombine(m_origInstance->gameRoot(), "saves"), FS::PathCombine(staging_mc_dir, "saves"));
|
||||||
savesCopy.followSymlinks(true);
|
savesCopy.followSymlinks(true);
|
||||||
|
@ -164,8 +164,8 @@ void InstanceImportTask::processZipPack()
|
|||||||
} else if (technicFound) {
|
} else if (technicFound) {
|
||||||
// process as Technic pack
|
// process as Technic pack
|
||||||
qDebug() << "Technic:" << technicFound;
|
qDebug() << "Technic:" << technicFound;
|
||||||
extractDir.mkpath(".minecraft");
|
extractDir.mkpath("minecraft");
|
||||||
extractDir.cd(".minecraft");
|
extractDir.cd("minecraft");
|
||||||
m_modpackType = ModpackType::Technic;
|
m_modpackType = ModpackType::Technic;
|
||||||
} else {
|
} else {
|
||||||
QStringList paths_to_ignore{ "overrides/" };
|
QStringList paths_to_ignore{ "overrides/" };
|
||||||
|
@ -292,10 +292,10 @@ QString MinecraftInstance::gameRoot() const
|
|||||||
QFileInfo mcDir(FS::PathCombine(instanceRoot(), "minecraft"));
|
QFileInfo mcDir(FS::PathCombine(instanceRoot(), "minecraft"));
|
||||||
QFileInfo dotMCDir(FS::PathCombine(instanceRoot(), ".minecraft"));
|
QFileInfo dotMCDir(FS::PathCombine(instanceRoot(), ".minecraft"));
|
||||||
|
|
||||||
if (mcDir.exists() && !dotMCDir.exists())
|
if (dotMCDir.exists() && !mcDir.exists())
|
||||||
return mcDir.filePath();
|
|
||||||
else
|
|
||||||
return dotMCDir.filePath();
|
return dotMCDir.filePath();
|
||||||
|
else
|
||||||
|
return mcDir.filePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MinecraftInstance::binRoot() const
|
QString MinecraftInstance::binRoot() const
|
||||||
|
@ -37,7 +37,7 @@ void PackInstallTask::executeTask()
|
|||||||
progress(1, 2);
|
progress(1, 2);
|
||||||
|
|
||||||
m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [this] {
|
m_copyFuture = QtConcurrent::run(QThreadPool::globalInstance(), [this] {
|
||||||
FS::copy folderCopy(m_pack.path, FS::PathCombine(m_stagingPath, ".minecraft"));
|
FS::copy folderCopy(m_pack.path, FS::PathCombine(m_stagingPath, "minecraft"));
|
||||||
folderCopy.followSymlinks(true);
|
folderCopy.followSymlinks(true);
|
||||||
return folderCopy();
|
return folderCopy();
|
||||||
});
|
});
|
||||||
|
@ -137,7 +137,7 @@ void PackInstallTask::install()
|
|||||||
QDir unzipMcDir(m_stagingPath + "/unzip/minecraft");
|
QDir unzipMcDir(m_stagingPath + "/unzip/minecraft");
|
||||||
if (unzipMcDir.exists()) {
|
if (unzipMcDir.exists()) {
|
||||||
// ok, found minecraft dir, move contents to instance dir
|
// ok, found minecraft dir, move contents to instance dir
|
||||||
if (!QDir().rename(m_stagingPath + "/unzip/minecraft", m_stagingPath + "/.minecraft")) {
|
if (!QDir().rename(m_stagingPath + "/unzip/minecraft", m_stagingPath + "/minecraft")) {
|
||||||
emitFailed(tr("Failed to move unzipped Minecraft!"));
|
emitFailed(tr("Failed to move unzipped Minecraft!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ void PackInstallTask::install()
|
|||||||
bool fallback = true;
|
bool fallback = true;
|
||||||
|
|
||||||
// handle different versions
|
// handle different versions
|
||||||
QFile packJson(m_stagingPath + "/.minecraft/pack.json");
|
QFile packJson(m_stagingPath + "/minecraft/pack.json");
|
||||||
QDir jarmodDir = QDir(m_stagingPath + "/unzip/instMods");
|
QDir jarmodDir = QDir(m_stagingPath + "/unzip/instMods");
|
||||||
if (packJson.exists()) {
|
if (packJson.exists()) {
|
||||||
packJson.open(QIODevice::ReadOnly | QIODevice::Text);
|
packJson.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||||
|
@ -173,7 +173,7 @@ bool ModrinthCreationTask::createInstance()
|
|||||||
FS::ensureFilePathExists(new_index_place);
|
FS::ensureFilePathExists(new_index_place);
|
||||||
QFile::rename(index_path, new_index_place);
|
QFile::rename(index_path, new_index_place);
|
||||||
|
|
||||||
auto mcPath = FS::PathCombine(m_stagingPath, ".minecraft");
|
auto mcPath = FS::PathCombine(m_stagingPath, "minecraft");
|
||||||
|
|
||||||
auto override_path = FS::PathCombine(m_stagingPath, "overrides");
|
auto override_path = FS::PathCombine(m_stagingPath, "overrides");
|
||||||
if (QFile::exists(override_path)) {
|
if (QFile::exists(override_path)) {
|
||||||
@ -234,7 +234,7 @@ bool ModrinthCreationTask::createInstance()
|
|||||||
|
|
||||||
m_files_job.reset(new NetJob(tr("Mod Download Modrinth"), APPLICATION->network()));
|
m_files_job.reset(new NetJob(tr("Mod Download Modrinth"), APPLICATION->network()));
|
||||||
|
|
||||||
auto root_modpack_path = FS::PathCombine(m_stagingPath, ".minecraft");
|
auto root_modpack_path = FS::PathCombine(m_stagingPath, "minecraft");
|
||||||
auto root_modpack_url = QUrl::fromLocalFile(root_modpack_path);
|
auto root_modpack_url = QUrl::fromLocalFile(root_modpack_path);
|
||||||
|
|
||||||
for (auto file : m_files) {
|
for (auto file : m_files) {
|
||||||
|
@ -62,7 +62,7 @@ void Technic::SingleZipPackInstallTask::downloadSucceeded()
|
|||||||
m_abortable = false;
|
m_abortable = false;
|
||||||
|
|
||||||
setStatus(tr("Extracting modpack"));
|
setStatus(tr("Extracting modpack"));
|
||||||
QDir extractDir(FS::PathCombine(m_stagingPath, ".minecraft"));
|
QDir extractDir(FS::PathCombine(m_stagingPath, "minecraft"));
|
||||||
qDebug() << "Attempting to create instance from" << m_archivePath;
|
qDebug() << "Attempting to create instance from" << m_archivePath;
|
||||||
|
|
||||||
// open the zip and find relevant files in it
|
// open the zip and find relevant files in it
|
||||||
|
@ -140,7 +140,7 @@ void Technic::SolderPackInstallTask::downloadSucceeded()
|
|||||||
m_filesNetJob.reset();
|
m_filesNetJob.reset();
|
||||||
m_extractFuture = QtConcurrent::run([this]() {
|
m_extractFuture = QtConcurrent::run([this]() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
QString extractDir = FS::PathCombine(m_stagingPath, ".minecraft");
|
QString extractDir = FS::PathCombine(m_stagingPath, "minecraft");
|
||||||
FS::ensureFolderPathExists(extractDir);
|
FS::ensureFolderPathExists(extractDir);
|
||||||
|
|
||||||
while (m_modCount > i) {
|
while (m_modCount > i) {
|
||||||
|
@ -33,7 +33,7 @@ void Technic::TechnicPackProcessor::run(SettingsObjectPtr globalSettings,
|
|||||||
const QString& minecraftVersion,
|
const QString& minecraftVersion,
|
||||||
[[maybe_unused]] const bool isSolder)
|
[[maybe_unused]] const bool isSolder)
|
||||||
{
|
{
|
||||||
QString minecraftPath = FS::PathCombine(stagingPath, ".minecraft");
|
QString minecraftPath = FS::PathCombine(stagingPath, "minecraft");
|
||||||
QString configPath = FS::PathCombine(stagingPath, "instance.cfg");
|
QString configPath = FS::PathCombine(stagingPath, "instance.cfg");
|
||||||
auto instanceSettings = std::make_shared<INISettingsObject>(configPath);
|
auto instanceSettings = std::make_shared<INISettingsObject>(configPath);
|
||||||
MinecraftInstance instance(globalSettings, instanceSettings, stagingPath);
|
MinecraftInstance instance(globalSettings, instanceSettings, stagingPath);
|
||||||
|
Loading…
Reference in New Issue
Block a user