summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/MinecraftInstance.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft/MinecraftInstance.h')
-rw-r--r--api/logic/minecraft/MinecraftInstance.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/api/logic/minecraft/MinecraftInstance.h b/api/logic/minecraft/MinecraftInstance.h
new file mode 100644
index 00000000..cd3a8d90
--- /dev/null
+++ b/api/logic/minecraft/MinecraftInstance.h
@@ -0,0 +1,69 @@
+#pragma once
+#include "BaseInstance.h"
+#include "minecraft/Mod.h"
+#include <QProcess>
+
+#include "multimc_logic_export.h"
+
+class ModList;
+class WorldList;
+
+class MULTIMC_LOGIC_EXPORT MinecraftInstance: public BaseInstance
+{
+public:
+ MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
+ virtual ~MinecraftInstance() {};
+
+ /// Path to the instance's minecraft directory.
+ QString minecraftRoot() const;
+
+ ////// Mod Lists //////
+ virtual std::shared_ptr<ModList> resourcePackList() const
+ {
+ return nullptr;
+ }
+ virtual std::shared_ptr<ModList> texturePackList() const
+ {
+ return nullptr;
+ }
+ virtual std::shared_ptr<WorldList> worldList() const
+ {
+ return nullptr;
+ }
+ /// get all jar mods applicable to this instance's jar
+ virtual QList<Mod> getJarMods() const
+ {
+ return QList<Mod>();
+ }
+
+ /// get the launch script to be used with this
+ virtual QString createLaunchScript(AuthSessionPtr session) = 0;
+
+ //FIXME: nuke?
+ virtual std::shared_ptr<BaseVersionList> versionList() const override;
+
+ /// get arguments passed to java
+ QStringList javaArguments() const;
+
+ /// get variables for launch command variable substitution/environment
+ virtual QMap<QString, QString> getVariables() const override;
+
+ /// create an environment for launching processes
+ virtual QProcessEnvironment createEnvironment() override;
+
+ /// guess log level from a line of minecraft log
+ virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level) override;
+
+ virtual IPathMatcher::Ptr getLogFileMatcher() override;
+
+ virtual QString getLogFileRoot() override;
+
+ virtual QString getStatusbarDescription() override;
+
+protected:
+ QMap<QString, QString> createCensorFilterFromSession(AuthSessionPtr session);
+private:
+ QString prettifyTimeDuration(int64_t duration);
+};
+
+typedef std::shared_ptr<MinecraftInstance> MinecraftInstancePtr;