Skip to content

Commit

Permalink
fixed arrow death never working (woops)
Browse files Browse the repository at this point in the history
  • Loading branch information
SubAt0m1c committed Oct 23, 2024
1 parent 5b4ae6f commit 3d48cb4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ enum class WitherDragonsEnum (
entityId = null
entity = null
lastDragonDeath = this
if (priorityDragon == this) priorityDragon = None
if (priorityDragon == this) {
if (sendArrowHit && WitherDragons.enabled) arrowDeath(this)
priorityDragon = None
}

if (sendTime && WitherDragons.enabled)
dragonPBs.time(ordinal, (System.currentTimeMillis() - spawnedTime) / 1000.0, "s§7!", "§${colorCode}${name} §7was alive for §6", addPBString = true, addOldPBString = true)

if (sendArrowHit && WitherDragons.enabled) arrowDeath(this)
}

fun updateEntity(entityId: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ object WitherDragons : Module(
}

fun arrowDeath(dragon: WitherDragonsEnum) {
if (priorityDragon == WitherDragonsEnum.None || dragon != priorityDragon) return
if (!sendArrowHit || System.currentTimeMillis() - dragon.spawnedTime >= dragon.skipKillTime) return
modMessage("§fYou hit §6$arrowsHit §farrows on §${priorityDragon.colorCode}${priorityDragon.name}.")
modMessage("§fYou hit §6$arrowsHit §farrows on §${dragon.colorCode}${dragon.name}.")
arrowsHit = 0
}

Expand Down
6 changes: 4 additions & 2 deletions odinmain/src/main/kotlin/me/odinmain/utils/SplitsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ object SplitsManager {
if (index == currentSplits.splits.size - 1) {
val (times, _) = getAndUpdateSplitsTimes(currentSplits)
currentSplits.personalBest?.time(index, times.last() / 1000.0, "s§7!", "§6Total time §7took §6", addPBString = true, addOldPBString = true, alwaysSendPB = true, sendOnlyPB = Splits.sendOnlyPB, sendMessage = Splits.enabled)
if (!sendSplits || !Splits.enabled) return
runIn(10) {
times.forEachIndexed { i, it ->
val splits = times.withIndex().joinToString("\n") { (i, it) ->
val name = if (i == currentSplits.splits.size - 1) "Total" else currentSplits.splits.getSafe(i)?.name
if (sendSplits && Splits.enabled) modMessage("§6$name §7took §6${formatTime(it)} §7to complete.")
"§6$name §7took §6${formatTime(it)} §7to complete."
}
modMessage("Splits: \n${splits}")
}
}
}
Expand Down

0 comments on commit 3d48cb4

Please sign in to comment.