Skip to content

Commit

Permalink
Added NoRotation option to InventoryConstraints. (CCBlueX#1586)
Browse files Browse the repository at this point in the history
  • Loading branch information
mems01 authored Nov 26, 2023
1 parent d374d58 commit a76177c
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import com.viaversion.viaversion.protocols.protocol1_12to1_11_1.Protocol1_12To1_
import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ServerboundPackets1_9_3
import io.netty.util.AttributeKey
import net.ccbluex.liquidbounce.config.Configurable
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.ArmorItemSlot
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.HotbarItemSlot
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.InventoryItemSlot
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.ItemSlot
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.OffHandSlot
import net.ccbluex.liquidbounce.features.module.modules.player.invcleaner.*
import net.ccbluex.liquidbounce.utils.aiming.RotationManager
import net.ccbluex.liquidbounce.utils.client.SilentHotbar
import net.ccbluex.liquidbounce.utils.client.mc
import net.ccbluex.liquidbounce.utils.entity.moving
Expand Down Expand Up @@ -122,6 +119,7 @@ fun useHotbarSlotOrOffhand(item: HotbarItemSlot) {
OffHandSlot -> {
interactItem(Hand.OFF_HAND)
}

else -> {
interactItem(Hand.MAIN_HAND) {
SilentHotbar.selectSlotSilently(null, item.hotbarSlotForServer, 1)
Expand Down Expand Up @@ -158,9 +156,10 @@ class InventoryConstraintsConfigurable : Configurable("InventoryConstraints") {
internal val delay by intRange("Delay", 2..4, 0..20)
internal val invOpen by boolean("InvOpen", false)
internal val noMove by boolean("NoMove", false)
internal val noRotation by boolean("NoRotation", false) // This should be visible only when NoMove is enabled

val violatesNoMove
get() = noMove && mc.player?.moving == true
get() = noMove && (mc.player?.moving == true || noRotation && RotationManager.rotationForServer != RotationManager.serverRotation)
}

data class ItemStackWithSlot(val slot: Int, val itemStack: ItemStack)

0 comments on commit a76177c

Please sign in to comment.