sweet_charm_o_mine-1.0.1.jar
Curse Maven Snippet
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

