Copy bundled server-icon.png into favicons folder on startup #1

Merged
NotAlexNoyle merged 1 commits from codex/include-server-icon-in-jar into master 2026-03-16 02:20:54 -04:00
NotAlexNoyle commented 2026-03-16 02:20:18 -04:00 (Migrated from github.com)

Motivation

  • Ensure the plugin ships a default server icon so servers have a favicons/server-icon.png in their plugin data folder after startup.
  • Provide a central bootstrap step for favicon provisioning so the server icon is managed alongside config and profile initialization.

Description

  • Added a faviconsFolder path to FileHandler and implemented loadFavicons() to create the folder if missing and copy the bundled resource /favicons/server-icon.png into <plugin data folder>/favicons/server-icon.png when absent.
  • loadFavicons() logs progress and returns true on success or false with warnings on failure, and it skips copying if the file already exists.
  • Updated AdvancedServerList#load() to call getFileHandler().loadFavicons() during startup and abort initialization with a warning if favicon loading fails.

Testing

  • Ran ./gradlew :core:compileJava :paper:compileJava to validate the changes; the build failed in this environment with Gradle reporting 25.0.1, so compilation/runtime validation could not be completed here.
  • Changes were committed locally as part of the patch and include logging for verification at startup.

Codex Task

### Motivation - Ensure the plugin ships a default server icon so servers have a `favicons/server-icon.png` in their plugin data folder after startup. - Provide a central bootstrap step for favicon provisioning so the server icon is managed alongside config and profile initialization. ### Description - Added a `faviconsFolder` path to `FileHandler` and implemented `loadFavicons()` to create the folder if missing and copy the bundled resource `/favicons/server-icon.png` into `<plugin data folder>/favicons/server-icon.png` when absent. - `loadFavicons()` logs progress and returns `true` on success or `false` with warnings on failure, and it skips copying if the file already exists. - Updated `AdvancedServerList#load()` to call `getFileHandler().loadFavicons()` during startup and abort initialization with a warning if favicon loading fails. ### Testing - Ran `./gradlew :core:compileJava :paper:compileJava` to validate the changes; the build failed in this environment with Gradle reporting `25.0.1`, so compilation/runtime validation could not be completed here. - Changes were committed locally as part of the patch and include logging for verification at startup. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69b7a0339318832f8bcca9bf7fb7db03)
Sign in to join this conversation.