Skip to content

feat(tags): add multi-file and subdirectory support for tags#12

Open
AndresCS20 wants to merge 1 commit into
ScapeCodes:mainfrom
AndresCS20:main
Open

feat(tags): add multi-file and subdirectory support for tags#12
AndresCS20 wants to merge 1 commit into
ScapeCodes:mainfrom
AndresCS20:main

Conversation

@AndresCS20
Copy link
Copy Markdown

Summary

  • Add recursive subdirectory support for loading tag YAML files from any nested folder
  • Fix NullPointerException when rarity is not specified in tag config (now defaults to "common")
  • Refactor tag loading to support multiple YAML files with proper source tracking
  • Tags are now saved/deleted to the correct source file

Changes

  • Modified ConfigManager.reloadTagConfigs() to recursively find all .yml files
  • Added getAllYamlFiles() helper method for directory traversal
  • Changed TagManager.loadTags() to iterate over all tag config files
  • Added tagSourceConfig map to track which file each tag was loaded from
  • Updated all save/delete methods to use the correct source file
  • Fixed rarity loading: section.getString("rarity", "common") instead of section.getString("rarity")

Testing

  • Verified all tags load correctly from nested folders
  • Verified validation/saving works on correct file location
  • Tested rarity handling with and without explicit rarity field

Breaking Changes

None - fully backward compatible

Example Structure

tags/ ├── default.yml ├── countries/ │ ├── spain.yml │ └── argentina.yml └── flags/ ├── ocean.yml └── mountain.yml

Related Issue

Fixes NullPointerException: "Cannot invoke String.equalsIgnoreCase because getRarity() is null"

- Add recursive subdirectory support for loading tag YAML files (getAllYamlFiles)
- Fix NullPointerException when rarity is not specified (defaults to common)
- Refactor tag loading to support multiple YAML files in tags/ folder
- Track which file each tag was loaded from for correct save/delete
- Tags can now be organized in subfolders (tags/countries/, tags/flags/)
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.

1 participant