From 175eec3836fa2450591c3c69ac44895ed61f5f71 Mon Sep 17 00:00:00 2001 From: Obsidian <108832807+Obsidianninja11@users.noreply.github.com> Date: Tue, 17 Oct 2023 03:46:27 -0800 Subject: Fixed highlight showcase items not working in some areas (#579) Fixed highlight showcase items not working in some areas. #579 --- .../features/misc/items/GlowingDroppedItems.kt | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt index dc63bef64..11bf4655b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt @@ -7,11 +7,12 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarityOrNull import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.equalsOneOf +import at.hannibal2.skyhanni.utils.RecalculatingValue import net.minecraft.entity.Entity import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.item.EntityItem import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.seconds class GlowingDroppedItems { @@ -22,7 +23,19 @@ class GlowingDroppedItems { */ private val showcaseItemLocations = setOf( "The End", - "Jerry's Workshop" + "Jerry's Workshop", + "Dark Auction", + "Photon Pathway", + "Barrier Street", + "Village Plaza", + "Déjà Vu Alley" + ) + + private val showcaseItemIslands = setOf( + IslandType.HUB, + IslandType.PRIVATE_ISLAND, + IslandType.PRIVATE_ISLAND_GUEST, + IslandType.CRIMSON_ISLE ) @SubscribeEvent @@ -48,16 +61,12 @@ class GlowingDroppedItems { return rarity?.color?.toColor()?.rgb } - private fun isShowcaseArea() = - showcaseItemLocations.contains(LorenzUtils.skyBlockArea) || - LorenzUtils.skyBlockIsland.equalsOneOf( - IslandType.HUB, - IslandType.PRIVATE_ISLAND, - IslandType.PRIVATE_ISLAND_GUEST - ) + private val isShowcaseArea = RecalculatingValue(1.seconds) { + showcaseItemIslands.contains(LorenzUtils.skyBlockIsland) || showcaseItemLocations.contains(LorenzUtils.skyBlockArea) + } private fun shouldHideShowcaseItem(entity: EntityItem): Boolean { - if (!isShowcaseArea() || config.highlightShowcase) return false + if (!isShowcaseArea.getValue() || config.highlightShowcase) return false for (entityArmorStand in entity.worldObj.getEntitiesWithinAABB( EntityArmorStand::class.java, -- cgit