Skip to content

Commit 5792bcf

Browse files
committed
crystal aura automation config and fixed hotbar swapping logic
1 parent 00d0d5d commit 5792bcf

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/main/kotlin/com/lambda/module/modules/combat/CrystalAura.kt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
package com.lambda.module.modules.combat
1919

20-
import com.lambda.config.groups.RotationSettings
20+
import com.lambda.config.AutomationConfig.Companion.setDefaultAutomationConfig
21+
import com.lambda.config.applyEdits
2122
import com.lambda.config.groups.Targeting
2223
import com.lambda.context.SafeContext
2324
import com.lambda.event.events.EntityEvent
@@ -111,9 +112,6 @@ object CrystalAura : Module(
111112
/* Targeting */
112113
private val targeting = Targeting.Combat(this, Group.Targeting, 10.0)
113114

114-
/* Rotation */
115-
override val rotationConfig = RotationSettings(this, Group.Rotation)
116-
117115
private val blueprint = mutableMapOf<BlockPos, Opportunity>()
118116
private var activeOpportunity: Opportunity? = null
119117
private var currentTarget: LivingEntity? = null
@@ -144,6 +142,16 @@ object CrystalAura : Module(
144142
}
145143

146144
init {
145+
setDefaultAutomationConfig {
146+
applyEdits {
147+
hideAllGroupsExcept(buildConfig, rotationConfig, hotbarConfig, inventoryConfig)
148+
buildConfig.apply {
149+
hide(::pathing, ::stayInRange, ::collectDrops, ::spleefEntities,
150+
::maxPendingActions, ::actionTimeout, ::maxBuildDependencies, ::breakBlocks, ::interactBlocks)
151+
}
152+
}
153+
}
154+
147155
// Async ticking
148156
fixedRateTimer(
149157
name = "Crystal Aura Thread",
@@ -476,6 +484,7 @@ object CrystalAura : Module(
476484
val crystalSlot = player.hotbarStacks.indexOfFirst { selection.filterStack(it) }
477485
if (crystalSlot != -1) {
478486
if (!HotbarRequest(crystalSlot, this).submit().done) return@runSafe
487+
else return@runSafeAutomated
479488
}
480489
val swapTo = when (swapHand) { Hand.MAIN_HAND -> HotbarContainer; Hand.OFF_HAND -> OffHandContainer }
481490
if (!selection.transfer(swapTo)) return@runSafe

0 commit comments

Comments
 (0)