Repository navigation
Warn staff when the resource pack has a texture over 16384 px - #42
Merged
Merged
Conversation
Most Intel graphics can't load textures over 16384 px, and one such texture stops the whole pack loading for those players (FAILED_RELOAD, then a client crash). ItemsAdder's legacy armour atlas reached 16448 px this way without anyone noticing until a player couldn't join. PackTextureGuard reads the image header of every PNG in ItemsAdder/output/generated.zip once per build and, when one is too large, logs every offender at SEVERE and messages online and joining staff (tfmccore.admin). resource-pack.max-texture-size sets the limit; 0 turns the check off.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…id-scan A scan that finishes after the plugin disabled no longer publishes or schedules anything, and a scheduler rejection during disable is ignored. The pack's stamp is read again after scanning; if ItemsAdder rewrote it meanwhile, the result is dropped and the final file is scanned next time.
Contributor
Author
|
CodeRabbit skipped this PR (manual review required), so GPT-6 Astra cross-reviewed it (Claude Opus wrote it). Nothing blocking. Outcome:
Also confirmed by the review: thread safety of
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ItemsAdder's legacy armour atlas grew to 16448 px. Most Intel graphics can't load textures over 16384 px, so the whole pack failed for those players (
FAILED_RELOAD, then a client crash), and nobody noticed until a player couldn't join. TLibs now drops that atlas (TF-Minecraft/TLibs, fix/drop-legacy-armour-atlas); this guard catches the next oversized texture, whatever its source.What
PackTextureGuardchecksItemsAdder/output/generated.zipevery 30 s and scans it once per new build, reading only each PNG's header (works on ItemsAdder's protected entries).tfmccore.admin) get a red chat warning until a fixed pack is built.resource-pack.max-texture-size(default 16384; 0 turns it off). Registered whenever ItemsAdder is enabled, independent of multipart delivery.Testing
mvn clean verify(JDK 21): 743 tests, 100% line coverage.The resource pack has 16 textures over 16384 pxand listed all 16 atlas copies; after the TLibs fix andiazip, the rebuilt pack produced no warning.