Skip to content

Commit

Permalink
Optimization after sleep deposit go to chests
Browse files Browse the repository at this point in the history
  • Loading branch information
sefirosweb committed Apr 1, 2024
1 parent 8fba01b commit 616419d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions core/src/NestedStateModules/deathFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import BehaviorLoadConfig from '@/BehaviorModules/BehaviorLoadConfig'
import StartWork from '@/NestedStateModules/startWorkFunction'
import Commands from '@/NestedStateModules/commandsFunction'
import GoSleep from '@/NestedStateModules/goSleepFunction'
import GoChestsFunctions from '@/NestedStateModules/getReady/goChestsFunctions'
import { Bot } from 'mineflayer'

function deathFunction(bot: Bot, targets: LegionStateMachineTargets) {
Expand All @@ -22,6 +23,10 @@ function deathFunction(bot: Bot, targets: LegionStateMachineTargets) {
commands.x = 325
commands.y = 263

const goChests = GoChestsFunctions(bot, targets)
goChests.x = 725
goChests.y = 413

const playerEntity = new BehaviorGetPlayer(bot, targets)
playerEntity.stateName = 'Search Player'
playerEntity.x = 525
Expand Down Expand Up @@ -124,12 +129,15 @@ function deathFunction(bot: Bot, targets: LegionStateMachineTargets) {

new StateTransition({ // 10
parent: goSleep,
child: startWork,
child: goChests,
shouldTransition: () => goSleep.isFinished() || targets.isNight === false
}),



new StateTransition({ // 11
parent: goChests,
child: startWork,
shouldTransition: () => goChests.isFinished()
}),
]

function reloadTrigger() {
Expand Down

0 comments on commit 616419d

Please sign in to comment.