1
0
mirror of https://github.com/kami-blue/client synced 2025-04-18 13:25:16 +00:00

[cleanup] Cleaned up AutoMine baritone command

This commit is contained in:
Xiaro 2020-11-29 15:07:12 -05:00
parent f82bc35109
commit e5f64c4a50
No known key found for this signature in database
GPG Key ID: 996D265D6E155377
2 changed files with 12 additions and 12 deletions

View File

@ -35,25 +35,25 @@ object AutoMine : Module() {
private fun run() {
if (mc.player == null || isDisabled || manual.value) return
var current = ""
if (iron.value) current += " iron_ore"
if (diamond.value) current += " diamond_ore"
if (gold.value) current += " gold_ore"
if (coal.value) current += " coal_ore"
if (log.value) current += " log log2"
if (current.startsWith(" ")) {
current = current.substring(1)
val blocks = ArrayList<String>()
if (iron.value) blocks.add("iron_ore")
if (diamond.value) blocks.add("diamond_ore")
if (gold.value) blocks.add("gold_ore")
if (coal.value) blocks.add("coal_ore")
if (log.value) {
blocks.add("log")
blocks.add("log2")
}
val total = current.split(" ")
if (current.length < 2) {
if (blocks.isEmpty()) {
MessageSendHelper.sendBaritoneMessage("Error: you have to choose at least one thing to mine. To mine custom blocks run the &7" + Command.getCommandPrefix() + "b mine block&f command")
BaritoneUtils.cancelEverything()
return
}
MessageSendHelper.sendBaritoneCommand("mine", *total.toTypedArray())
MessageSendHelper.sendBaritoneCommand("mine", *blocks.toTypedArray())
}
override fun onDisable() {

View File

@ -58,7 +58,7 @@ object MessageSendHelper {
chatControl?.value = true
// ty leijuwuv <--- quit it :monkey:
val event = ChatEvent(java.lang.String.join(" ", *args))
val event = ChatEvent(args.joinToString(separator = " "))
BaritoneUtils.primary?.gameEventHandler?.onSendChatMessage(event)
if (!event.isCancelled && args[0] != "damn") { // don't remove the 'damn', it's critical code that will break everything if you remove it
sendBaritoneMessage("Invalid Command! Please view possible commands at https://github.com/cabaletta/baritone/blob/master/USAGE.md")