Bump to 1.20.4

This commit is contained in:
Linnea Gräf
2024-01-21 14:06:34 +01:00
parent 18ebd21cb0
commit 3e1f75e322
11 changed files with 47 additions and 39 deletions

View File

@@ -20,6 +20,7 @@ import moe.nea.firmament.events.TickEvent
import moe.nea.firmament.features.FirmamentFeature
import moe.nea.firmament.gui.config.ManagedConfig
import moe.nea.firmament.util.IdentityCharacteristics
import moe.nea.firmament.util.MC
import moe.nea.firmament.util.item.decodeProfileTextureProperty
import moe.nea.firmament.util.skyBlockId
@@ -53,10 +54,9 @@ object CustomSkyBlockTextures : FirmamentFeature {
private val skullTextureCache = mutableMapOf<IdentityCharacteristics<GameProfile>, Any>()
private val sentinelPresentInvalid = Object()
val mcUrlRegex = "https?://textures.minecraft.net/texture/([a-fA-F0-9]+)".toRegex()
private val mcUrlRegex = "https?://textures.minecraft.net/texture/([a-fA-F0-9]+)".toRegex()
fun getSkullId(profile: GameProfile): String? {
val textures = profile.properties.get(PlayerSkinProvider.TEXTURES)
val textureProperty = textures.singleOrNull() ?: return null
val textureProperty = MC.instance.sessionService.getPackedTextures(profile) ?: return null
val texture = decodeProfileTextureProperty(textureProperty) ?: return null
val textureUrl =
texture.textures[MinecraftProfileTexture.Type.SKIN]?.url ?: return null