From 71cbb36e7245f008fd9ad0867aab7690897f6cf8 Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:52:53 +0200 Subject: Fix: Wardrobe slot color & Event priority (#2072) --- .../hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt | 2 +- .../at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt index f1db611d7..09d15271c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt @@ -614,7 +614,7 @@ object CustomWardrobe { private fun WardrobeSlot.getSlotColor(): Color = with(config.color) { when { isCurrentSlot() -> equippedColor - favorite -> favoriteColor + favorite && !config.onlyFavorites -> favoriteColor else -> null }?.toChromaColor()?.transformIf({ !isInCurrentPage() }) { darker() } ?: (if (isInCurrentPage()) samePageColor else otherPageColor).toChromaColor() diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt index b446d9950..75515717e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt @@ -21,6 +21,7 @@ import net.minecraft.init.Blocks import net.minecraft.init.Items import net.minecraft.item.EnumDyeColor import net.minecraft.item.ItemStack +import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.milliseconds @@ -109,7 +110,7 @@ object WardrobeAPI { } } - @SubscribeEvent + @SubscribeEvent(priority = EventPriority.HIGH) fun onInventoryUpdate(event: InventoryUpdatedEvent) { if (!LorenzUtils.inSkyBlock) return -- cgit