Fix some issues idk

This commit is contained in:
nea
2023-07-25 19:48:22 +02:00
parent 0aacb6b965
commit 3375907c44
5 changed files with 40 additions and 7 deletions

View File

@@ -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)