Workaround very good decision of mojank to strip client classes from server

This commit is contained in:
DBotThePony 2024-08-31 14:20:30 +07:00
parent 90da43ec49
commit e2115397fe
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -182,6 +182,7 @@ sealed class AbstractMatterySprite : IGUIRenderable, IUVCoords {
type.toActualNetwork(this, buff)
}
private inner class ClientData {
val renderTypeNoDepth by lazy {
noDepthCache.computeIfAbsent(texture) {
val builder = RenderType.CompositeState.builder()
@ -254,6 +255,12 @@ sealed class AbstractMatterySprite : IGUIRenderable, IUVCoords {
builder.createCompositeState(false)) as RenderType
}
}
}
private val clientData by lazy { ClientData() }
val renderTypeNoDepth get() = clientData.renderTypeNoDepth
val renderTypeDepth get() = clientData.renderTypeDepth
val renderTypeWorld get() = clientData.renderTypeWorld
companion object {
private val noDepthCache = ConcurrentHashMap<ResourceLocation, RenderType>()