Skip to content

Dev - #60

Merged
desht merged 36 commits into
mainfrom
dev
Sep 14, 2026
Merged

Dev#60
desht merged 36 commits into
mainfrom
dev

Conversation

@desht

@desht desht commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

desht added 30 commits August 6, 2026 09:30
- RankCondition#getConditionList handles non-array fields
- Catch exceptions and rethrow as RankException
Marking rank data dirty instead of player data, oops
"name" and "power" are now rejected in addition to "condition"
- rank creation during load no longer uses setCondition() but injects the
  condition directly, avoiding side effects which are unwanted during load
- moved readPermssions and writePermissions into RankImpl, the only class
  which uses them
- on read, non-primitive json permission nodes are now warned about and not added
  to the permissions map at all
- on write, unexpected permission node classes are warned about and not added
  to the json object at all
- Fix NPE if node values end with ".*"
- Don't use setCondition() in fromJson()
Saves should be retried next time in case the error is a
transient one
Also log at error rather than warn level
Also set its side to BOTH in neoforge.mods.toml
Vanilla playtime stat is an integer value so unavoidably limited,
but we should use a long comparison to avoid false positives (a value
of >= ~178 weeks gives a negative tick count in integer arithmetic)

Invalid unit names now throw a RankException, causing the rank not
to load, rather than defaulting to seconds, which is silently misleading.
If power <= 0, log a warning and set power to 1
FTBRanksAPIImpl#serverStarted now rethrows any IOException it gets
as an IllegalStateException to ensure rank load errors at startup
are fatal. Server should not continue in this situation.

RankManagerImpl#readRankFile now rethrows any RankException it gets
as an IOException after doing some informative logging about the
error (including file and rank id).
- Pack sourced ranks now override server sourced ranks
- Pack sourced ranks cannot be edited by command, and
  ftbranks-pack.json5 file should not be edited by admins either
- Now writes a default ftbranks-pack.json5 file with a comment
  explaining that it must not be edited
- Ranks are now properly namespaced with "server." and "pack." prefixes
- Rank name clashes between sources are no longer possible
- Rank editing commands can only work on "server." ranks
- Rank viewing commands can work on any rank
- Rank suggestions in commands are now always prefixed with the
  namespace, but unprefixed ranks are accepted, prefixed with "server."
Deprecated Rank#getName, use Rank#getDisplayName instead
Updated some javadocs
Fixes removing a non-existent node being successful and spuriously
firing an event & marking ranks as dirty.
- rank IDs are all now normalized when loaded from file; if changed, a warning
  is logged
- all commands which take a rank ID argument now use StringArgument.word()
- add validation for all boolean conditions, throwing RankException if needed
- fixed RefreshReadmeCommand always reporting success
- fixed ShowRankCommand always reporting failure
getAddedRanks() needs to use this and not auto-vivify player data
when checking what ranks are added to a player.
Also tightened up caller check in FTBRanksAPI#setup
Made all events in FTBRanksEvents final
- Added PlayerRankCache, a short-lived cache of player->ranks, which
  is valid for one server tick. Can significantly reduce rank scanning
  for players, e.g. when formatting chat messages.
- Added a getPermissionValue() variant taking a `checkParentNodes` boolean
  (default true for backwards compat). When false, _only_ the exact queried
  node is checked. Useful optimization for chat formatting.
- Dropped defaulted `RankManager#getRanks` method, now uses PlayerRankCache
@desht
desht merged commit 92cfd7d into main Sep 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants