Skip to content

Commit fd283aa

Browse files
committed
Finish
1 parent 99b91a5 commit fd283aa

2 files changed

Lines changed: 36 additions & 30 deletions

File tree

src/main/kotlin/HighwayTools.kt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ internal object HighwayTools : PluginModule(
799799
val nextPos = getNextPos()
800800

801801
if (currentBlockPos.distanceTo(targetBlockPos) < 2 ||
802-
(distancePending > 0 && currentBlockPos.distanceTo(startingDirection.directionVec.multiply(distancePending)) < 2)) {
802+
(distancePending > 0 && startingBlockPos.add(startingDirection.directionVec.multiply(distancePending)).distanceTo(currentBlockPos) == 0.0)) {
803803
sendChatMessage("$chatName Reached target destination")
804804
mc.soundHandler.playSound(PositionedSoundRecord.getRecord(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0f, 1.0f))
805805
disable()
@@ -1104,7 +1104,7 @@ internal object HighwayTools : PluginModule(
11041104
getEjectSlot()?.let {
11051105
throwAllInSlot(it)
11061106
} ?: run {
1107-
sendChatMessage("Full inventory: Can't pickup Item@(${containerTask.blockPos.asString()})")
1107+
sendChatMessage("$chatName inventory: Can't pickup Item@(${containerTask.blockPos.asString()})")
11081108
containerTask.updateState(TaskState.DONE)
11091109
}
11101110
} else {
@@ -2104,7 +2104,7 @@ internal object HighwayTools : PluginModule(
21042104
val minutesLeft = ((secLeft % 3600) / 60).toInt().toString().padStart(2, '0')
21052105
val hoursLeft = (secLeft / 3600).toInt().toString().padStart(2, '0')
21062106

2107-
displayText.addLine("Next refill", primaryColor)
2107+
displayText.addLine("Refill", primaryColor)
21082108
displayText.add(" ${material.localizedName}:", primaryColor)
21092109

21102110
if (material == Blocks.OBSIDIAN) {
@@ -2116,14 +2116,19 @@ internal object HighwayTools : PluginModule(
21162116
displayText.add(" ${fillerMat.localizedName}:", primaryColor)
21172117
displayText.addLine("$fillerMatLeft", secondaryColor)
21182118

2119-
displayText.add(" Distance left:", primaryColor)
2120-
displayText.addLine("${pavingLeft.toInt()}", secondaryColor)
2119+
if (grindCycles > 0) {
2120+
displayText.add(" Ender Chest cycles:", primaryColor)
2121+
displayText.addLine("$grindCycles", secondaryColor)
2122+
} else {
2123+
displayText.add(" Distance left:", primaryColor)
2124+
displayText.addLine("${pavingLeft.toInt()}", secondaryColor)
21212125

2122-
if (!anonymizeStats) displayText.add(" Destination:", primaryColor)
2123-
if (!anonymizeStats) displayText.addLine("(${currentBlockPos.add(startingDirection.directionVec.multiply(pavingLeft.toInt())).asString()})", secondaryColor)
2126+
if (!anonymizeStats) displayText.add(" Destination:", primaryColor)
2127+
if (!anonymizeStats) displayText.addLine("(${currentBlockPos.add(startingDirection.directionVec.multiply(pavingLeft.toInt())).asString()})", secondaryColor)
21242128

2125-
displayText.add(" ETA:", primaryColor)
2126-
displayText.addLine("$hoursLeft:$minutesLeft:$secondsLeft", secondaryColor)
2129+
displayText.add(" ETA:", primaryColor)
2130+
displayText.addLine("$hoursLeft:$minutesLeft:$secondsLeft", secondaryColor)
2131+
}
21272132
}
21282133
Mode.TUNNEL -> {
21292134
val pickaxesLeft = player.inventorySlots.countItem<ItemPickaxe>()

src/main/kotlin/HighwayToolsCommand.kt

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,34 @@ object HighwayToolsCommand : ClientCommand(
3838
}
3939
}
4040

41-
literal("from", "start") {
42-
blockPos("position") { blockPosArg ->
43-
execute("Sets starting coordinates") {
44-
// ToDo: Make starting position for next instance
45-
// HighwayTools.startingPos = blockPosArg.value
46-
}
47-
}
48-
}
41+
// literal("from", "start") {
42+
// blockPos("position") { blockPosArg ->
43+
// execute("Sets starting coordinates") {
44+
// // ToDo: Make starting position for next instance
45+
//// HighwayTools.startingPos = blockPosArg.value
46+
// }
47+
// }
48+
// }
4949

50-
literal("to", "stop") {
51-
blockPos("position") { blockPosArg ->
52-
execute("Sets stopping coordinates and starts bot") {
53-
if (HighwayTools.isEnabled) {
54-
sendChatMessage("Run this command when the bot is not running")
55-
} else {
56-
HighwayTools.targetBlockPos = blockPosArg.value
57-
sendChatMessage("Started HighwayTools with target @(${blockPosArg.value.asString()})")
58-
HighwayTools.enable()
59-
}
60-
}
61-
}
62-
}
50+
// literal("to", "stop") {
51+
// blockPos("position") { blockPosArg ->
52+
// execute("Sets stopping coordinates and starts bot") {
53+
// if (HighwayTools.isEnabled) {
54+
// sendChatMessage("Run this command when the bot is not running")
55+
// } else {
56+
// HighwayTools.targetBlockPos = blockPosArg.value
57+
// sendChatMessage("Started HighwayTools with target @(${blockPosArg.value.asString()})")
58+
// HighwayTools.enable()
59+
// }
60+
// }
61+
// }
62+
// }
6363

6464
literal("distance") {
6565
int("distance") { distanceArg ->
6666
execute("Set the target distance until the bot stops") {
6767
HighwayTools.distancePending = distanceArg.value
68+
sendChatMessage("HighwayTools will stop after (${distanceArg.value}) blocks distance. To remove the limit use distance 0")
6869
}
6970
}
7071
}

0 commit comments

Comments
 (0)