-
+
Thanks for downloading Drehmal! To start the server, run the
-
-
-
-
-
-
- Thanks for downloading Drehmal! To start the server, run the
- {{ executable }}
- file. This opens a terminal window for the server in which you can
- enter commands.
-
-
Thanks for downloading Drehmal! To get started, open the Minecraft
- launcher and select the Drehmal Apotheosis profile, then hit play.;
+ launcher and select the Drehmal Apotheosis profile, then hit play.
-
-
+
![](../assets/images/transparent-logo.png)
+
+ Credit for the resources used in this project can be found on
+ GitHub. Enjoy!
+
@@ -62,36 +36,20 @@
diff --git a/src/pages/InstallOptions.vue b/src/pages/InstallOptions.vue
new file mode 100644
index 0000000..62e19be
--- /dev/null
+++ b/src/pages/InstallOptions.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/providers/DownloadFile.ts b/src/providers/DownloadFile.ts
index f33ea59..df27ccb 100644
--- a/src/providers/DownloadFile.ts
+++ b/src/providers/DownloadFile.ts
@@ -18,7 +18,7 @@ export function downloadFile(
// User-Agent: github_username/project_name/1.56.0 (launcher.com)
const options = {
headers: {
- 'User-Agent': 'Drehmal-Team/installer/0.3.1 (drehmal.net)',
+ 'User-Agent': 'Drehmal-Team/installer/0.4.0 (drehmal.net)',
// 'accept-encoding': 'gzip, deflate, br',
},
};
diff --git a/src/providers/DownloadMods.ts b/src/providers/DownloadMods.ts
index 680af71..4605594 100644
--- a/src/providers/DownloadMods.ts
+++ b/src/providers/DownloadMods.ts
@@ -5,20 +5,25 @@ import { useStateStore } from 'src/stores/StateStore';
import { Ref } from 'vue';
import { downloadFile } from './DownloadFile';
import { getOldDirName } from './GetOldDirName';
+import { installShaders } from './InstallShaders';
const fs = require('fs');
const path = require('path');
export async function downloadMods(ref: Ref) {
const startTime = Date.now();
- const { launcher } = storeToRefs(useSourcesStore());
- const { drehmalDir } = storeToRefs(useInstallerStore());
- const { processingMods } = storeToRefs(useStateStore());
+ const { launcher, shaders } = storeToRefs(useSourcesStore());
+ const { drehmalDir, shaders: enableShaders } = storeToRefs(
+ useInstallerStore()
+ );
+ const { processingMods, installType } = storeToRefs(useStateStore());
const modList = launcher.value.modList;
const modLoader = launcher.value.fabric.name;
const totalMods = modList.length;
- let downloaded = 0;
+ // +2 for cit and shaders, +1 for cit if shaders are not enabled
+ const progressBar = totalMods + (enableShaders.value ? 2 : 1);
+ let completed = 0;
const modsPath = path.join(drehmalDir.value, 'mods');
@@ -36,22 +41,29 @@ export async function downloadMods(ref: Ref) {
console.log(`Downloading "${modName}" to "${modsPath}"`);
const modPath = path.join(modsPath, modName);
await downloadFile(source, modPath);
- downloaded++;
- const progress = downloaded / totalMods;
+ completed++;
+ const progress = completed / progressBar;
const percent = (progress * 100).toFixed(1);
ref.value.progress = progress;
ref.value.percent = percent;
// Note: Roughly 21 character limit, consider truncating mod name
- ref.value.label = `Downloading: ${name}`;
+ // if singleplayer install, trunc mod name
+ // Downloading: Reese's Sodium Options
+ const labelStr = `Downloading: ${name}`;
+ if (installType.value === 'singleplayer' && labelStr.length > 30)
+ ref.value.label = labelStr.slice(0, 30) + '...';
+ else ref.value.label = labelStr;
const taken = ((Date.now() - startTime) / 1000).toFixed(2);
console.log(
- `Downloaded mod ${downloaded}/${totalMods} (${taken}s elapsed)`
+ `Downloaded mod ${completed}/${totalMods} (${taken}s elapsed)`
);
}
}
await processArray(modList);
+ ref.value.label = 'Configuring mods';
+
const configPath = path.join(drehmalDir.value, 'config');
if (!fs.existsSync(configPath)) fs.mkdirSync(configPath, { recursive: true });
console.log(`Creating CIT config file in "${configPath}"`);
@@ -68,8 +80,27 @@ export async function downloadMods(ref: Ref) {
JSON.stringify(citJsonConfig),
'utf-8'
);
+ completed++;
+
+ ref.value.progress = completed / progressBar;
+ ref.value.percent = (ref.value.progress * 100).toFixed(1);
+
+ if (!enableShaders.value) {
+ console.log(
+ 'Shaders not selected, skipping installation, but configuring iris.properties'
+ );
+ await installShaders();
+ ref.value.label = 'Mods successfully downloaded!';
+ } else if (enableShaders.value) {
+ console.log('Shaders selected, proceeding to install...');
+ ref.value.label = `Downloading: ${shaders.value.name}`;
+ await installShaders();
+ completed++;
+ ref.value.progress = completed / progressBar;
+ ref.value.percent = (ref.value.progress * 100).toFixed(1);
+ ref.value.label = 'Mods and shaders successfully downloaded!';
+ }
- ref.value.label = 'Mods successfully downloaded!';
ref.value.img =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAeCAYAAABuUU38AAAACXBIWXMAAAsTAAALEwEAmpwYAAACqElEQVRYhdVYzY7SUBT+Tu1CTWRaG4UncKMOxOWMhhg37khYwBgT43P4ADyIiSawMLBzA0LUWRLGv4VPwMwECjVhiJYeF6W1pTBD7+2Mw7e67b0993733HvOd0r1ahuFUh6NWoexgSiU8tSodUDMjEatw0QETb/2v9cVCyPzBMyMQilPVK+2GQAUhbClbRaR8egEjuMeJBUA9JvX/U7DSElP8OJp59T+1+/z0nMMBpa/8eZw4hLx4JG4mlKjX8ZALqOv7Ov1TWn7U8uGYaQwGFj+u4hFkUnKO02/zQBq+09OHb+324LDDFpz/LI1Ti079E4FxbKxFPfSGq6Qa+jn8NeZ47fTmt/u9U35BRCgkgST8m4TzPF39NW7B6HnZw9bmDkc244HAqC4zhVDNq1DIXmX3r+tQVXk7Ciyi0jgZCYCKSIOMxTJnfRAkp4VioOVYhffjsZ4++mx0KSlQJQjANX53agUu+j1TaG7IhzQbccR/TSUZw4OE4haIHEiIijvtsDMyGV0KY9GwRdLJBvIHw4nK7YTIbI332lvaYtnPOiJ78djvPmYlCf+IREiwUz95XAU6c+mNZ/kzDmfsicRIl6mrhS72E5roagEuES/Ho1Q/SyWudeBMBFVWZ2CglGJ4YZYGSm0DqhebbNXjxhGKpb6fZnvYPLHjtyJSrHrtw/6pp8nVqG00wQRYnlsatm+jDeHE7nMfse4kYjWymV0Xz2L4lzC76K6vQjIi8ZLohqlPOLtvFeXeDhLKy1GNdE6JIhEjlY2HdBOa1R8yWutJUSmlh27bl+8E88ffcDM4YgMUYjgsHglGFzjIkIrHgwsGEZq6cA4uHtra+n737MZfhxb0vYBhP6gAPM84j0E/29tAszhxG8ruDzVqgzIO1oEgIMMNwgEAH8Bhif2yStQayoAAAAOZVhJZk1NACoAAAAIAAAAAAAAANJTkwAAAABJRU5ErkJggg==';
processingMods.value = false;
diff --git a/src/providers/InstallServer.ts b/src/providers/InstallServer.ts
index 5ba6bc3..727031c 100644
--- a/src/providers/InstallServer.ts
+++ b/src/providers/InstallServer.ts
@@ -10,7 +10,9 @@ const path = require('path');
export async function installServer(ref: Ref) {
const { server } = storeToRefs(useSourcesStore());
- const { serverDir, memory, javawExePath } = storeToRefs(useInstallerStore());
+ const { serverDir, memory, javawExePath, serverOpts } = storeToRefs(
+ useInstallerStore()
+ );
const serverPath = path.join(serverDir.value, 'server.jar');
console.log(`Downloading server jar to "${serverPath}"`);
@@ -39,9 +41,17 @@ export async function installServer(ref: Ref) {
ref.value.label = 'Updating server properties';
console.log(`Creating server.properties with ${server.value.properties}`);
+ const serverProperties = server.value.properties.map(
+ (property) => property
+ );
+ for (const key in serverOpts.value)
+ serverProperties.push(
+ `${key}=${serverOpts.value[key as keyof typeof serverOpts.value]}`
+ );
+
fs.writeFileSync(
path.join(serverDir.value, 'server.properties'),
- server.value.properties,
+ serverProperties.join('\n'),
'utf-8'
);
await new Promise((resolve) => setTimeout(resolve, 100));
diff --git a/src/providers/InstallShaders.ts b/src/providers/InstallShaders.ts
new file mode 100644
index 0000000..7f6acdd
--- /dev/null
+++ b/src/providers/InstallShaders.ts
@@ -0,0 +1,54 @@
+const fs = require('fs');
+import { storeToRefs } from 'pinia';
+import { useInstallerStore } from 'src/stores/InstallerStore';
+import { useSourcesStore } from 'src/stores/SourcesStore';
+import { downloadFile } from './DownloadFile';
+const path = require('path');
+
+export async function installShaders() {
+ const { drehmalDir, shaders: enableShaders } = storeToRefs(
+ useInstallerStore()
+ );
+ const { shaders } = storeToRefs(useSourcesStore());
+
+ const shadersDir = path.join(drehmalDir.value, 'shaderpacks');
+ const shadersName =
+ shaders.value.name + ' v' + shaders.value.version + '.zip';
+
+ // If user has selected shaders, then download them
+ if (enableShaders.value) {
+ console.log(`Downloading shaders to "${shadersDir}"`);
+
+ if (!fs.existsSync(shadersDir))
+ fs.mkdirSync(shadersDir, { recursive: true });
+ await downloadFile(
+ shaders.value.source,
+ path.join(shadersDir, shadersName)
+ );
+
+ const shadersConfigPath = path.join(shadersDir, `${shadersName}.txt`);
+ const shadersConfigValues = ['Crossprocess=true', 'sunPathRotation=-0.15f'];
+ console.log(`Writing shaders.txt to "${shadersConfigPath}"`);
+ fs.writeFileSync(shadersConfigPath, shadersConfigValues.join('\n'));
+ }
+
+ // Even if shaders aren't selected, configure Iris shaders but in the case of no, then mark as disabled
+ // This allows someone to rerun the installer to disable shaders
+ const irisConfigPath = path.join(
+ drehmalDir.value,
+ 'config',
+ 'iris.properties'
+ );
+ const irisConfigValues = [
+ 'disableUpdateMessage=false',
+ 'enableDebugOptions=false',
+ 'maxShadowRenderDistance=32',
+ `shaderPack=${shadersName}`,
+ `enableShaders=${enableShaders.value ? 'true' : 'false'}`,
+ ];
+
+ console.log(`Writing iris.properties to "${irisConfigPath}"`);
+ fs.writeFileSync(irisConfigPath, irisConfigValues.join('\n'));
+
+ return;
+}
diff --git a/src/providers/JavaDownload.ts b/src/providers/JavaDownload.ts
index b1213c9..79b1595 100644
--- a/src/providers/JavaDownload.ts
+++ b/src/providers/JavaDownload.ts
@@ -7,7 +7,6 @@ const { ipcRenderer } = require('electron');
const os = require('os');
const path = require('path');
const fs = require('fs');
-const https = require('https');
const tar = require('tar');
/*
diff --git a/src/router/routes.ts b/src/router/routes.ts
index 2ceebeb..1df7720 100644
--- a/src/router/routes.ts
+++ b/src/router/routes.ts
@@ -34,7 +34,7 @@ const routes: RouteRecordRaw[] = [
title: 'Single Player Installation',
socials: false,
back: '/select/',
- next: '/install/',
+ next: '/configure/',
},
},
{
@@ -44,7 +44,7 @@ const routes: RouteRecordRaw[] = [
title: 'Multi-Player Installation',
socials: false,
back: '/select/',
- next: '/install/',
+ next: '/configure/',
},
},
{
@@ -55,6 +55,17 @@ const routes: RouteRecordRaw[] = [
title: 'Server Installation',
socials: false,
back: '/select/',
+ next: '/configure/',
+ },
+ },
+ // Install configuration
+ {
+ path: '/configure/',
+ component: () => import('src/pages/InstallOptions.vue'),
+ meta: {
+ title: 'Configure Installation',
+ socials: false,
+ back: '/select/',
next: '/install/',
},
},
diff --git a/src/stores/InstallerStore.ts b/src/stores/InstallerStore.ts
index f4e2969..c3c3e0a 100644
--- a/src/stores/InstallerStore.ts
+++ b/src/stores/InstallerStore.ts
@@ -1,8 +1,10 @@
-import { defineStore } from 'pinia';
+import { defineStore, storeToRefs } from 'pinia';
import { ref } from 'vue';
+import { useSourcesStore } from './SourcesStore';
const path = require('path');
export const useInstallerStore = defineStore('installer', () => {
+ const { map } = storeToRefs(useSourcesStore());
// Use empty values for now, this will be overwritten with *actual* defaults on app launch using electron
const homeDir = ref('');
const appDir = ref('');
@@ -19,6 +21,15 @@ export const useInstallerStore = defineStore('installer', () => {
parseInt(process.env.MINECRAFT_MEMORY ? process.env.MINECRAFT_MEMORY : '4')
);
+ const shaders = ref(false);
+ const serverOpts = ref({
+ motd: map.value.versionName,
+ pvp: false,
+ difficulty: 'normal',
+ hardcore: false,
+ maxPlayers: 10,
+ });
+
return {
homeDir,
appDir,
@@ -29,5 +40,7 @@ export const useInstallerStore = defineStore('installer', () => {
memory,
javaExePath,
javawExePath,
+ shaders,
+ serverOpts,
};
});
diff --git a/src/stores/SourcesStore.ts b/src/stores/SourcesStore.ts
index 1b0d805..e10ef11 100644
--- a/src/stores/SourcesStore.ts
+++ b/src/stores/SourcesStore.ts
@@ -190,22 +190,34 @@ export const useSourcesStore = defineStore('sources', () => {
mod_version: '0.7.1',
},
],
+
launcher_icon:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHoklEQVR4Xr2by24dRRCG52RhoySABSGwQUiAiLxAQmzZsGOBeAJehEfIi+QRsu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gE4uKpTKhshXA5zPv3fyJ8S5BNg9xjtauNNWAQwGUNEGc4GlQOBWc+yvRQSPDEAAskOCb2MqgvCKuJkAFqfvyhNYeU6WZjlGpDPPqGF0NiAB4ISlTQ9MxGiXyrvc2KsIiCF5tEM5jM4CDICRxvxK+LNheURS2ZU1wt8KeBmSrfOjvXH98SH/WNZzX3yot/rIB8FGYne8oiNHd6iotzlVilTK50UlaQnMfW8c9ZPVlDvPlaFajNyqwtq8IfigIayPlzVfMDl+qHHplBjv1VqsicJYQzWBv1pT99atRWh80awDWCOng2ftD2SSt37k2SNp4dwKj/SuUbAGwOErHaO8NZq/OyQMjYEZeea++qzgKhtvj1bz+9j/yiDyyPT87LgAAAA5lWElmTU0AKgAAAAgAAAAAAAAA0lOTAAAAAElFTkSuQmCC',
});
+ const shaders = ref({
+ name: 'Sildurs Enhanced Default',
+ version: '1.16',
+ source:
+ 'https://mediafilez.forgecdn.net/files/4688/998/Sildur%27s%20Enhanced%20Default%20v1.16%20Fancy.zip',
+ });
+
const server = ref({
// per https://minecraft.wiki/w/Java_Edition_1.17.1
source:
'https://piston-data.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar',
- properties:
- 'enable-command-block=true\nview-distance=16\nspawn-protection=0\nview-distance=12\n',
+ properties: [
+ 'enable-command-block=true',
+ 'view-distance=16',
+ 'spawn-protection=0',
+ ],
});
return {
map,
resourcePack,
launcher,
+ shaders,
server,
};
});