summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-03-06 21:49:08 +0100
committerGitHub <noreply@github.com>2024-03-06 21:49:08 +0100
commitde0f0e888a4c0767c8e8ca911113482a3b1f9d5c (patch)
treeaa390c371a4643ac966f7bd95decb80fe1c08e45 /src/main/java/at/hannibal2/skyhanni/features/misc
parentfb61f5717ee24829781a3fbe2152a647ef7137ed (diff)
downloadskyhanni-de0f0e888a4c0767c8e8ca911113482a3b1f9d5c.tar.gz
skyhanni-de0f0e888a4c0767c8e8ca911113482a3b1f9d5c.tar.bz2
skyhanni-de0f0e888a4c0767c8e8ca911113482a3b1f9d5c.zip
Renormalize line endings to be \n (#1112)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt64
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/GlowingDroppedItems.kt170
2 files changed, 117 insertions, 117 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt
index e90265ef3..9780c203b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt
@@ -1,32 +1,32 @@
-package at.hannibal2.skyhanni.features.misc
-
-import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.config.enums.OutsideSbFeature
-import at.hannibal2.skyhanni.data.PartyAPI
-import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
-import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.SpecialColour
-import net.minecraft.client.entity.EntityOtherPlayerMP
-import net.minecraft.entity.Entity
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-
-class PartyMemberOutlines {
-
- private val config get() = SkyHanniMod.feature.misc.highlightPartyMembers
-
- @SubscribeEvent
- fun onRenderEntityOutlines(event: RenderEntityOutlineEvent) {
- if (isEnabled() && event.type === RenderEntityOutlineEvent.Type.NO_XRAY) {
- event.queueEntitiesToOutline { entity -> getEntityOutlineColor(entity) }
- }
- }
-
- fun isEnabled() = config.enabled &&
- (LorenzUtils.inSkyBlock || OutsideSbFeature.HIGHLIGHT_PARTY_MEMBERS.isSelected()) && !LorenzUtils.inDungeons
-
- private fun getEntityOutlineColor(entity: Entity): Int? {
- if (entity !is EntityOtherPlayerMP || !PartyAPI.partyMembers.contains(entity.name)) return null
-
- return SpecialColour.specialToChromaRGB(config.outlineColor)
- }
-}
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.config.enums.OutsideSbFeature
+import at.hannibal2.skyhanni.data.PartyAPI
+import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.SpecialColour
+import net.minecraft.client.entity.EntityOtherPlayerMP
+import net.minecraft.entity.Entity
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class PartyMemberOutlines {
+
+ private val config get() = SkyHanniMod.feature.misc.highlightPartyMembers
+
+ @SubscribeEvent
+ fun onRenderEntityOutlines(event: RenderEntityOutlineEvent) {
+ if (isEnabled() && event.type === RenderEntityOutlineEvent.Type.NO_XRAY) {
+ event.queueEntitiesToOutline { entity -> getEntityOutlineColor(entity) }
+ }
+ }
+
+ fun isEnabled() = config.enabled &&
+ (LorenzUtils.inSkyBlock || OutsideSbFeature.HIGHLIGHT_PARTY_MEMBERS.isSelected()) && !LorenzUtils.inDungeons
+
+ private fun getEntityOutlineColor(entity: Entity): Int? {
+ if (entity !is EntityOtherPlayerMP || !PartyAPI.partyMembers.contains(entity.name)) return null
+
+ return SpecialColour.specialToChromaRGB(config.outlineColor)
+ }
+}
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 3e5bf7989..15d33fee7 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
@@ -1,85 +1,85 @@
-package at.hannibal2.skyhanni.features.misc.items
-
-import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.data.IslandType
-import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
-import at.hannibal2.skyhanni.features.garden.pests.SprayType
-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.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 {
-
- private val config get() = SkyHanniMod.feature.misc.glowingDroppedItems
-
- /**
- * List of SkyBlock locations where we might see items in showcases
- */
- private val showcaseItemLocations = setOf(
- "The End",
- "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
- fun onRenderEntityOutlines(event: RenderEntityOutlineEvent) {
- if (isEnabled() && event.type === RenderEntityOutlineEvent.Type.XRAY) {
- event.queueEntitiesToOutline { getEntityOutlineColor(it) }
- }
- }
-
- private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled
-
- private fun getEntityOutlineColor(entity: Entity): Int? {
- val item = entity as? EntityItem ?: return null
- if (shouldHideShowcaseItem(entity)) return null
-
- val entityItem = item.entityItem
- if (!config.highlightFishingBait && entityItem.name?.endsWith(" Bait") == true) {
- return null
- }
-
- val internalName = entityItem.getInternalNameOrNull() ?: return null
- val isSprayItem = LorenzUtils.enumValueOfOrNull<SprayType>(internalName.asString()) != null
- if (isSprayItem) return null
- val rarity = entityItem.getItemRarityOrNull()
- return rarity?.color?.toColor()?.rgb
- }
-
- private val isShowcaseArea = RecalculatingValue(1.seconds) {
- showcaseItemIslands.contains(LorenzUtils.skyBlockIsland) || showcaseItemLocations.contains(LorenzUtils.skyBlockArea)
- }
-
- private fun shouldHideShowcaseItem(entity: EntityItem): Boolean {
- if (!isShowcaseArea.getValue() || config.highlightShowcase) return false
-
- for (entityArmorStand in entity.worldObj.getEntitiesWithinAABB(
- EntityArmorStand::class.java,
- entity.entityBoundingBox
- )) {
- if (entityArmorStand.isInvisible) {
- return true
- }
- }
-
- return false
- }
-}
+package at.hannibal2.skyhanni.features.misc.items
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.IslandType
+import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
+import at.hannibal2.skyhanni.features.garden.pests.SprayType
+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.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 {
+
+ private val config get() = SkyHanniMod.feature.misc.glowingDroppedItems
+
+ /**
+ * List of SkyBlock locations where we might see items in showcases
+ */
+ private val showcaseItemLocations = setOf(
+ "The End",
+ "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
+ fun onRenderEntityOutlines(event: RenderEntityOutlineEvent) {
+ if (isEnabled() && event.type === RenderEntityOutlineEvent.Type.XRAY) {
+ event.queueEntitiesToOutline { getEntityOutlineColor(it) }
+ }
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled
+
+ private fun getEntityOutlineColor(entity: Entity): Int? {
+ val item = entity as? EntityItem ?: return null
+ if (shouldHideShowcaseItem(entity)) return null
+
+ val entityItem = item.entityItem
+ if (!config.highlightFishingBait && entityItem.name?.endsWith(" Bait") == true) {
+ return null
+ }
+
+ val internalName = entityItem.getInternalNameOrNull() ?: return null
+ val isSprayItem = LorenzUtils.enumValueOfOrNull<SprayType>(internalName.asString()) != null
+ if (isSprayItem) return null
+ val rarity = entityItem.getItemRarityOrNull()
+ return rarity?.color?.toColor()?.rgb
+ }
+
+ private val isShowcaseArea = RecalculatingValue(1.seconds) {
+ showcaseItemIslands.contains(LorenzUtils.skyBlockIsland) || showcaseItemLocations.contains(LorenzUtils.skyBlockArea)
+ }
+
+ private fun shouldHideShowcaseItem(entity: EntityItem): Boolean {
+ if (!isShowcaseArea.getValue() || config.highlightShowcase) return false
+
+ for (entityArmorStand in entity.worldObj.getEntitiesWithinAABB(
+ EntityArmorStand::class.java,
+ entity.entityBoundingBox
+ )) {
+ if (entityArmorStand.isInvisible) {
+ return true
+ }
+ }
+
+ return false
+ }
+}