promotional bannermobile promotional banner

Sweet Charm O' Mine

A curios addon for GWR
Back to Files

sweet_charm_o_mine-1.0.1.jar

File namesweet_charm_o_mine-1.0.1.jar
Uploader
JuitarJuitar
Uploaded
Sep 26, 2025
Downloads
38.0K
Size
111.6 KB
Mod Loaders
Forge
File ID
7034651
Type
R
Release
Supported game versions
  • 1.20.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:sweet-charm-o-mine-1336564:7034651")

Learn more about Curse Maven

What's new

Added:

  • Client-side configuration persistence for zoom mode (JSON file: sweet_charm_o_mine_client.json under the game config directory).
  • Automatic saving of client config when:
    • The player logs out (ClientPlayerNetworkEvent.LoggingOut).
    • The game shuts down (shutdown hook via DistExecutor on CLIENT).
  • Config load during client setup to apply previously saved zoom mode on startup.
  • Key mapping registration for toggling sniper zoom (RegisterKeyMappingsEvent).

Changed:

  • Zoom mode toggle now immediately persists changes (ClientData.toggleZoomMode() calls ClientConfig.save()).
  • Magazine combo system now triggers only if the player actually wears a MagazineItem (checked via CuriosApi) instead of always firing on shoot.

Technical Notes:

  • New ClientConfig class handles JSON read/write with Gson; safeguards for file creation and malformed data.
  • ClientEvents centralize client-side saves for logout and shutdown; onGameShutdown() invoked by a runtime shutdown hook.
  • SweetCharm adds a CLIENT-only shutdown hook using DistExecutor to call ClientEvents.onGameShutdown() safely.
  • ClientSetup loads client config in FMLClientSetupEvent.enqueueWork and registers the toggle key mapping.
  • ClientData gains a setter for zoom mode to apply loaded config.

Impact:

  • No breaking API changes. Players will retain zoom mode preferences across sessions.
  • Reduced unintended magazine combo triggers for players without the magazine equipped.

Files touched:

  • SweetCharm.java: add CLIENT shutdown hook wiring.
  • ClientConfig.java: new config management (load/save).
  • ClientData.java: persist on toggle, add setZoomMode().
  • ClientEvents.java: handle logout save and shutdown save entry point.
  • ClientSetup.java: load config on client setup; register key mapping.
  • DamageEvents.java: gate magazine combo by actual equipment presence.

This mod has no additional files