aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorObsidian <108832807+Obsidianninja11@users.noreply.github.com>2023-10-17 03:46:27 -0800
committerGitHub <noreply@github.com>2023-10-17 13:46:27 +0200
commit175eec3836fa2450591c3c69ac44895ed61f5f71 (patch)
tree2095ec8ebfea8aedb9489c21335a0eeda08bb09a /src/main
parentd48b959ba8bd002aa1f895245cfbe0ccbea870a0 (diff)
downloadskyhanni-175eec3836fa2450591c3c69ac44895ed61f5f71.tar.gz
skyhanni-175eec3836fa2450591c3c69ac44895ed61f5f71.tar.bz2
skyhanni-175eec3836fa2450591c3c69ac44895ed61f5f71.zip
Fixed highlight showcase items not working in some areas (#579)
Fixed highlight showcase items not working in some areas. #579
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt29
1 files changed, 19 insertions, 10 deletions
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,