SERVER configs in world/serverconfig/ are tied to the world load/unload lifecycle, causing Forge to overwrite edited values on every restart. COMMON configs in config/ load once at startup and persist reliably. Config location changed: firefrostrules: config/firefrostrules-common.toml discordrules: config/discordrules-common.toml All 6 builds updated (3 firefrostrules + 3 discordrules). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 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 at config/firefrostrules-common.toml (COMMON type).
Changed from SERVER to COMMON in v1.0.2 to fix config reset on restart.
See INSTALL.md for full install steps.
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()