Skip to content

Commit 31422f2

Browse files
committed
feat: add diagnostics reporting to startup and crash reports
1 parent af4c0e0 commit 31422f2

9 files changed

Lines changed: 337 additions & 144 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,9 @@
11
# Changelog
22

3-
## v4.0.0
3+
## v4.1.0
44

5-
### Core Features
6-
- First-launch **Welcome Wizard** for guided setup
7-
- Custom **main menu styles** (Modern, Modern Minimal, Minimal)
8-
- Built-in **performance profile selector**
9-
- Visual customization pages for:
10-
- Tab design
11-
- Item background style
12-
- Storage design
13-
- Optional wizard pages for supported mods:
14-
- **ScaleMe** sword block toggle
15-
- **ScamScreener** alert + ping setup
16-
- **Resource pack selection** during setup
17-
- Final **review + apply** page with per-setting status
18-
19-
### Config Pack System
20-
- Automatic config pack detection and loading
21-
- Resolution-based best-match config selection
22-
- Safer update behavior (tracks applied pack + version)
23-
- Restart-safe pending apply flow for full preset changes
24-
25-
### Config Manager UI
26-
- New in-game **modpack config screen** with tabs:
27-
- Configuration
28-
- Export
29-
- Import
30-
- Backups
31-
- Browse config pack contents before applying
32-
- Apply **selected files** or apply **entire preset**
33-
34-
### Export / Import / Backups
35-
- Export selected files as reusable config pack `.zip`
36-
- Include metadata in exports (name, version, author, description, target resolution, GUI scale)
37-
- Import external config packs from imports folder
38-
- Create and restore backups from in-game UI
39-
40-
### Commands & Utilities
41-
- Command to reopen wizard: `/packcore wizard`
42-
- Command to open config manager: `/packcore modpack_config`
43-
- Update check commands:
44-
- `/packcore update check`
45-
- `/packcore update reset`
46-
- Performance/design quick commands for advanced users
5+
### Diagnostics
6+
- Full diagnostics report logged on every startup (modpack info, config pack, settings, runtime, system)
7+
- Crash reports now include a **PackCore Diagnostics** section with the same data as the startup log
8+
- New `/packcore diagnose` command — shows a compact report in chat with a **click-to-copy** button for easy sharing when reporting issues
9+
- New `/packcore crashtest` command — triggers a test crash to verify the crash report enrichment is working

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ org.gradle.parallel=true
44
org.gradle.configuration-cache=false
55

66
# Mod properties
7-
mod.version=4.0.0
7+
mod.version=4.1.0
88
mod.group=com.github.kd_gaming1
99
mod.id=packcore
1010
mod.name=Pack Core

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pluginManagement {
88
}
99

1010
plugins {
11-
id("dev.kikugie.stonecutter") version "0.9-beta.1"
11+
id("dev.kikugie.stonecutter") version "0.9"
1212
}
1313

1414
stonecutter {

src/main/java/com/github/kd_gaming1/packcore/PackCore.java

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.github.kd_gaming1.packcore.command.PackCoreCommands;
44
import com.github.kd_gaming1.packcore.config.PackCoreConfig;
5+
import com.github.kd_gaming1.packcore.util.diagnostics.DiagnosticsCollector;
56
import com.github.kd_gaming1.packcore.gui.screen.PackCoreTitleScreen;
67
import com.github.kd_gaming1.packcore.gui.screen.SBETitleScreen;
78
import com.github.kd_gaming1.packcore.gui.screen.WelcomeWizardScreen;
@@ -23,70 +24,65 @@
2324
import java.nio.file.Path;
2425

2526
public class PackCore implements ClientModInitializer {
27+
2628
public static final String MOD_ID = "packcore";
2729
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
28-
29-
public static final Path PACKCORE_DIR = FabricLoader.getInstance().getGameDir().resolve("packcore");
30+
public static final Path PACKCORE_DIR =
31+
FabricLoader.getInstance().getGameDir().resolve("packcore");
3032

3133
public static boolean migratedFromV3 = false;
3234
private static boolean replacingTitleScreen = false;
3335

3436
@Override
3537
public void onInitializeClient() {
36-
LOGGER.info("[PackCore] Initialized");
38+
LOGGER.info("[PackCore] Initialized\n{}", DiagnosticsCollector.buildFullReport());
3739

3840
RamWarningHelper.init();
3941
UpdateChecker.checkAsync();
4042

41-
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> PackCoreCommands.register(dispatcher));
43+
ClientCommandRegistrationCallback.EVENT.register(
44+
(dispatcher, registryAccess) -> PackCoreCommands.register(dispatcher));
4245

4346
ScreenEvents.BEFORE_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
44-
if (!(screen instanceof TitleScreen)) return;
45-
if (screen instanceof PackCoreTitleScreen) return;
46-
47+
if (!(screen instanceof TitleScreen) || screen instanceof PackCoreTitleScreen) return;
4748
RamWarningHelper.onMainMenu();
48-
4949
if (PackCoreConfig.menuStyle != PackCoreConfig.MenuStyle.MINIMAL) {
5050
scheduleConfiguredTitleScreen(client, screen);
5151
}
5252
});
5353

5454
ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
55-
if (!(screen instanceof TitleScreen)) return;
56-
if (screen instanceof PackCoreTitleScreen) return;
55+
if (!(screen instanceof TitleScreen) || screen instanceof PackCoreTitleScreen) return;
5756
if (!PackCoreConfig.successfulWelcomeWizard) return;
5857
if (PackCoreConfig.menuStyle != PackCoreConfig.MenuStyle.MINIMAL) return;
59-
6058
PackCoreTitleScreen.decorateExisting((TitleScreen) screen, scaledWidth, scaledHeight);
6159
});
6260

63-
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> client.execute(RamWarningHelper::onWorldJoin));
61+
ClientPlayConnectionEvents.JOIN.register(
62+
(handler, sender, client) -> client.execute(RamWarningHelper::onWorldJoin));
6463

6564
ClientLifecycleEvents.CLIENT_STARTED.register(client -> PlaytimeTracker.onSessionStart());
6665
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> PlaytimeTracker.onSessionEnd());
6766
}
6867

6968
private static void scheduleConfiguredTitleScreen(Minecraft client, Screen screen) {
70-
if (!(screen instanceof TitleScreen) || screen instanceof PackCoreTitleScreen || replacingTitleScreen) return;
71-
69+
if (replacingTitleScreen) return;
7270
replacingTitleScreen = true;
7371
client.execute(() -> {
7472
try {
7573
if (client.screen != screen) return;
76-
7774
if (!PackCoreConfig.successfulWelcomeWizard) {
7875
client.setScreen(new WelcomeWizardScreen(screen));
7976
return;
8077
}
81-
8278
switch (PackCoreConfig.menuStyle) {
83-
case MODERN -> client.setScreen(new SBETitleScreen());
79+
case MODERN -> client.setScreen(new SBETitleScreen());
8480
case MODERN_MINIMAL -> client.setScreen(new SBETitleScreen(false));
85-
case MINIMAL -> client.setScreen(new PackCoreTitleScreen());
81+
case MINIMAL -> client.setScreen(new PackCoreTitleScreen());
8682
}
8783
} finally {
8884
replacingTitleScreen = false;
8985
}
9086
});
9187
}
92-
}
88+
}

0 commit comments

Comments
 (0)