Skip to content

Changes

Started 9 days 3 hr ago
Took 1 min 3 sec on Builder

Summary

  1. Report FlatFile writes that fail instead of claiming success (commit: 4fb5035) (details)
  2. Credit cyrne1-7208 for the FlatFile read failure fix (commit: a9bed7c) (details)
  3. Cover the /smelting Vanilla XP multiplier line against a real advanced.yml (commit: 4a33756) (details)
Commit 4fb5035aebd30d34d2cb5ba9835ef520a90662be by nossr50
Report FlatFile writes that fail instead of claiming success

writeStringToFileSafely logged and swallowed any IOException from the
write, so every operation that rewrote mcmmo.users returned success
whether or not anything reached disk. saveUser told PlayerProfile the
profile was saved, so it was never retried. saveUserUUIDs told the UUID
upgrade its batch was stored, and removeUser, saveUserUUID and
purgePowerlessUsers reported changes that never happened.

The helper now returns whether the write went through, rewriteUsersFile
returns it, and each caller passes it on and skips its success logging
when it failed. The users file writer is opened through a package-private
factory, alongside the existing reader factory, so tests can make it fail.

The mid-read failure tests are split into one parameterized case per
operation so each broken path fails on its own, and write failures get
the same coverage.
(commit: 4fb5035)
The file was modifiedsrc/main/java/com/gmail/nossr50/database/FlatFileDatabaseManager.java (diff)
The file was modifiedsrc/test/java/com/gmail/nossr50/database/FlatFileDatabaseManagerTest.java (diff)
Commit a9bed7cd00ce445695291e0834f844fd36c7f4e6 by nossr50
Credit cyrne1-7208 for the FlatFile read failure fix
(commit: a9bed7c)
The file was modifiedChangelog.txt (diff)
Commit 4a33756ca0689495d3c9e2f31fa310326fa01710 by nossr50
Cover the /smelting Vanilla XP multiplier line against a real advanced.yml

The existing Smelting tests stub the config getter, so nothing checked that
a value typed into advanced.yml reaches the stat line players see. The new
test writes an edited copy of the shipped advanced.yml, loads it through
AdvancedConfig, and runs the real SmeltingCommand stat steps.

It pins that configured whole numbers are shown at every rank, that
decimals are rounded down and never shown below 1x, and that the line is
hidden until Understanding The Art unlocks. Showing the rank instead of
the configured value fails it.
(commit: 4a33756)
The file was addedsrc/test/java/com/gmail/nossr50/commands/skills/SmeltingCommandTest.java