diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 12:34:18 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-16 12:34:18 +0200 |
| commit | 4293cfd919c3c93d4532534f722c407d7ad1370d (patch) | |
| tree | f9f612f021ef7f4283d74312edfaca30badc6749 /src/main/java/at/hannibal2/skyhanni/features/dungeon | |
| parent | 538e3ceb76f8e0b590291ce9aa90aa94896cdcb6 (diff) | |
| parent | 024ba52fb69b6cd44b4e31542867f802de656f15 (diff) | |
| download | SkyHanni-cum.tar.gz SkyHanni-cum.tar.bz2 SkyHanni-cum.zip | |
Merge branch 'beta' into cumcum
# Conflicts:
# src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt
# src/main/java/at/hannibal2/skyhanni/config/features/AshfangConfig.java
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/dungeon')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt | 2 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt | 39 |
2 files changed, 40 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt index 9dca6d59b..5559ba14a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt @@ -12,7 +12,7 @@ class DungeonChatFilter { fun onChatMessage(event: LorenzChatEvent) { if (!LorenzUtils.onHypixel) return - // Workaround since the potion message gets always sent in that moment when skyblock is set as false + // Workaround since the potion message gets always sent at that moment when SkyBlock is set as false if (!LorenzUtils.inSkyBlock && !event.message.startsWith("§aYour active Potion Effects")) return if (!SkyHanniMod.feature.chat.dungeonMessages) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt new file mode 100644 index 000000000..de2ca07e2 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonTeammateOutlines.kt @@ -0,0 +1,39 @@ +package at.hannibal2.skyhanni.features.dungeon
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.RenderEntityOutlineEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraft.client.Minecraft
+import net.minecraft.client.entity.EntityOtherPlayerMP
+import net.minecraft.client.gui.FontRenderer
+import net.minecraft.entity.Entity
+import net.minecraft.scoreboard.ScorePlayerTeam
+import net.minecraft.scoreboard.Team
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class DungeonTeammateOutlines {
+ private val config get() = SkyHanniMod.feature.dungeon
+
+ @SubscribeEvent
+ fun onRenderEntityOutlines(event: RenderEntityOutlineEvent) {
+ if (isEnabled() && event.type === RenderEntityOutlineEvent.Type.XRAY) {
+ event.queueEntitiesToOutline { entity -> getEntityOutlineColor(entity) }
+ }
+ }
+
+ private fun isEnabled() = LorenzUtils.inSkyBlock && LorenzUtils.inDungeons && config.highlightTeammates
+
+ private fun getEntityOutlineColor(entity: Entity): Int? {
+ if (entity !is EntityOtherPlayerMP || entity.team == null) return null
+
+ // Must be visible on the scoreboard
+ val team = entity.team as ScorePlayerTeam
+ if (team.nameTagVisibility == Team.EnumVisible.NEVER) return null
+
+ val colorFormat = FontRenderer.getFormatFromString(team.colorPrefix)
+ return if (colorFormat.length >= 2)
+ Minecraft.getMinecraft().fontRendererObj.getColorCode(colorFormat[1]);
+ else null
+ }
+
+}
\ No newline at end of file |
