Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ 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

- 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
23 changes: 14 additions & 9 deletions src/main/java/com/github/kd_gaming1/packcore/PackCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -13,16 +17,19 @@ public class ScamShieldCommand {
public static void register(CommandDispatcher<FabricClientCommandSource> 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())
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static LiteralArgumentBuilder<FabricClientCommandSource> register() {
return ClientCommandManager.literal("help").executes(ScamShieldHelpCommand::execute);
}

private static int execute(CommandContext<FabricClientCommandSource> context) {
public static int execute(CommandContext<FabricClientCommandSource> context) {
var source = context.getSource();

source.sendFeedback(Text.literal("§7━━━━━━━━━━━━━━━━━━━━━━━━━━━━"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion src/main/resources/assets/packcore/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}