mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-09-12 05:26:21 -04:00
fix: datapack/resourcepack parsing
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
542ab62ab7
commit
8c9b504382
@ -64,8 +64,6 @@ class DataPack : public Resource {
|
|||||||
[[nodiscard]] int compare(Resource const& other, SortType type) const override;
|
[[nodiscard]] int compare(Resource const& other, SortType type) const override;
|
||||||
[[nodiscard]] bool applyFilter(QRegularExpression filter) const override;
|
[[nodiscard]] bool applyFilter(QRegularExpression filter) const override;
|
||||||
|
|
||||||
virtual QString directory() { return "/data"; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
mutable QMutex m_data_lock;
|
mutable QMutex m_data_lock;
|
||||||
|
|
||||||
|
@ -23,6 +23,4 @@ class ResourcePack : public DataPack {
|
|||||||
|
|
||||||
/** Gets, respectively, the lower and upper versions supported by the set pack format. */
|
/** Gets, respectively, the lower and upper versions supported by the set pack format. */
|
||||||
std::pair<Version, Version> compatibleVersions() const override;
|
std::pair<Version, Version> compatibleVersions() const override;
|
||||||
|
|
||||||
QString directory() override { return "/assets"; }
|
|
||||||
};
|
};
|
||||||
|
@ -73,11 +73,6 @@ bool processFolder(DataPack* pack, ProcessingLevel level)
|
|||||||
return mcmeta_invalid(); // mcmeta file isn't a valid file
|
return mcmeta_invalid(); // mcmeta file isn't a valid file
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfo data_dir_info(FS::PathCombine(pack->fileinfo().filePath(), pack->directory()));
|
|
||||||
if (!data_dir_info.exists() || !data_dir_info.isDir()) {
|
|
||||||
return false; // data dir does not exists or isn't valid
|
|
||||||
}
|
|
||||||
|
|
||||||
if (level == ProcessingLevel::BasicInfoOnly) {
|
if (level == ProcessingLevel::BasicInfoOnly) {
|
||||||
return true; // only need basic info already checked
|
return true; // only need basic info already checked
|
||||||
}
|
}
|
||||||
@ -141,11 +136,6 @@ bool processZIP(DataPack* pack, ProcessingLevel level)
|
|||||||
return mcmeta_invalid(); // could not set pack.mcmeta as current file.
|
return mcmeta_invalid(); // could not set pack.mcmeta as current file.
|
||||||
}
|
}
|
||||||
|
|
||||||
QuaZipDir zipDir(&zip);
|
|
||||||
if (!zipDir.exists(pack->directory())) {
|
|
||||||
return false; // data dir does not exists at zip root
|
|
||||||
}
|
|
||||||
|
|
||||||
if (level == ProcessingLevel::BasicInfoOnly) {
|
if (level == ProcessingLevel::BasicInfoOnly) {
|
||||||
zip.close();
|
zip.close();
|
||||||
return true; // only need basic info already checked
|
return true; // only need basic info already checked
|
||||||
|
Loading…
x
Reference in New Issue
Block a user