From 6ed12cdeb05322161ef71ebf2e0944305e4b1445 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Apr 2026 20:10:05 +0000 Subject: [PATCH] =?UTF-8?q?Bridge:=20REQ-2026-04-12-discord-rules-fork=20?= =?UTF-8?q?=E2=80=94=20Task=20#69=20spec=20for=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Full fork spec: com.firefrostgaming.rules -> com.discordrules - Configurable header/body colors via TOML display section - Strip Firefrost-specific emoji replacements - emoji stripping as config toggle - Build instructions for all 3 MC versions --- .../REQ-2026-04-12-discord-rules-fork.md | 152 ++++++++++++++++++ docs/code-bridge/status/ACTIVE_CONTEXT.md | 3 + 2 files changed, 155 insertions(+) create mode 100644 docs/code-bridge/requests/REQ-2026-04-12-discord-rules-fork.md diff --git a/docs/code-bridge/requests/REQ-2026-04-12-discord-rules-fork.md b/docs/code-bridge/requests/REQ-2026-04-12-discord-rules-fork.md new file mode 100644 index 0000000..0bbc5e7 --- /dev/null +++ b/docs/code-bridge/requests/REQ-2026-04-12-discord-rules-fork.md @@ -0,0 +1,152 @@ +# Code Request — Task #69: Discord Rules Mod Generic Fork + +**Filed by:** Chronicler #84 +**Date:** 2026-04-12 +**Priority:** Medium +**Task DB ID:** 69 + +--- + +## What You're Building + +Fork the Firefrost Rules Mod into a generic, community-ready mod called **"Discord Rules"** for CurseForge publication. Strip all Firefrost branding and make colors configurable. + +The source is in `services/rules-mod/` (3 versions: 1.21.1, 1.20.1, 1.16.5). +Put the generic fork in `services/discord-rules/` (same 3-version structure). + +--- + +## Changes Required Per Version + +### 1. Package rename +- `com.firefrostgaming.rules` → `com.discordrules` + +### 2. Mod metadata (mods.toml / neoforge.mods.toml) +- modId: `serverrules` → `discordrules` +- displayName: `"Firefrost Rules"` → `"Discord Rules"` +- description: generic (see below) +- authors: `"Firefrost Gaming"` → `"FirefrostGaming"` (keep as author, it's our brand) +- license: add `MIT` +- logoFile: remove or replace with generic + +### 3. DiscordFormatter.java — replace hardcoded color logic + +Current (remove this entire block): +```java +ChatFormatting headerColor = ChatFormatting.DARK_PURPLE; +ChatFormatting bodyColor = ChatFormatting.LIGHT_PURPLE; +if (lowerText.contains("fire") || lowerText.contains("[fire]")) { + headerColor = ChatFormatting.GOLD; + bodyColor = ChatFormatting.YELLOW; +} else if (lowerText.contains("frost") || lowerText.contains("[frost]")) { + headerColor = ChatFormatting.AQUA; + bodyColor = ChatFormatting.DARK_AQUA; +} +``` + +Replace with: read `headerColor` and `bodyColor` from config (see step 4). + +Also in `convertEmojis()`: remove the Fire/Frost/Arcane specific replacements: +```java +// REMOVE these 3 lines: +.replace("\uD83D\uDD25", "[Fire]") +.replace("\u2744\uFE0F", "[Frost]") +.replace("\uD83D\uDC9C", "[Arcane]") +``` +Keep the generic emoji strip: `.replaceAll("[\\x{1F300}-\\x{1F9FF}]", "")` +But make the emoji stripping a config toggle (see step 4). + +### 4. ServerRulesConfig.java — add display section + +Add a new `display` config section with these fields: + +``` +[display] +# Header color (bold lines). Valid values: BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, +# DARK_RED, DARK_PURPLE, GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, +# LIGHT_PURPLE, YELLOW, WHITE +header_color = "GOLD" + +# Body color (regular lines and bullet points) +body_color = "YELLOW" + +# Strip emojis that Minecraft can't render (recommended: true) +strip_emojis = true +``` + +The formatter reads these at display time (not cached — config changes take effect on next /rules without restart). + +### 5. DiscordFormatter.java — wire config reads + +```java +// At top of formatRules(): +ChatFormatting headerColor = parseColor(ServerRulesConfig.HEADER_COLOR.get(), ChatFormatting.GOLD); +ChatFormatting bodyColor = parseColor(ServerRulesConfig.BODY_COLOR.get(), ChatFormatting.YELLOW); + +// Add helper method: +private static ChatFormatting parseColor(String name, ChatFormatting fallback) { + try { + return ChatFormatting.valueOf(name.toUpperCase()); + } catch (IllegalArgumentException e) { + return fallback; + } +} +``` + +For emoji stripping, gate `convertEmojis()` on the config value: +```java +String processedText = ServerRulesConfig.STRIP_EMOJIS.get() + ? convertEmojis(rawDiscordText) + : rawDiscordText; +``` + +### 6. ServerRules.java — update mod ID references +- Any string `"serverrules"` → `"discordrules"` +- Any string `"Firefrost"` or `"FireFrost"` in user-visible text → remove or make generic + +--- + +## Build Instructions + +Same as Task #136 — use the Dev Panel build environment: + +```bash +# Java 21 for 1.21.1 +use-java 21 +cd /opt/mod-builds/firefrost-services/services/discord-rules/1.21.1 +/opt/gradle-8.8/bin/gradle build + +# Java 17 for 1.20.1 +use-java 17 +cd /opt/mod-builds/firefrost-services/services/discord-rules/1.20.1 +/opt/gradle-8.8/bin/gradle build + +# Java 8 for 1.16.5 +use-java 8 +cd /opt/mod-builds/firefrost-services/services/discord-rules/1.16.5 +/opt/gradle-7.6.4/bin/gradle build +``` + +Output jars go in `build/libs/` — grab the one without `-sources` or `-dev`. + +--- + +## Deliverable + +3 built jars in `services/discord-rules/`: +- `discord-rules-1.0.0-1.21.1-neoforge.jar` +- `discord-rules-1.0.0-1.20.1-forge.jar` +- `discord-rules-1.0.0-1.16.5-forge.jar` + +Commit source + jars to `firefrost-services` main branch, then update `ACTIVE_CONTEXT.md`. + +--- + +## Notes + +- Don't touch `services/rules-mod/` — that stays as Firefrost's internal version +- Default colors GOLD/YELLOW chosen to match Firefrost's visual identity (subtle brand nod) +- MIT license — maximizes community adoption +- Chronicler is writing the CurseForge project page copy in parallel + +**Fire + Frost + Foundation** 💙🔥❄️ diff --git a/docs/code-bridge/status/ACTIVE_CONTEXT.md b/docs/code-bridge/status/ACTIVE_CONTEXT.md index d441d2b..7eb5e82 100644 --- a/docs/code-bridge/status/ACTIVE_CONTEXT.md +++ b/docs/code-bridge/status/ACTIVE_CONTEXT.md @@ -14,6 +14,9 @@ ModpackChecker code review complete. Phase 11 spec received and archived. Ready - Read and archived Phase 11 implementation spec from Chronicler - All commits pushed to Gitea +## Pending Request from Chronicler +- **REQ-2026-04-12-discord-rules-fork.md** — Task #69 generic fork of rules mod for CurseForge. Full spec ready. Chronicler writing CurseForge copy in parallel. + ## Next Steps Pending - Phase 11A: License validation system (mvc_licenses table, Arbiter API routes) - Phase 11B: Discord infrastructure (role, channels, ticket category)