mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-09-08 19:41:30 -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]] bool applyFilter(QRegularExpression filter) const override;
|
||||
|
||||
virtual QString directory() { return "/data"; }
|
||||
|
||||
protected:
|
||||
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. */
|
||||
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
|
||||
}
|
||||
|
||||
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) {
|
||||
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.
|
||||
}
|
||||
|
||||
QuaZipDir zipDir(&zip);
|
||||
if (!zipDir.exists(pack->directory())) {
|
||||
return false; // data dir does not exists at zip root
|
||||
}
|
||||
|
||||
if (level == ProcessingLevel::BasicInfoOnly) {
|
||||
zip.close();
|
||||
return true; // only need basic info already checked
|
||||
|
Loading…
x
Reference in New Issue
Block a user