diff options
author | nea <nea@nea.moe> | 2023-07-25 19:48:22 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-07-25 19:48:22 +0200 |
commit | 3375907c44704b968f06ac996cb389c4e29b3826 (patch) | |
tree | 07dcc268946d2966806ac814646512861f16b8c9 /src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt | |
parent | 0aacb6b965852647fde85045882b6aa6cf58c287 (diff) | |
download | firmament-3375907c44704b968f06ac996cb389c4e29b3826.tar.gz firmament-3375907c44704b968f06ac996cb389c4e29b3826.tar.bz2 firmament-3375907c44704b968f06ac996cb389c4e29b3826.zip |
Fix some issues idk
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt index 0b25e44..b73c591 100644 --- a/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt +++ b/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt @@ -5,7 +5,7 @@ import moe.nea.firmament.events.CustomItemModelEvent import moe.nea.firmament.events.TickEvent import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.gui.config.ManagedConfig -import moe.nea.firmament.util.extraAttributes +import moe.nea.firmament.util.skyBlockId object CustomSkyBlockTextures : FirmamentFeature { override val identifier: String @@ -22,10 +22,8 @@ object CustomSkyBlockTextures : FirmamentFeature { override fun onLoad() { CustomItemModelEvent.subscribe { if (!TConfig.enabled) return@subscribe - val extra = it.itemStack.extraAttributes - val id = extra.getString("id") - if (id.isNotBlank()) - it.overrideModel = ModelIdentifier("firmskyblock", id.lowercase(), "inventory") + val id = it.itemStack.skyBlockId ?: return@subscribe + it.overrideModel = ModelIdentifier("firmskyblock", id.identifier.path, "inventory") } TickEvent.subscribe { if (it.tickCount % TConfig.cacheDuration == 0) |