Always cache skin elements

This commit is contained in:
DBotThePony 2022-10-07 13:03:34 +07:00
parent b8923ba31d
commit a40b9f6435
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -115,7 +115,14 @@ class AtlasSkinElement private constructor(
@JvmStatic
fun create(location: ResourceLocation): AtlasSkinElement {
if (!isWidgetAtlasAvailable) {
return AtlasSkinElement(location, null)
var element = skinElementCache[location]
if (element == null) {
element = AtlasSkinElement(location, null)
skinElementCache[location] = element
}
return element
}
return createImpl(location)