Skip to content

Commit 215f7c4

Browse files
committed
fix: return ERR_NO_PLAYER when skin-pack-only import has no player
1 parent 147ab33 commit 215f7c4

File tree

11 files changed

+75
-352
lines changed

11 files changed

+75
-352
lines changed

build/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ info:
1111
description: "A Minecraft Launcher" # The application description
1212
copyright: "(c) 2025, LeviMC" # Copyright text
1313
comments: "Some Product Comments" # Comments
14-
version: "0.0.22" # The application version
14+
version: "0.0.23" # The application version
1515
beta: "true" # Whether the application is in beta or not
1616

1717
# Dev mode configuration

build/darwin/Info.dev.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<key>CFBundleIdentifier</key>
1111
<string>org.levimc.launcher</string>
1212
<key>CFBundleVersion</key>
13-
<string>0.0.22</string>
13+
<string>0.0.23</string>
1414
<key>CFBundleGetInfoString</key>
1515
<string>Some Product Comments</string>
1616
<key>CFBundleShortVersionString</key>
17-
<string>0.0.22</string>
17+
<string>0.0.23</string>
1818
<key>CFBundleIconFile</key>
1919
<string>icons</string>
2020
<key>LSMinimumSystemVersion</key>

build/darwin/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<key>CFBundleIdentifier</key>
1111
<string>org.levimc.launcher</string>
1212
<key>CFBundleVersion</key>
13-
<string>0.0.22</string>
13+
<string>0.0.23</string>
1414
<key>CFBundleGetInfoString</key>
1515
<string>Some Product Comments</string>
1616
<key>CFBundleShortVersionString</key>
17-
<string>0.0.22</string>
17+
<string>0.0.23</string>
1818
<key>CFBundleIconFile</key>
1919
<string>icons</string>
2020
<key>LSMinimumSystemVersion</key>

build/linux/nfpm/nfpm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name: "LeviLauncher"
77
arch: ${GOARCH}
88
platform: "linux"
9-
version: "0.0.22"
9+
version: "0.0.23"
1010
section: "default"
1111
priority: "extra"
1212
maintainer: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>

build/windows/info.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"fixed": {
3-
"file_version": "0.0.22"
3+
"file_version": "0.0.23"
44
},
55
"info": {
66
"0000": {
7-
"ProductVersion": "0.0.22",
7+
"ProductVersion": "0.0.23",
88
"CompanyName": "LeviMC",
99
"FileDescription": "A Minecraft Launcher",
1010
"LegalCopyright": "(c) 2025, LeviMC",

build/windows/nsis/wails_tools.nsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
!define INFO_PRODUCTNAME "LeviLauncher"
1515
!endif
1616
!ifndef INFO_PRODUCTVERSION
17-
!define INFO_PRODUCTVERSION "0.0.22"
17+
!define INFO_PRODUCTVERSION "0.0.23"
1818
!endif
1919
!ifndef INFO_COPYRIGHT
2020
!define INFO_COPYRIGHT "(c) 2025, LeviMC"

build/windows/wails.exe.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
3-
<assemblyIdentity type="win32" name="org.levimc.launcher" version="0.0.22" processorArchitecture="*"/>
3+
<assemblyIdentity type="win32" name="org.levimc.launcher" version="0.0.23" processorArchitecture="*"/>
44
<dependency>
55
<dependentAssembly>
66
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>

frontend/src/pages/ContentPage.tsx

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,28 @@ export default function ContentPage() {
386386
const base = p.replace(/\\/g, "/").split("/").pop() || p;
387387
setCurrentFile(base);
388388
let err = "";
389+
let usePlayer = selectedPlayer;
390+
if (!usePlayer) {
391+
try {
392+
const ver = currentVersionName || readCurrentVersionName();
393+
if (ver) {
394+
const r = await GetContentRoots(ver);
395+
const ur = r?.usersRoot || "";
396+
if (ur) {
397+
const names = await listPlayers(ur);
398+
usePlayer = names[0] || "";
399+
if (usePlayer) setSelectedPlayer(usePlayer);
400+
}
401+
}
402+
} catch {}
403+
}
389404
if (
390-
selectedPlayer &&
405+
usePlayer &&
391406
typeof (minecraft as any)?.ImportMcpackPathWithPlayer === "function"
392407
) {
393408
err = await (minecraft as any)?.ImportMcpackPathWithPlayer?.(
394409
name,
395-
selectedPlayer,
410+
usePlayer,
396411
p,
397412
false
398413
);
@@ -409,13 +424,13 @@ export default function ContentPage() {
409424
});
410425
if (ok) {
411426
if (
412-
selectedPlayer &&
427+
usePlayer &&
413428
typeof (minecraft as any)?.ImportMcpackPathWithPlayer ===
414429
"function"
415430
) {
416431
err = await (minecraft as any)?.ImportMcpackPathWithPlayer?.(
417432
name,
418-
selectedPlayer,
433+
usePlayer,
419434
p,
420435
true
421436
);
@@ -444,14 +459,29 @@ export default function ContentPage() {
444459
const base = p.replace(/\\/g, "/").split("/").pop() || p;
445460
setCurrentFile(base);
446461
let err = "";
462+
let usePlayer2 = selectedPlayer;
463+
if (!usePlayer2) {
464+
try {
465+
const ver = currentVersionName || readCurrentVersionName();
466+
if (ver) {
467+
const r = await GetContentRoots(ver);
468+
const ur = r?.usersRoot || "";
469+
if (ur) {
470+
const names = await listPlayers(ur);
471+
usePlayer2 = names[0] || "";
472+
if (usePlayer2) setSelectedPlayer(usePlayer2);
473+
}
474+
}
475+
} catch {}
476+
}
447477
if (
448-
selectedPlayer &&
478+
usePlayer2 &&
449479
typeof (minecraft as any)?.ImportMcaddonPathWithPlayer ===
450480
"function"
451481
) {
452482
err = await (minecraft as any)?.ImportMcaddonPathWithPlayer?.(
453483
name,
454-
selectedPlayer,
484+
usePlayer2,
455485
p,
456486
false
457487
);
@@ -468,13 +498,13 @@ export default function ContentPage() {
468498
});
469499
if (ok) {
470500
if (
471-
selectedPlayer &&
501+
usePlayer2 &&
472502
typeof (minecraft as any)?.ImportMcaddonPathWithPlayer ===
473503
"function"
474504
) {
475505
err = await (minecraft as any)?.ImportMcaddonPathWithPlayer?.(
476506
name,
477-
selectedPlayer,
507+
usePlayer2,
478508
p,
479509
true
480510
);

go.mod

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -10,116 +10,29 @@ require (
1010
)
1111

1212
require (
13-
atomicgo.dev/cursor v0.2.0 // indirect
14-
atomicgo.dev/keyboard v0.2.9 // indirect
15-
atomicgo.dev/schedule v0.1.0 // indirect
1613
dario.cat/mergo v1.0.1 // indirect
17-
github.com/AlekSi/pointer v1.2.0 // indirect
18-
github.com/BurntSushi/toml v1.4.0 // indirect
19-
github.com/Ladicle/tabwriter v1.0.0 // indirect
20-
github.com/Masterminds/goutils v1.1.1 // indirect
21-
github.com/Masterminds/semver v1.5.0 // indirect
22-
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
2314
github.com/Microsoft/go-winio v0.6.2 // indirect
2415
github.com/ProtonMail/go-crypto v1.1.6 // indirect
25-
github.com/StackExchange/wmi v1.2.1 // indirect
2616
github.com/adrg/xdg v0.5.3 // indirect
27-
github.com/alecthomas/chroma/v2 v2.15.0 // indirect
28-
github.com/atterpac/refresh v0.8.6 // indirect
29-
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
30-
github.com/aymerick/douceur v0.2.0 // indirect
31-
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb // indirect
32-
github.com/cavaliergopher/cpio v1.0.1 // indirect
33-
github.com/chainguard-dev/git-urls v1.0.2 // indirect
34-
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
35-
github.com/charmbracelet/glamour v0.9.0 // indirect
36-
github.com/charmbracelet/lipgloss v1.1.0 // indirect
37-
github.com/charmbracelet/x/ansi v0.8.0 // indirect
38-
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
39-
github.com/charmbracelet/x/term v0.2.1 // indirect
4017
github.com/cloudflare/circl v1.6.0 // indirect
41-
github.com/containerd/console v1.0.4 // indirect
4218
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
43-
github.com/davecgh/go-spew v1.1.1 // indirect
44-
github.com/dlclark/regexp2 v1.11.5 // indirect
45-
github.com/dominikbraun/graph v0.23.0 // indirect
4619
github.com/ebitengine/purego v0.8.2 // indirect
4720
github.com/emirpasic/gods v1.18.1 // indirect
48-
github.com/fatih/color v1.18.0 // indirect
4921
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
5022
github.com/go-git/go-billy/v5 v5.6.2 // indirect
5123
github.com/go-git/go-git/v5 v5.13.2 // indirect
52-
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
53-
github.com/go-task/template v0.1.0 // indirect
54-
github.com/gobwas/glob v0.2.3 // indirect
5524
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
56-
github.com/google/rpmpack v0.6.1-0.20240329070804-c2247cbb881a // indirect
57-
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
58-
github.com/gookit/color v1.5.4 // indirect
59-
github.com/goreleaser/chglog v0.6.2 // indirect
60-
github.com/goreleaser/fileglob v1.3.0 // indirect
61-
github.com/goreleaser/nfpm/v2 v2.41.3 // indirect
62-
github.com/gorilla/css v1.0.1 // indirect
63-
github.com/huandu/xstrings v1.5.0 // indirect
64-
github.com/jackmordaunt/icns/v2 v2.2.7 // indirect
65-
github.com/jaypipes/ghw v0.17.0 // indirect
66-
github.com/jaypipes/pcidb v1.0.1 // indirect
6725
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
68-
github.com/joho/godotenv v1.5.1 // indirect
6926
github.com/kevinburke/ssh_config v1.2.0 // indirect
70-
github.com/klauspost/compress v1.18.0 // indirect
71-
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
72-
github.com/klauspost/pgzip v1.2.6 // indirect
73-
github.com/leaanthony/clir v1.7.0 // indirect
74-
github.com/leaanthony/gosod v1.0.4 // indirect
75-
github.com/leaanthony/winicon v1.0.0 // indirect
76-
github.com/lithammer/fuzzysearch v1.1.8 // indirect
7727
github.com/lmittmann/tint v1.0.7 // indirect
78-
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
79-
github.com/mattn/go-runewidth v0.0.16 // indirect
80-
github.com/mattn/go-zglob v0.0.6 // indirect
81-
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
82-
github.com/mitchellh/copystructure v1.2.0 // indirect
83-
github.com/mitchellh/go-homedir v1.1.0 // indirect
84-
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
85-
github.com/mitchellh/reflectwalk v1.0.2 // indirect
86-
github.com/muesli/cancelreader v0.2.2 // indirect
87-
github.com/muesli/reflow v0.3.0 // indirect
88-
github.com/muesli/termenv v0.16.0 // indirect
89-
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
9028
github.com/pjbgf/sha1cd v0.3.2 // indirect
91-
github.com/pterm/pterm v0.12.80 // indirect
92-
github.com/radovskyb/watcher v1.0.7 // indirect
93-
github.com/rjeczalik/notify v0.9.3 // indirect
94-
github.com/sajari/fuzzy v1.0.0 // indirect
29+
github.com/rogpeppe/go-internal v1.13.1 // indirect
9530
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
96-
github.com/shopspring/decimal v1.4.0 // indirect
9731
github.com/skeema/knownhosts v1.3.1 // indirect
98-
github.com/spf13/cast v1.7.1 // indirect
99-
github.com/spf13/pflag v1.0.6 // indirect
100-
github.com/tc-hib/winres v0.3.1 // indirect
101-
github.com/ulikunitz/xz v0.5.12 // indirect
102-
github.com/wailsapp/task/v3 v3.40.1-patched3 // indirect
10332
github.com/xanzy/ssh-agent v0.3.3 // indirect
104-
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
105-
github.com/yuin/goldmark v1.7.8 // indirect
106-
github.com/yuin/goldmark-emoji v1.0.5 // indirect
107-
github.com/zeebo/xxh3 v1.0.2 // indirect
108-
gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect
109-
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect
110-
golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect
111-
golang.org/x/image v0.24.0 // indirect
112-
golang.org/x/mod v0.24.0 // indirect
113-
golang.org/x/sync v0.12.0 // indirect
114-
golang.org/x/term v0.30.0 // indirect
115-
golang.org/x/tools v0.31.0 // indirect
11633
gopkg.in/ini.v1 v1.67.0 // indirect
11734
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
11835
gopkg.in/warnings.v0 v0.1.2 // indirect
119-
gopkg.in/yaml.v2 v2.4.0 // indirect
120-
gopkg.in/yaml.v3 v3.0.1 // indirect
121-
howett.net/plist v1.0.1 // indirect
122-
mvdan.cc/sh/v3 v3.10.0 // indirect
12336
)
12437

12538
require (

0 commit comments

Comments
 (0)