Skip to content

Commit 373fbe4

Browse files
committed
Disable options
1 parent ce4a2fb commit 373fbe4

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/main/kotlin/HighwayTools.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import net.minecraft.util.math.AxisAlignedBB
7070
import net.minecraft.util.math.BlockPos
7171
import net.minecraft.util.math.RayTraceResult
7272
import net.minecraft.util.math.Vec3d
73+
import net.minecraft.util.text.TextComponentString
7374
import net.minecraft.world.EnumDifficulty
7475
import net.minecraftforge.fml.common.gameevent.TickEvent
7576
import kotlin.math.abs
@@ -135,13 +136,15 @@ internal object HighwayTools : PluginModule(
135136
private val placementSearch by setting("Place Deep Search", 2, 1..4, 1, { page == Page.BEHAVIOR }, description = "EXPERIMENTAL: Attempts to find a support block for placing against")
136137

137138
// storage management
138-
private val storageManagement by setting("Manage Storage", false, { page == Page.STORAGE_MANAGEMENT }, description = "Choose to interact with container using only packets.")
139+
private val storageManagement by setting("Manage Storage", true, { page == Page.STORAGE_MANAGEMENT }, description = "Choose to interact with container using only packets.")
139140
private val leaveEmptyShulkers by setting("Leave Empty Shulkers", true, { page == Page.STORAGE_MANAGEMENT && storageManagement }, description = "Does not break empty shulkers.")
140141
private val grindObsidian by setting("Grind Obsidian", true, { page == Page.STORAGE_MANAGEMENT }, description = "Destroy Ender Chests to obtain Obsidian.")
141142
private val saveMaterial by setting("Save Material", 12, 0..64, 1, { page == Page.STORAGE_MANAGEMENT }, description = "How many material blocks are saved")
142143
private val saveTools by setting("Save Tools", 1, 0..36, 1, { page == Page.STORAGE_MANAGEMENT }, description = "How many tools are saved")
143144
private val saveEnder by setting("Save Ender Chests", 1, 0..64, 1, { page == Page.STORAGE_MANAGEMENT }, description = "How many ender chests are saved")
144145
private val disableMode by setting("Disable Mode", DisableMode.NONE, { page == Page.STORAGE_MANAGEMENT }, description = "Choose action when bot is out of materials or tools")
146+
private val usingProxy by setting("Proxy", false, { disableMode == DisableMode.LOGOUT && page == Page.STORAGE_MANAGEMENT }, description = "Enable this if you are using a proxy to call the given command")
147+
private val proxyCommand by setting("Proxy Command", "/dc", { usingProxy && disableMode == DisableMode.LOGOUT && page == Page.STORAGE_MANAGEMENT }, description = "Command to be sent to log out")
145148
// private val tryRefreshSlots by setting("Try refresh slot", false, { page == Page.STORAGE_MANAGEMENT }, description = "Clicks a slot on desync")
146149

147150
// stat settings
@@ -1082,7 +1085,19 @@ internal object HighwayTools : PluginModule(
10821085
AntiAFK.enable()
10831086
}
10841087
DisableMode.LOGOUT -> {
1085-
sendChatMessage("$chatName CAUTION: Logging of in X Minutes.")
1088+
sendChatMessage("$chatName CAUTION: Logging of in 1 minute!")
1089+
defaultScope.launch {
1090+
delay(6000L)
1091+
if (disableMode == DisableMode.LOGOUT && isEnabled) {
1092+
onMainThreadSafe {
1093+
if (usingProxy) {
1094+
player.sendChatMessage(proxyCommand)
1095+
} else {
1096+
connection.networkManager.closeChannel(TextComponentString("Done building highways."))
1097+
}
1098+
}
1099+
}
1100+
}
10861101
}
10871102
DisableMode.NONE -> {
10881103
// Nothing

0 commit comments

Comments
 (0)