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:
parent
f82bc35109
commit
e5f64c4a50
@ -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() {
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user