diff --git a/public/home/clients/index.html b/public/home/clients/index.html
index d85fa70..51b22ea 100644
--- a/public/home/clients/index.html
+++ b/public/home/clients/index.html
@@ -16,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/home/downloads/index.html b/public/home/downloads/index.html
index 44bd3d9..477a17e 100644
--- a/public/home/downloads/index.html
+++ b/public/home/downloads/index.html
@@ -16,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/home/game/index.html b/public/home/game/index.html
index bf3b852..823676f 100644
--- a/public/home/game/index.html
+++ b/public/home/game/index.html
@@ -16,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/mobile/index.html b/public/mobile/index.html
index 45d1019..679bcd6 100644
--- a/public/mobile/index.html
+++ b/public/mobile/index.html
@@ -13,7 +13,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/mods/mods/index.html b/public/mods/mods/index.html
index a5fbf01..1c27279 100644
--- a/public/mods/mods/index.html
+++ b/public/mods/mods/index.html
@@ -9,7 +9,6 @@
-
@@ -17,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/mods/resourcepacks/index.html b/public/mods/resourcepacks/index.html
index 4bbccc3..d9422c8 100644
--- a/public/mods/resourcepacks/index.html
+++ b/public/mods/resourcepacks/index.html
@@ -9,7 +9,6 @@
-
diff --git a/public/welcome/index.html b/public/welcome/index.html
index a95d4cc..7f17293 100644
--- a/public/welcome/index.html
+++ b/public/welcome/index.html
@@ -14,7 +14,7 @@
@@ -17,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/offline.html b/public/offline.html
index c604b59..9ebc3c1 100644
--- a/public/offline.html
+++ b/public/offline.html
@@ -17,7 +17,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/resources/mods/data.json b/public/resources/data/mods.json
similarity index 100%
rename from public/resources/mods/data.json
rename to public/resources/data/mods.json
diff --git a/public/resources/data/updates.json b/public/resources/data/updates.json
new file mode 100644
index 0000000..67cc5c6
--- /dev/null
+++ b/public/resources/data/updates.json
@@ -0,0 +1,59 @@
+[
+ {
+ "version": "1.6.0",
+ "changelog": [
+ "You can now install mods directly from the mods list"
+ ]
+ },
+ {
+ "version": "1.5.0",
+ "changelog": [
+ "You can now install the launcher as a PWA web app"
+ ]
+ },
+ {
+ "version": "1.4.0",
+ "changelog": [
+ "Added Starlike Client",
+ "Added welcome and setup screen",
+ "Show changelog when the launcher is updated",
+ "Added themes and backgrounds",
+ "Settings now update automatically without saving them",
+ "You will now stay on the same page when reloading",
+ "Username rules have been updated to match Minecraft"
+ ]
+ },
+ {
+ "version": "1.3.0",
+ "changelog": [
+ "Redesigned archive page",
+ "Added offline page"
+ ]
+ },
+ {
+ "version": "1.2.0",
+ "changelog": [
+ "Added Eaglercraft 1.2.5",
+ "Added more mods and resource packs",
+ "Fix and optimize mobile site"
+ ]
+ },
+ {
+ "version": "1.1.0",
+ "changelog": [
+ "Added a mods and resource packs list",
+ "Temporary workaround for keyboard not working in the game",
+ "Moved most images and assets to this websites in case they are blocked",
+ "Added a 404 page",
+ "Added Discord link to bottom bar",
+ "Added Peyton's Infdev and Classic versions",
+ "Updated client versions"
+ ]
+ },
+ {
+ "version": "1.0.0",
+ "changelog": [
+ "Major rewrite, check it out yourself!"
+ ]
+ }
+]
diff --git a/public/resources/styles/themes/default.css b/public/resources/styles/themes/default.css
index 45f6fb9..1874173 100644
--- a/public/resources/styles/themes/default.css
+++ b/public/resources/styles/themes/default.css
@@ -359,14 +359,18 @@ nav {
color: #ddd;
}
-.news-item {
- flex: 1;
- padding: 20px;
+.updates-container {
+ margin: 20px;
text-align: left;
}
-.news-item li {
- padding-left: 20px;
+.updates-container strong {
+ padding-top: 20px;
+}
+
+.updates-container ul {
+ margin: 0px;
+ padding: 5px 0 20px 30px;
}
.minecraft-button {
diff --git a/public/servers/index.html b/public/servers/index.html
index 338d618..2a47565 100644
--- a/public/servers/index.html
+++ b/public/servers/index.html
@@ -16,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/settings/index.html b/public/settings/index.html
index fe0d25d..a0fa7d9 100644
--- a/public/settings/index.html
+++ b/public/settings/index.html
@@ -16,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/public/updates/index.html b/public/updates/index.html
index eca8e64..0df55ab 100644
--- a/public/updates/index.html
+++ b/public/updates/index.html
@@ -16,7 +16,7 @@
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
@@ -51,40 +51,7 @@
Updates
-
-
- MineXLauncher 1.5
- You can now install the launcher as a PWA web app
-
- MineXLauncher 1.4 -Added welcome and setup screen
- Show changelog when the launcher is updated
- Added themes and backgrounds
- Settings now update automatically without saving them
- You will now stay on the same page when reloading
- Username rules have been updated to match Minecraft
- Added Starlike Client
-
- MineXLauncher 1.3 -Redesigned Archive Page
- Added offline page
-
- MineXLauncher 1.2 -Added Eaglercraft 1.2.5
- Added more mods and resource packs
- Fix and optimize mobile site
-
- MineXLauncher 1.1 -Temporary workaround for keyboard not working in the game
- Moved most images and assets to this websites in case they are blocked
- Added a 404 page
- Added Discord link to bottom bar
- Added Peyton's Infdev and Classic versions
- Updated client versions
-
- MineXLauncher 1.0 -Major rewrite, check it out yourself!
-
+
- MineXLauncher 1.4 -
- MineXLauncher 1.3 -
- MineXLauncher 1.2 -
- MineXLauncher 1.1 -
- MineXLauncher 1.0 -
- MineXLauncher 1.5
+ MineXLauncher 1.6.0
diff --git a/src/resources/scripts/main.ts b/src/resources/scripts/main.ts
index 99de418..17c155c 100644
--- a/src/resources/scripts/main.ts
+++ b/src/resources/scripts/main.ts
@@ -1,7 +1,10 @@
-import { gt, coerce } from 'semver';
+import { SemVer, gt } from 'semver';
let selectedVersion: string | undefined;
-const launcherVersion = '1.5';
+
+// Update `cacheVersion` in sw.js too
+const launcherVersion: SemVer = new SemVer('1.6.0-beta.1');
+const releaseNotes = ['You can now install mods directly from the mods list'];
const theme = {
load: function (themeToLoad?: string) {
@@ -298,7 +301,7 @@ const mods = {
mods.splice(modIndex, 1);
storage.local.set('mods', mods);
}
- }
+ },
};
const serviceworker = {
@@ -381,10 +384,8 @@ if (window.location.pathname === '/') {
document.addEventListener('DOMContentLoaded', () => {
const lastVersion = storage.local.get('lastVersion');
- // @ts-expect-error
- if (lastVersion !== null && gt(coerce(launcherVersion, { includePrerelease: true }), coerce(lastVersion, { includePrerelease: true }))) {
- const releaseNotes = ['You can now install the launcher as a PWA web app'].map((item) => ` - ${item}`).join('\n');
- alert(`MineXLauncher has been updated to v${launcherVersion}!\n\nChanges in v${launcherVersion}:\n${releaseNotes}`);
+ if (lastVersion !== null && gt(launcherVersion, lastVersion)) {
+ alert(`MineXLauncher has been updated to v${launcherVersion}!\n\nChanges in v${launcherVersion}:\n${releaseNotes.map((item) => ` - ${item}`).join('\n')}`);
storage.local.set('lastVersion', launcherVersion);
}
});
@@ -446,9 +447,7 @@ if (window.location.pathname === '/settings/') {
window.location.reload();
});
});
-}
-
-if (window.location.pathname === '/welcome/') {
+} else if (window.location.pathname === '/welcome/') {
document.addEventListener('DOMContentLoaded', () => {
const setupForm = document.getElementById('setup-form') as HTMLFormElement;
const usernameInput = document.getElementById('username-input') as HTMLInputElement;
@@ -505,6 +504,51 @@ if (window.location.pathname === '/welcome/') {
}
});
});
+} else if (window.location.pathname === '/mods/mods/' || window.location.pathname === '/mods/resourcepacks/') {
+ document.addEventListener('DOMContentLoaded', async () => {
+ let modType: 'mods' | 'resourcepacks' = 'mods';
+ let modExt: 'js' | 'zip' = 'js';
+ switch (window.location.pathname) {
+ case '/mods/mods/':
+ modType = 'mods';
+ modExt = 'js';
+ break;
+ case '/mods/resourcepacks/':
+ modType = 'resourcepacks';
+ modExt = 'zip';
+ break;
+ }
+
+ const mods = await (await fetch('/resources/data/mods.json')).json();
+ mods[modType].forEach((mod: { id: string; name: string; description: string; author: string; authorLink: string; source: string }) => {
+ const modItem = document.createElement('div');
+ modItem.classList.add('mod-item');
+ modItem.innerHTML = `
`;
+
+ const modList = document.querySelector('.mod-list');
+ modList?.appendChild(modItem);
+ });
+ });
+} else if (window.location.pathname === '/updates/') {
+ document.addEventListener('DOMContentLoaded', async () => {
+ const updatesContainer = document.getElementById('updates-container');
+ const updates = await (await fetch('/resources/data/updates.json')).json();
+
+ updates.forEach((update: { version: string; changelog: string[] }) => {
+ const versionHeader = document.createElement('strong');
+ versionHeader.textContent = `MineXLauncher ${update.version}`;
+ updatesContainer?.appendChild(versionHeader);
+
+ const changelog = document.createElement('ul');
+ update.changelog.forEach((change) => {
+ const changelogItem = document.createElement('li');
+ changelogItem.textContent = change;
+ changelog.appendChild(changelogItem);
+ });
+
+ updatesContainer?.appendChild(changelog);
+ });
+ });
}
if (window.location.hostname === null) {
diff --git a/src/resources/scripts/mods/mods.ts b/src/resources/scripts/mods/mods.ts
deleted file mode 100644
index 658cc43..0000000
--- a/src/resources/scripts/mods/mods.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-document.addEventListener('DOMContentLoaded', async () => {
- const response = await fetch('/resources/mods/data.json');
- const data = await response.json();
- const modListElement = document.querySelector('.mod-list');
-
- // @ts-expect-error
- data.mods.forEach(({ id, name, description, author, authorLink, source }) => {
- const div = document.createElement('div');
- div.classList.add('mod-item');
- div.innerHTML = `
`;
- modListElement?.appendChild(div);
- });
-});
diff --git a/src/resources/scripts/mods/resourcepacks.ts b/src/resources/scripts/mods/resourcepacks.ts
deleted file mode 100644
index a803935..0000000
--- a/src/resources/scripts/mods/resourcepacks.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-document.addEventListener('DOMContentLoaded', async () => {
- const response = await fetch('/resources/mods/data.json');
- const data = await response.json();
- const modListElement = document.querySelector('.mod-list');
-
- // @ts-expect-error
- data.resourcepacks.forEach(({ id, name, description, author, authorLink, source }) => {
- const div = document.createElement('div');
- div.classList.add('mod-item');
- div.innerHTML = `
`;
- modListElement?.appendChild(div);
- });
-});
diff --git a/src/sw-full.ts b/src/sw-full.ts
index e8fe422..2427c10 100644
--- a/src/sw-full.ts
+++ b/src/sw-full.ts
@@ -1,5 +1,5 @@
// @ts-nocheck
-const cacheVersion = '1.5';
+const cacheVersion = '1.6.0';
const cacheName = `minexlauncher-full-v${cacheVersion}`;
self.addEventListener('install', (event) => {
diff --git a/src/sw.ts b/src/sw.ts
index b2cb87e..3edca29 100644
--- a/src/sw.ts
+++ b/src/sw.ts
@@ -1,5 +1,5 @@
// @ts-nocheck
-const cacheVersion = '1.5';
+const cacheVersion = '1.6.0';
const cacheName = `minexlauncher-v${cacheVersion}`;
const offlineUrl = '/offline.html';
const cacheAssets = [


