Skip to content

Commit 873a84f

Browse files
committed
Dont disconnect in Queue
1 parent 193c074 commit 873a84f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/com/lambda/module/modules/combat/AutoDisconnect.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import net.minecraft.entity.player.PlayerEntity
4646
import net.minecraft.item.Items
4747
import net.minecraft.sound.SoundEvents
4848
import net.minecraft.text.Text
49+
import net.minecraft.world.GameMode
4950
import java.awt.Color
5051

5152
object AutoDisconnect : Module(
@@ -54,7 +55,7 @@ object AutoDisconnect : Module(
5455
tag = ModuleTag.COMBAT,
5556
) {
5657
private val health by setting("Health", true, "Disconnect from the server when health is below the set limit.")
57-
private val minimumHealth by setting("Min Health", 10, 6..36, 1, "Set the minimum health threshold for disconnection.", unit = " half-hearts") { health }
58+
private val minimumHealth by setting("Min Health", 10, 1..36, 1, "Set the minimum health threshold for disconnection.", unit = " half-hearts") { health }
5859
private val falls by setting("Falls", false, "Disconnect if the player will die of fall damage")
5960
private val fallDistance by setting("Falls Time", 10, 0..30, 1, "Number of blocks fallen before disconnecting for fall damage.", unit = " blocks") { falls }
6061
private val crystals by setting("Crystals", false, "Disconnect if an End Crystal explosion would be lethal.")
@@ -148,6 +149,7 @@ object AutoDisconnect : Module(
148149
}
149150

150151
private fun SafeContext.disconnect(reasonText: Text, reason: Reason? = null) {
152+
if (connection.brand == "2b2t (Velocity)" && player.gameMode == GameMode.SPECTATOR) return
151153
if (reason == Reason.HEALTH || reason == Reason.TOTEM) disable()
152154
connection.connection.disconnect(generateInfo(reasonText))
153155
playSound(SoundEvents.BLOCK_ANVIL_LAND)

0 commit comments

Comments
 (0)