aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-07-25 19:48:22 +0200
committernea <nea@nea.moe>2023-07-25 19:48:22 +0200
commit3375907c44704b968f06ac996cb389c4e29b3826 (patch)
tree07dcc268946d2966806ac814646512861f16b8c9 /src/main/kotlin/moe/nea/firmament/features/texturepack/CustomSkyBlockTextures.kt
parent0aacb6b965852647fde85045882b6aa6cf58c287 (diff)
downloadfirmament-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.kt8
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)