Fallback to default particles menu when versioned resource missing #1

Merged
NotAlexNoyle merged 1 commits from codex/fix-particles.yml-not-copied-to-jar into master 2026-01-03 07:36:46 -05:00
NotAlexNoyle commented 2026-01-03 07:36:18 -05:00 (Migrated from github.com)

Motivation

  • Ensure the bundled particles menu is available when a version-specific particles resource is not present in the JAR.
  • Prevent null InputStream from core.getResource("menus/particles_<ver>.yml") causing missing menus at runtime.
  • Make the plugin load the default menus/particles.yml if no versioned menu is found.

Description

  • Updated ResourceUtil.getMostCompatibleParticlesMenu() to try the versioned resource first and fall back to menus/particles.yml when the versioned resource is null.
  • Modified file: src/main/java/cosmeticsOG/util/ResourceUtil.java to implement the fallback logic.

Testing

  • Ran ./gradlew processResources which completed successfully.
  • Inspected build/resources/main/menus and confirmed the resources include particles.yml and purchase_menu.yml.
  • Ran ./gradlew shadowJar which failed due to external dependency resolution errors (HTTP 403 from remote repositories), unrelated to the resource fallback.
  • No further automated tests were run against packaging until dependencies can be resolved.

Codex Task

### Motivation - Ensure the bundled particles menu is available when a version-specific particles resource is not present in the JAR. - Prevent null `InputStream` from `core.getResource("menus/particles_<ver>.yml")` causing missing menus at runtime. - Make the plugin load the default `menus/particles.yml` if no versioned menu is found. ### Description - Updated `ResourceUtil.getMostCompatibleParticlesMenu()` to try the versioned resource first and fall back to `menus/particles.yml` when the versioned resource is `null`. - Modified file: `src/main/java/cosmeticsOG/util/ResourceUtil.java` to implement the fallback logic. ### Testing - Ran `./gradlew processResources` which completed successfully. - Inspected `build/resources/main/menus` and confirmed the resources include `particles.yml` and `purchase_menu.yml`. - Ran `./gradlew shadowJar` which failed due to external dependency resolution errors (HTTP 403 from remote repositories), unrelated to the resource fallback. - No further automated tests were run against packaging until dependencies can be resolved. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69590ba2c004832fa163bd963c6813a7)
Sign in to join this conversation.