Files
firefrost-services/services/rules-mod/CLAUDE.md
Claude (Chronicler #83 - The Compiler) 996b59672f v1.0.1: Config reset fix + Loading handler + versioning (all 6 builds)
- Added ModConfigEvent.Loading handler to detect default config on startup
- Warns clearly in logs when bot_token is still YOUR_TOKEN_HERE
- Bumped all 6 builds to 1.0.1 (3 firefrostrules + 3 discordrules)
- Created CHANGELOG.md and INSTALL.md with correct install procedure
- Updated CLAUDE.md with install procedure note
- 1.16.5 uses ModConfig.Loading (different class hierarchy from 1.20.1+)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 17:06:31 -05:00

1.6 KiB

Firefrost Rules Mod — Build Environment

Project Structure

  • 1.21.1/ — NeoForge (Java 21, Gradle 8.8, moddev 2.0.141)
  • 1.20.1/ — Forge (Java 17, Gradle 8.8, ForgeGradle 6.0)
  • 1.16.5/ — Forge (Java 8, Gradle 7.6.4, ForgeGradle 5.1)

What This Mod Does

Player types /rules → mod fetches rules from a Discord message → displays in-game with colored formatting. Admins update rules by editing a Discord message — no restarts, no file editing.

Config Location

Config file is created at world/serverconfig/firefrostrules-server.toml — NOT in config/. This applies to all three versions.

Install Procedure (IMPORTANT)

Do NOT place config files manually before first start. Forge must generate the file. See INSTALL.md for full steps. Placing a config manually causes Forge to overwrite it with defaults on startup (missing version header → config reset bug).

7 Source Files (each version)

  • ServerRules.java — main mod class
  • ServerRulesConfig.java — TOML config (bot token, channel ID, message ID)
  • RulesCommand.java — /rules command handler
  • DiscordFetcher.java — async HTTP fetch from Discord API
  • DiscordFormatter.java — Discord markdown → Minecraft chat formatting
  • RulesCache.java — 30-minute cache with fallback
  • CooldownManager.java — per-player 60-second cooldown

Version Differences

  • 1.21.1: net.neoforged.*, ModConfigSpec, Component.literal(), java.net.http.HttpClient
  • 1.20.1: net.minecraftforge.*, ForgeConfigSpec, Component.literal(), java.net.http.HttpClient
  • 1.16.5: net.minecraftforge.*, ForgeConfigSpec, StringTextComponent, HttpURLConnection, new JsonParser().parse()