From c4c8e99681e14e5d0e82a13cb0631107dedf96ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 17 Apr 2017 22:51:30 +0200 Subject: NOISSUE jar mods as libraries, fix for customizing net.minecraft --- api/logic/minecraft/Library.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'api/logic/minecraft/Library.h') diff --git a/api/logic/minecraft/Library.h b/api/logic/minecraft/Library.h index 6369c537..9577de33 100644 --- a/api/logic/minecraft/Library.h +++ b/api/logic/minecraft/Library.h @@ -48,6 +48,7 @@ public: newlib->m_rules = base->m_rules; newlib->m_storagePrefix = base->m_storagePrefix; newlib->m_mojangDownloads = base->m_mojangDownloads; + newlib->m_filename = base->m_filename; return newlib; } @@ -108,6 +109,23 @@ public: /* methods */ m_absoluteURL = absolute_url; } + void setFilename(const QString &filename) + { + m_filename = filename; + } + + /// Get the file name of the library + QString filename(OpSys system) const; + + // DEPRECATED: set a display name, used by jar mods only + void setDisplayName(const QString & displayName) + { + m_displayname = displayName; + } + + /// Get the file name of the library + QString displayName(OpSys system) const; + void setMojangDownloadInfo(MojangLibraryDownloadInfo::Ptr info) { m_mojangDownloads = info; @@ -127,6 +145,9 @@ public: /* methods */ /// Returns true if the library should be loaded (or extracted, in case of natives) bool isActive() const; + /// Returns true if the library is contained in an instance and false if it is shared + bool isLocal() const; + // Get a list of downloads for this library QList getDownloads(OpSys system, class HttpMetaCache * cache, QStringList & failedFiles, const QString & overridePath) const; @@ -138,7 +159,7 @@ private: /* methods */ /// Get the prefix - root of the storage to be used QString storagePrefix() const; - /// Get the relative path where the library should be saved + /// Get the relative file path where the library should be saved QString storageSuffix(OpSys system) const; QString hint() const @@ -156,6 +177,12 @@ protected: /* data */ /// DEPRECATED: MultiMC-specific absolute URL. takes precedence over the implicit maven repo URL, if defined QString m_absoluteURL; + /// MultiMC extension - filename override + QString m_filename; + + /// DEPRECATED MultiMC extension - display name + QString m_displayname; + /** * MultiMC-specific type hint - modifies how the library is treated */ -- cgit v1.2.3