Ludovic Marie
9bbb674184
Game rules: save them with the world once, as they are now; save on Quit
...
Game rules lived twice: Level (loaded when the world opened, written to
data/minecraft/game_rules.dat by Level::write) and the rules the game and
/gamerule use. Every save wrote the file first with the rules loaded at
open, then again with the current ones; a failed second write (on Windows a
file just renamed into place can be held briefly by the indexer or an
antivirus) was only logged, leaving the old rules on disk, so the world
opened with them again.
- sync_level copies the current rules into Level, and Level::write is the
only writer of game_rules.dat (written as vanilla writes saved data:
`_new`, then renamed over the old file).
- The world is saved when the application ends without a window close
(ApplicationHandler::exiting): on macOS, Quit (Cmd+Q) ends the
application through applicationWillTerminate, while vanilla's GLFW window
turns it into a window close and Minecraft.stop saves the world. Window
close, `horizon-ctl quit` and exiting share save_for_exit, which saves
once.
Tests: a unit test writes changed rules through Level::write and reads them
back (GameRules::load and Level::read); the save round-trip harness has
Horizon's player change a rule with /gamerule before saving and requires the
new value in the world vanilla then loads.
Fixes #74
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
2026-10-14 15:16:32 +02:00
..
2026-10-13 22:28:14 +02:00
2026-10-08 15:25:41 +02:00
2026-10-10 21:33:17 +02:00
2026-10-10 03:50:38 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-13 15:02:15 +02:00
2026-10-06 11:24:51 +02:00
2026-10-11 17:24:18 +02:00
2026-10-10 03:43:22 +02:00
2026-10-10 03:43:22 +02:00
2026-10-10 03:43:22 +02:00
2026-10-04 14:09:19 +02:00
2026-10-11 15:05:36 +02:00
2026-10-11 15:05:36 +02:00
2026-10-08 03:19:08 +02:00
2026-10-06 11:24:51 +02:00
2026-10-13 03:17:12 +02:00
2026-10-13 00:46:45 +02:00
2026-10-13 00:54:43 +02:00
2026-10-13 02:54:04 +02:00
2026-10-12 02:00:18 +02:00
2026-10-12 02:00:18 +02:00
2026-10-12 17:10:08 +02:00
2026-10-13 00:31:05 +02:00
2026-10-13 02:33:59 +02:00
2026-10-11 16:47:42 +02:00
2026-10-10 22:23:05 +02:00
2026-10-10 21:47:11 +02:00
2026-10-13 04:59:34 +02:00
2026-10-08 15:13:51 +02:00
2026-10-13 17:12:30 +02:00
2026-10-13 03:42:57 +02:00
2026-10-10 03:49:56 +02:00
2026-10-03 23:26:13 +02:00
2026-10-13 20:20:17 +02:00
2026-10-07 04:28:50 +02:00
2026-10-10 21:47:11 +02:00
2026-10-09 14:06:43 +02:00
2026-10-13 21:59:34 +02:00
2026-10-13 03:06:48 +02:00
2026-10-12 15:54:35 +02:00
2026-10-12 18:57:30 +02:00
2026-10-13 22:24:55 +02:00
2026-10-11 14:08:47 +02:00
2026-10-13 20:20:17 +02:00
2026-10-10 21:49:38 +02:00
2026-10-12 02:00:18 +02:00
2026-10-08 11:20:05 +02:00
2026-10-12 17:10:08 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 22:03:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 21:52:28 +02:00
2026-10-10 22:04:04 +02:00
2026-10-06 13:17:56 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 19:49:00 +02:00
2026-10-06 19:49:00 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 13:28:59 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 12:29:30 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:55:45 +02:00
2026-10-13 01:55:46 +02:00
2026-10-13 02:03:08 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-13 15:06:46 -04:00
2026-10-06 12:20:29 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-12 16:49:20 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 07:08:27 +02:00
2026-10-10 03:50:38 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 12:59:34 +02:00
2026-10-06 14:08:13 +02:00
2026-10-13 15:06:46 -04:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-13 15:07:39 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-10 07:13:50 +02:00
2026-10-06 11:24:51 +02:00
2026-10-13 06:27:55 +02:00
2026-10-06 14:12:29 +02:00
2026-10-13 23:38:02 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-14 14:38:52 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 23:13:27 +02:00
2026-10-08 23:33:12 +02:00
2026-10-11 16:47:42 +02:00
2026-10-10 03:43:22 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-14 15:00:41 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-12 16:05:18 +02:00
2026-10-13 22:30:39 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-13 02:54:04 +02:00
2026-10-14 00:09:59 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 14:03:31 +02:00
2026-10-13 23:01:02 +02:00
2026-10-06 13:21:42 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 12:25:49 +02:00
2026-10-06 11:24:51 +02:00
2026-10-12 17:14:20 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 14:03:31 +02:00
2026-10-06 13:09:24 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-12 17:31:52 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-12 17:55:17 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 07:09:59 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 12:13:34 +02:00
2026-10-06 12:13:34 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 19:31:11 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-12 17:46:50 +02:00
2026-10-13 15:33:29 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 21:51:04 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 06:58:30 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-13 05:43:31 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-13 06:21:56 +02:00
2026-10-13 03:42:57 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 21:21:50 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-04 00:53:12 +02:00
2026-10-13 01:11:55 +02:00
2026-10-08 23:45:48 +02:00
2026-10-08 23:33:12 +02:00
2026-10-09 12:29:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-14 14:34:32 +02:00
2026-10-13 04:48:24 +02:00
2026-10-11 15:05:36 +02:00
2026-10-13 20:20:17 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 21:49:11 +02:00
2026-10-07 16:56:23 +02:00
2026-10-07 14:42:44 +02:00
2026-10-13 15:38:48 +02:00
2026-10-11 16:14:22 +02:00
2026-10-06 11:57:55 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-13 06:22:53 +02:00
2026-10-13 06:07:04 +02:00
2026-10-13 04:47:36 +02:00
2026-10-10 03:48:16 +02:00
2026-10-06 12:51:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-12 16:51:38 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-12 16:22:29 +02:00
2026-10-10 09:12:17 +02:00
2026-10-12 17:02:53 +02:00
2026-10-13 02:22:55 +02:00
2026-10-13 05:35:49 +02:00
2026-10-09 14:04:56 +02:00
2026-10-10 09:12:17 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 13:13:46 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 19:31:11 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-13 20:20:17 +02:00
2026-10-14 15:16:32 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-12 17:35:05 +02:00
2026-10-12 17:38:25 +02:00
2026-10-12 17:01:59 +02:00
2026-10-09 13:52:25 +02:00
2026-10-12 18:57:30 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 22:10:06 +02:00
2026-10-06 13:32:39 +02:00
2026-10-10 21:33:17 +02:00
2026-10-10 21:16:28 +02:00
2026-10-10 22:17:01 +02:00
2026-10-06 14:16:46 +02:00
2026-10-06 13:04:32 +02:00
2026-10-06 12:36:10 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-12 17:07:47 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-13 03:16:04 +02:00
2026-10-12 16:36:04 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-06 11:24:51 +02:00
2026-10-10 22:12:23 +02:00
2026-10-13 22:25:27 +02:00
2026-10-09 00:28:31 +02:00
2026-10-06 12:51:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 12:38:59 +02:00
2026-10-08 23:33:12 +02:00
2026-10-14 14:34:26 +02:00
2026-10-08 23:33:12 +02:00
2026-10-12 17:25:13 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-06 11:24:51 +02:00
2026-10-08 23:33:12 +02:00
2026-10-10 08:05:35 +02:00
2026-10-10 22:23:05 +02:00
2026-10-08 15:49:59 +02:00
2026-10-08 15:49:59 +02:00