summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorBrandon <brandon.wamboldt@gmail.com>2023-10-11 05:57:05 -0300
committerGitHub <noreply@github.com>2023-10-11 10:57:05 +0200
commitc896c6872d5ccb2b0d28eb666f944c4c63f107a7 (patch)
treee4ea17e5906768bb5cba803059950cf640953bb3 /src/main/java/at/hannibal2/skyhanni/features/misc
parent1d6a0c1c4396d45fbdd7bf1c2d5ce230b0ac7279 (diff)
downloadskyhanni-c896c6872d5ccb2b0d28eb666f944c4c63f107a7.tar.gz
skyhanni-c896c6872d5ccb2b0d28eb666f944c4c63f107a7.tar.bz2
skyhanni-c896c6872d5ccb2b0d28eb666f944c4c63f107a7.zip
Feature: Highlight party members (#463)
Added Highlight Party Members. #463
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt29
1 files changed, 29 insertions, 0 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
new file mode 100644
index 000000000..c2ac7490b
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PartyMemberOutlines.kt
@@ -0,0 +1,29 @@
+package at.hannibal2.skyhanni.features.misc
+
+import at.hannibal2.skyhanni.SkyHanniMod
+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) }
+ }
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && !LorenzUtils.inDungeons && config.enabled
+
+ private fun getEntityOutlineColor(entity: Entity): Int? {
+ if (entity !is EntityOtherPlayerMP || !PartyAPI.partyMembers.contains(entity.name)) return null
+
+ return SpecialColour.specialToChromaRGB(config.outlineColor)
+ }
+} \ No newline at end of file