diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1638daf..8d9dc68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: setup gradle uses: gradle/actions/setup-gradle@v4 with: - gradle-home-cache-cleanup: true + cache-cleanup: always - name: make gradle wrapper executable run: chmod +x ./gradlew @@ -33,8 +33,9 @@ jobs: - name: build run: ./gradlew build - - name: capture build artifacts + - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: Artifacts - path: build/libs/ + name: artifacts + path: versions/*/build/libs/*.jar + retention-days: 30 diff --git a/src/main/java/com/github/kd_gaming1/packcore/PackCore.java b/src/main/java/com/github/kd_gaming1/packcore/PackCore.java index 2096a33..6cd2639 100644 --- a/src/main/java/com/github/kd_gaming1/packcore/PackCore.java +++ b/src/main/java/com/github/kd_gaming1/packcore/PackCore.java @@ -69,15 +69,20 @@ public void onInitializeClient() { ScamShieldCommand.register(dispatcher); }); - if (PackCoreConfig.enableCustomMenu) { - ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> { - if (screen instanceof TitleScreen) { - client.execute(() -> client.setScreen(PackCoreConfig.haveShownWelcomeWizard - ? new SBEStyledTitleScreen() - : new WelcomeWizardPage()) - ); - } - }); + // try catch just in case something goes wrong with title screen + try { + if (PackCoreConfig.enableCustomMenu) { + ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> { + if (screen instanceof TitleScreen) { + client.execute(() -> client.setScreen(PackCoreConfig.haveShownWelcomeWizard + ? new SBEStyledTitleScreen() + : new WelcomeWizardPage()) + ); + } + }); + } + } catch (Exception e) { + LOGGER.error("Failed to show custom title screen: {}", e.getMessage()); } if (!PackCoreConfig.haveSetBobbyConfig) { diff --git a/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldCommand.java b/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldCommand.java index bbb1bea..2a0c7a1 100644 --- a/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldCommand.java +++ b/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldCommand.java @@ -1,8 +1,12 @@ package com.github.kd_gaming1.packcore.command.scamshield; import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; /** * Main entry point for all ScamShield commands. @@ -13,16 +17,19 @@ public class ScamShieldCommand { public static void register(CommandDispatcher dispatcher) { dispatcher.register( ClientCommandManager.literal("scamshield") - .then(ScamShieldHelpCommand.register()) - .then(ScamShieldControlCommands.registerToggle()) - .then(ScamShieldControlCommands.registerReload()) - .then(ScamShieldStatsCommands.registerStats()) - .then(ScamShieldStatsCommands.registerClear()) - .then(ScamShieldTestCommands.registerTest()) - .then(ScamShieldTestCommands.registerDebug()) - .then(ScamShieldWhitelistCommands.register()) - .then(ScamShieldPreviewCommands.register()) - .then(ScamShieldEducationCommand.register()) + .executes(ScamShieldHelpCommand::execute) + + .then(ScamShieldHelpCommand.register()) + .then(ScamShieldControlCommands.registerToggle()) + .then(ScamShieldControlCommands.registerReload()) + .then(ScamShieldStatsCommands.registerStats()) + .then(ScamShieldStatsCommands.registerClear()) + .then(ScamShieldTestCommands.registerTest()) + .then(ScamShieldTestCommands.registerDebug()) + .then(ScamShieldWhitelistCommands.register()) + .then(ScamShieldPreviewCommands.register()) + .then(ScamShieldEducationCommand.register()) ); } + } \ No newline at end of file diff --git a/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldHelpCommand.java b/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldHelpCommand.java index 5c10669..1b0d197 100644 --- a/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldHelpCommand.java +++ b/src/main/java/com/github/kd_gaming1/packcore/command/scamshield/ScamShieldHelpCommand.java @@ -15,7 +15,7 @@ public static LiteralArgumentBuilder register() { return ClientCommandManager.literal("help").executes(ScamShieldHelpCommand::execute); } - private static int execute(CommandContext context) { + public static int execute(CommandContext context) { var source = context.getSource(); source.sendFeedback(Text.literal("§7━━━━━━━━━━━━━━━━━━━━━━━━━━━━")); diff --git a/src/main/java/com/github/kd_gaming1/packcore/config/PackCoreConfig.java b/src/main/java/com/github/kd_gaming1/packcore/config/PackCoreConfig.java index 5a6aa54..bfc46d3 100644 --- a/src/main/java/com/github/kd_gaming1/packcore/config/PackCoreConfig.java +++ b/src/main/java/com/github/kd_gaming1/packcore/config/PackCoreConfig.java @@ -16,7 +16,7 @@ public class PackCoreConfig extends MidnightConfig { public static boolean enableCustomMenu = true; // Spacer - @Comment(category = UI) + @Comment(category = UI, name = "packcore.midnightconfig.spacer") public static Comment spacer1; // BACKUP CATEGORY @@ -27,7 +27,7 @@ public class PackCoreConfig extends MidnightConfig { public static int maxBackups = 5; // Spacer - @Comment(category = BACKUP) + @Comment(category = BACKUP, name = "packcore.midnightconfig.spacer") public static Comment backupSpacer; // CUSTOMIZATION CATEGORY @@ -61,13 +61,13 @@ public class PackCoreConfig extends MidnightConfig { @Entry(category = SCAMSHIELD , name = "packcore.midnightconfig.enable_scamshield_debugging") public static boolean enableScamShieldDebugging = false; - @Comment(category = SCAMSHIELD) + @Comment(category = SCAMSHIELD, name = "packcore.midnightconfig.spacer") public static Comment scamshieldSpacer1; @Entry(category = SCAMSHIELD, name = "packcore.midnightconfig.scamshield_trigger_threshold", min = 50, max = 500) public static int scamShieldTriggerThreshold = 100; - @Comment(category = SCAMSHIELD) + @Comment(category = SCAMSHIELD, name = "packcore.midnightconfig.spacer") public static Comment scamshieldSpacer2; @Entry(category = SCAMSHIELD, name = "packcore.midnightconfig.scamshield_show_notifications") @@ -79,13 +79,13 @@ public class PackCoreConfig extends MidnightConfig { @Entry(category = SCAMSHIELD, name = "packcore.midnightconfig.scamshield_max_recent_detections", min = 5, max = 50) public static int scamShieldMaxRecentDetections = 10; - @Comment(category = SCAMSHIELD) + @Comment(category = SCAMSHIELD, name = "packcore.midnightconfig.spacer") public static Comment scamshieldSpacer3; @Entry(category = SCAMSHIELD, name = "packcore.midnightconfig.scamshield_max_history_size", min = 10, max = 1000) public static int scamShieldMaxHistorySize = 100; - @Comment(category = SCAMSHIELD) + @Comment(category = SCAMSHIELD, name = "packcore.midnightconfig.spacer") public static Comment scamshieldSpacer4; @Entry(category = SCAMSHIELD, name = "packcore.midnightconfig.scamshield_regex_timeout_ms", min = 50, max = 500) diff --git a/src/main/resources/assets/packcore/lang/en_us.json b/src/main/resources/assets/packcore/lang/en_us.json index e6ab556..fe8c976 100644 --- a/src/main/resources/assets/packcore/lang/en_us.json +++ b/src/main/resources/assets/packcore/lang/en_us.json @@ -18,5 +18,21 @@ "packcore.midnightconfig.first_startup": "First Startup - Tracker", "packcore.midnightconfig.welcome_wizard_shown": "Welcome Wizard Shown - Tracker", "packcore.midnightconfig.have_set_bobby_config": "Have Set Bobby Config - Tracker", - "packcore.midnightconfig.setup_wizard_completed": "Setup Wizard Completed - Tracker" + "packcore.midnightconfig.setup_wizard_completed": "Setup Wizard Completed - Tracker", + + "packcore.midnightconfig.scamshieldSpacer": "", + + "packcore.midnightconfig.enable_scamshield": "Enable ScamShield", + "packcore.midnightconfig.enable_scamshield_debugging":"Enable ScamShield Debugging", + "packcore.midnightconfig.scamshield_trigger_threshold": "Scam shield Trigger Threshold", + "packcore.midnightconfig.scamshield_show_notifications":"Toggle ScamShield Notifications", + "packcore.midnightconfig.scamshield_notification_cooldown": "ScamShield Notification Cooldown (seconds)", + "packcore.midnightconfig.scamshield_max_recent_detections": "Recent Detections", + "packcore.midnightconfig.scamshield_max_history_size":"Maximum History Size", + "packcore.midnightconfig.scamshield_regex_timeout_ms": "Regex Timeout (ms)", + "packcore.midnightconfig.scamshield_cache_size": "Cache Size", + "packcore.midnightconfig.scamshield_cache_ttl_seconds":"Cache TTL (seconds)", + "packcore.midnightconfig.scamshield_conversation_timeout_minutes": "Conversation Timeout (minutes)", + "packcore.midnightconfig.scamshield_max_messages_per_user": "Max Messages Per User", + "packcore.midnightconfig.scamshield_max_progression_bonus": "Max Progression Bonus" } \ No newline at end of file