EffectiveResourcepack

Assembles and serves a per-plugin resource pack.

Register content (addGlyph for bitmap glyphs, addSpaceProvider for negative-space advances) and, when EffectiveSpigot's built-in HTTP server is enabled, a pack is generated from the plugin's jar resources, hashed and hosted automatically; otherwise register an external pack with addServerResourcepack. All calls are no-ops unless the HTTP server is enabled in config.

Functions

Link copied to clipboard
fun addGlyph(instance: JavaPlugin, glyph: EffectiveGlyph)

Adds a bitmap glyph to instance's generated pack. No-op if the HTTP server is disabled.

Link copied to clipboard
fun addServerResourcepack(instance: JavaPlugin, url: String, sha1Hex: String)

Registers an externally hosted resource pack by url and its sha1Hex hash. When the built-in HTTP server is enabled the local generated pack is used instead.

Link copied to clipboard
fun addSpaceProvider(instance: JavaPlugin, advances: Map<EffectiveFontChar, Int>)

Registers negative/positive space advances (EffectiveFontChar → pixel width) for instance's pack, used to position glyphs precisely. No-op if the HTTP server is disabled.

Link copied to clipboard
fun getImageWidth(instance: JavaPlugin, texturePath: String): Int

Pixel width of the image at texturePath inside instance's jar resources, or 0 if it can't be read.

Link copied to clipboard
fun init()