Skip to content

Commit

Permalink
Semi fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Avanatiker committed Jul 1, 2021
1 parent d71c7af commit e8d98f3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/kotlin/HighwayTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ internal object HighwayTools : PluginModule(
private val printDebug by setting("Show Queue", false, { page == Page.CONFIG }, description = "Shows task queue in HUD")
private val debugMessages by setting("Debug Messages", DebugMessages.IMPORTANT, { page == Page.CONFIG }, description = "Sets the debug log depth level")
private val goalRender by setting("Goal Render", false, { page == Page.CONFIG }, description = "Renders the baritone goal")
private val showCurrentPos by setting("Current Pos Render", false, { page == Page.CONFIG }, description = "Renders the current position")
private val filled by setting("Filled", true, { page == Page.CONFIG }, description = "Renders colored task surfaces")
private val outline by setting("Outline", true, { page == Page.CONFIG }, description = "Renders colored task outlines")
private val popUp by setting("Pop up", true, { page == Page.CONFIG }, description = "Funny render effect")
Expand Down Expand Up @@ -463,7 +464,7 @@ internal object HighwayTools : PluginModule(
renderer.thickness = thickness
val currentTime = System.currentTimeMillis()

renderer.add(currentBlockPos, ColorHolder(255, 255, 255))
if (showCurrentPos) renderer.add(currentBlockPos, ColorHolder(255, 255, 255))

if (containerTask.taskState != TaskState.DONE) {
addToRenderer(containerTask, currentTime)
Expand Down Expand Up @@ -934,7 +935,9 @@ internal object HighwayTools : PluginModule(
private fun SafeClientEvent.doPathing() {
when (moveState) {
MovementState.RUNNING, MovementState.BRIDGE -> {
if (!shouldBridge() && moveState == MovementState.BRIDGE) moveState = MovementState.RUNNING
if (!shouldBridge() && moveState == MovementState.BRIDGE) {
moveState = MovementState.RUNNING
}

if (moveState == MovementState.BRIDGE &&
bridging && player.positionVector.distanceTo(currentBlockPos) < 1) {
Expand All @@ -950,6 +953,8 @@ internal object HighwayTools : PluginModule(
player.motionZ = (target.z - player.posZ).coerceIn(-0.2, 0.2)
}

goal = GoalNear(currentBlockPos, 0)

var nextPos = currentBlockPos
val possiblePos = nextPos.add(startingDirection.directionVec)

Expand All @@ -971,8 +976,6 @@ internal object HighwayTools : PluginModule(
refreshData()
}

goal = GoalNear(currentBlockPos, 0)

if (currentBlockPos.distanceTo(targetBlockPos) < 2 ||
(distancePending > 0 && startingBlockPos.add(startingDirection.directionVec.multiply(distancePending)).distanceTo(currentBlockPos) == 0.0)) {
sendChatMessage("$chatName Reached target destination")
Expand Down

0 comments on commit e8d98f3

Please sign in to comment.