diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2023-11-30 22:48:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 22:48:38 +0100 |
commit | 27aeb89179f77ed82a5275a833183cdc6d945a23 (patch) | |
tree | 06416b33eeaa0399fbf4bb381fe7158cd2478cfa /src/main/java/at | |
parent | 322f2fca3091943e7ff08834d5cdcc1486d0c450 (diff) | |
download | skyhanni-27aeb89179f77ed82a5275a833183cdc6d945a23.tar.gz skyhanni-27aeb89179f77ed82a5275a833183cdc6d945a23.tar.bz2 skyhanni-27aeb89179f77ed82a5275a833183cdc6d945a23.zip |
Feature Change: Unique Gift Highlighter exluded Ironman (#740)
Hiding Unique Gifted Players Highlighting for ironman and bingo while not on those modes. #740
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportnitiesFeatures.kt) | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index b7ad90f40..c869b47d9 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -102,7 +102,7 @@ import at.hannibal2.skyhanni.features.dungeon.DungeonMilestonesDisplay import at.hannibal2.skyhanni.features.dungeon.DungeonRankTabListColor import at.hannibal2.skyhanni.features.dungeon.DungeonTeammateOutlines import at.hannibal2.skyhanni.features.dungeon.HighlightDungeonDeathmite -import at.hannibal2.skyhanni.features.event.UniqueGiftingOpportnitiesFeatures +import at.hannibal2.skyhanni.features.event.UniqueGiftingOpportunitiesFeatures import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper import at.hannibal2.skyhanni.features.event.diana.GriffinBurrowHelper import at.hannibal2.skyhanni.features.event.diana.GriffinBurrowParticleFinder @@ -437,7 +437,7 @@ class SkyHanniMod { loadModule(DungeonCleanEnd()) loadModule(DungeonBossMessages()) loadModule(DungeonBossHideDamageSplash()) - loadModule(UniqueGiftingOpportnitiesFeatures) + loadModule(UniqueGiftingOpportunitiesFeatures) loadModule(UniqueGiftCounter) loadModule(TrophyFishManager) loadModule(TrophyFishFillet()) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportnitiesFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt index 92438f10a..2a9e4d349 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportnitiesFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.EntityCustomNameUpdateEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -15,12 +16,13 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.client.entity.EntityPlayerSP +import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.player.EntityPlayer import net.minecraftforge.event.entity.EntityJoinWorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -object UniqueGiftingOpportnitiesFeatures { +object UniqueGiftingOpportunitiesFeatures { private val playerList: MutableSet<String>? get() = ProfileStorageData.playerSpecific?.winter?.playersThatHaveBeenGifted @@ -68,10 +70,16 @@ object UniqueGiftingOpportnitiesFeatures { if (!isEnabled()) return val entity = event.entity if (entity is EntityPlayerSP) return - if (entity is EntityPlayer && !entity.isNPC() && !hasGiftedPlayer(entity)) + if (entity is EntityPlayer && !entity.isNPC() && excludeIronman(entity) && excludeBingo(entity) && !hasGiftedPlayer(entity)) event.color = LorenzColor.DARK_GREEN.toColor().withAlpha(127) } + private fun excludeBingo(entity: EntityLivingBase) = + HypixelData.bingo || !entity.displayName.formattedText.endsWith("Ⓑ§r") + + private fun excludeIronman(entity: EntityLivingBase) = + HypixelData.bingo || HypixelData.ironman || !entity.displayName.formattedText.endsWith("♲§r") + @SubscribeEvent fun onChat(event: LorenzChatEvent) { pattern.matchMatcher(event.message) { @@ -79,5 +87,4 @@ object UniqueGiftingOpportnitiesFeatures { UniqueGiftCounter.addUniqueGift() } } - } |