-
Notifications
You must be signed in to change notification settings - Fork 1
Add "creative mode" sorting to terminal GUI. #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Added an example mod link for creative tab ordering.
James-P-Bennett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good work. I've reviewed the changes and have some some issues needed to be addressed before we can merge the PR:
Null Safety in getCreativeMenuOrder
To prevent potential NPE issues, I'd recommend either adding a null check guard in getCreativeMenuOrder or initializing creativeSortOrder at the point of declaration (e.g., new HashMap<>()). This would ensure the map is never null when accessed.
Enhanced Parsing Robustness in loadCreativeMenuOrder
The current implementation treats every non-empty trimmed line as a material name. I'd suggest improving this by:
- Ignoring comment lines (those starting with
#) - Properly handling blank lines beyond just trimming
- Logging warnings when invalid material names are encountered, rather than silently ignoring them. This would help server admins troubleshoot configuration issues
- The
matchMaterialmethod can be strict about exact naming/casing, and the currentreplace("minecraft:", "")approach may not cover all edge cases (other prefixes, modded items, case variations). Consider more flexible name matching or validation.
Sorting Logic Enhancement
The ascending sort by creative order index with Integer.MAX_VALUE as default is sound for pushing unknown items to the end. However, you might consider adding a secondary alphabetical tiebreaker for items with identical creative indices to make the sort behavior more deterministic and explicit.
Minor Improvements in TerminalGUI
- In the
refresh()method, sincesortModeis an enum, using!=for comparison (if (savedSortMode != sortMode)) would be clearer and more idiomatic than.equals(). - I noticed the visual glow cue was removed from the sorting button. Was this intentional? If not, restoring the glow effect for the active sort mode would provide helpful visual feedback to players.
Localization Completeness
Great work adding the creative mode language keys. A few items to verify:
- Ensure all new message keys are present in other language files beyond
en_US.yml(if applicable) - Some debug strings still reference older message keys. These should be updated for consistency
- I noticed
nullis being passed for the player parameter in message manager API calls. Please confirm this is intentional and won't cause issues
Code Cleanup
There appear to be some unused or redundant imports in ConfigManager (possibly InputStreamReader, InputStream, FileConfiguration, etc.). A quick cleanup pass is needed.
|
I removed the enchant glow from the sorting icon since it has 3 different states and 3 different items now instead of 1 item in either a glowing/non-glowing state. I'll make the other changes when I have time. |
This PR adds a third sorting mode to sort items by how they are ordered in the creative menu.
Since creative tabs are client-side now, I had to write a Fabric mod to dump them to a text file to use for ordering. This has the side-effect of allowing users to customize the order by modifying the text file in their plugin directory.
This also adds a gitignore for the files in
targetand a CONTRIBUTING.md file.Mod: https://github.com/itzTheMeow/creative-tab-dumper
Preview:
