HeadSkins

非阻塞的玩家皮肤缓存。在线档案只在主线程复制;查询、下载和解码使用有界后台线程池。 Non-blocking player skin cache. Online profiles are copied on the server thread; lookup, download and decoding use bounded workers.

Types

Link copied to clipboard
sealed class ProfileResult
Link copied to clipboard
sealed class Result
Link copied to clipboard
sealed class SkinResult

Functions

Link copied to clipboard
fun clear()

清除所有已缓存结果,不接受旧请求的迟到结果。 / Clears cached results and discards late completions.

Link copied to clipboard
fun invalidate(uuid: UUID)

使 UUID 和已解析到此 UUID 的玩家名缓存失效;下次读取重新加载。 / Invalidates both UUID and resolved name aliases for the next read.

Link copied to clipboard
fun peek(value: Any?): HeadSkins.Result

接受 Player、UUID 或玩家名/UUID 字符串,立即返回加载状态或已缓存像素;不接受任意下载 URL。 Accepts a Player, UUID or name/UUID string and returns immediately; arbitrary download URLs are not accepted.

Link copied to clipboard

与 peek 共用查询和缓存,返回完整纹理 URL 与模型元数据,而不是头像裁剪。 Shares lookup/cache with peek, returning the full texture URL and model metadata rather than a face crop. An image-only provider without an explicit profile returns Failed, never an unrelated online/Mojang skin. Metadata may be Ready even if the image download fails; peek retains its normal failure/retry behavior.

Link copied to clipboard

与 peek/peekProfile 共用异步请求和缓存,返回规范化的完整 64×64 ARGB 皮肤快照。 Shares the same async request/cache as peek/peekProfile and returns a normalized full 64×64 ARGB snapshot. Image-only providers remain usable with a null profile; metadata alone cannot make pixels Ready.

Link copied to clipboard

为换肤插件显式提供可供客户端使用的档案;UUID 必须匹配请求,URL 仅接受可信的 textures.minecraft.net 地址。 Supplies a client-usable custom profile with the requested UUID and a trusted textures.minecraft.net URL (or null for a default skin).

Link copied to clipboard

注册换肤插件的异步皮肤提供器;返回完整 64×32/64×64 皮肤 PNG 的解码图片,null 表示交给下一个来源。 Registers an async custom-skin provider returning a decoded 64×32/64×64 skin, or null to defer to the next source.

Link copied to clipboard
fun stop()