Skip to content

Commit

Permalink
code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs committed Oct 9, 2024
1 parent f6b340d commit e4fca94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.events

import at.hannibal2.skyhanni.api.event.SkyHanniEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI

class DungeonPhaseChangeEvent(val newPhase: DungeonAPI.DungeonPhase) : LorenzEvent()
class DungeonPhaseChangeEvent(val newPhase: DungeonAPI.DungeonPhase) : SkyHanniEvent()
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ object DungeonAPI {
}

private fun changePhase(newPhase: DungeonPhase) {
DungeonPhaseChangeEvent(newPhase)
DungeonPhaseChangeEvent(newPhase).post()
dungeonPhase = newPhase
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ object TerracottaPhase {

@SubscribeEvent(priority = EventPriority.HIGH)
fun onRenderLiving(event: SkyHanniRenderEntityEvent.Specials.Pre<EntityLivingBase>) {
if (isActive() && config.hideDamageSplash && DamageIndicatorManager.isDamageSplash(event.entity)) {
if (isEnabled() && config.hideDamageSplash && DamageIndicatorManager.isDamageSplash(event.entity)) {
event.cancel()
}
}

@SubscribeEvent
fun onReceiveParticle(event: ReceiveParticleEvent) {
if (isActive() && config.hideParticles) {
if (isEnabled() && config.hideParticles) {
event.cancel()
}
}

private fun isActive() = isEnabled() && DungeonAPI.dungeonPhase == DungeonAPI.DungeonPhase.F6_TERRACOTTA

private fun isEnabled() =
DungeonAPI.inDungeon() && DungeonAPI.inBossRoom && DungeonAPI.getCurrentBoss() == DungeonFloor.F6
DungeonAPI.inDungeon() && DungeonAPI.inBossRoom && DungeonAPI.getCurrentBoss() == DungeonFloor.F6 &&
DungeonAPI.dungeonPhase == DungeonAPI.DungeonPhase.F6_TERRACOTTA
}

0 comments on commit e4fca94

Please sign in to comment.