Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
odtheking committed Nov 2, 2024
1 parent 96aef88 commit ff6612e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object Ghosts : Module(
val bracketsColor = if (isRunic) "&5" else "&8"
val lvlColor = if (isRunic) "&d" else "&7"
val nameColor = if (isRunic) "&5" else "&c"
val currentHealthColor = if (isRunic) "&d" else if ( creeper.health < creeper.getSBMaxHealth() / 2) "&e" else "&a"
val currentHealthColor = if (isRunic) "&d" else if (creeper.health < creeper.getSBMaxHealth() / 2) "&e" else "&a"
val maxHealthColor = if (isRunic) "&5" else "&a"
val name = "${bracketsColor}[${lvlColor}Lv250${bracketsColor}] ${nameColor + if (isRunic) "Runic " else ""}Ghost ${currentHealthColor + transformToSuffixedNumber(creeper.health) + "&f"}/${maxHealthColor + transformToSuffixedNumber(creeper.getSBMaxHealth()) + "&c" + ""}".replace("&", "§")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ object TerminalSolver : Module(
if (cancelToolTip && currentTerm.type != TerminalTypes.NONE && enabled) event.toolTip.clear()
}

@SubscribeEvent
@SubscribeEvent(receiveCanceled = true)
fun onGuiClick(event: GuiEvent.GuiMouseClickEvent) {
val gui = event.gui as? GuiChest ?: return
if (currentTerm.type == TerminalTypes.NONE || !enabled || (currentTerm.type == TerminalTypes.MELODY && cancelMelodySolver)) return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object DianaBurrowEstimate {
private var lastSoundPoint: Vec3? = null
private val particlePositions = mutableListOf<Vec3>()
private var lastDugBurrow: BlockPos? = null
private val recentBurrows = mutableListOf<BlockPos>()
private val recentBurrows = mutableSetOf<BlockPos>()
private var pendingBurrow: BlockPos? = null
val activeBurrows = ConcurrentHashMap<BlockPos, Burrow>()

Expand Down Expand Up @@ -59,15 +59,16 @@ object DianaBurrowEstimate {
}

fun chat(message: String) {
if (!message.startsWith("You dug out a Griffin Burrow!") && message != "You finished the Griffin burrow chain! (4/4)") return
lastDugBurrow?.let { if (!removeBurrow(it)) pendingBurrow = it }
if (message.startsWith("You dug out a Griffin Burrow!") || message == "You finished the Griffin burrow chain! (4/4)")
lastDugBurrow?.let { if (!removeBurrow(it)) pendingBurrow = it }
}

private fun removeBurrow(location: BlockPos, force: Boolean = false): Boolean {
return activeBurrows[location]?.takeIf { it.found || force }?.let {
activeBurrows.remove(location)
recentBurrows.add(location)
lastDugBurrow = null
runIn(1200) { recentBurrows.remove(location) }
true
} == true
}
Expand Down Expand Up @@ -196,12 +197,9 @@ object DianaBurrowEstimate {

estimatedBurrowPosition?.let {
DianaHelper.renderPos = findNearestGrassBlock(
if (((p1.xCoord - it.xCoord) * (2 + p1.zCoord - it.zCoord)).pow(2) <
((p2.xCoord - it.xCoord) * (2 + p2.zCoord - it.zCoord)).pow(2)
)
if (((p1.xCoord - it.xCoord) * (2 + p1.zCoord - it.zCoord)).pow(2) < ((p2.xCoord - it.xCoord) * (2 + p2.zCoord - it.zCoord)).pow(2))
Vec3(floor(p1.xCoord), 120.0, floor(p1.zCoord))
else
Vec3(floor(p2.xCoord), 120.0, floor(p2.zCoord))
else Vec3(floor(p2.xCoord), 120.0, floor(p2.zCoord))
)
}
}
Expand Down

0 comments on commit ff6612e

Please sign in to comment.