Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Add UsingItem-OnlyOnNoSlow in sprint
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInMyVan committed Jul 30, 2024
1 parent 99cda04 commit edac39e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ object NoSlow : Module("NoSlow", MOVEMENT, gameDetecting = false) {
if (!noMoveCheck) usedMode.onPacket(event)
}

private fun doNoSlow(noSlowItem: NoSlowItem): Boolean {
if (noSlowItem == OTHER)
fun doNoSlow(noSlowItem: NoSlowItem = NoSlow.noSlowItem): Boolean {
if (noSlowItem == OTHER || !handleEvents())
return false

val mode = usedMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ object Sprint : Module("Sprint", MOVEMENT, gameDetecting = false) {
private val blindness by BooleanValue("Blindness", true)
private val sneaking by BooleanValue("Sneaking", true)
private val usingItem by BooleanValue("UsingItem", true)
private val usingItemOnlyNoSlow by BooleanValue("UsingItem-OnlyOnNoSlow", true) { usingItem }
private val inventory by BooleanValue("Inventory", true)
private val hunger by BooleanValue("Hunger", false)

Expand Down Expand Up @@ -128,12 +129,12 @@ object Sprint : Module("Sprint", MOVEMENT, gameDetecting = false) {
private fun shouldStopSprinting(movementInput: MovementInput, isUsingItem: Boolean): Boolean {
mc.thePlayer ?: return false

if ((!usingItem && isUsingItem)
|| (!inventory && serverOpenInventory)
|| (!sneaking && mc.thePlayer.isSneaking)
|| (!collide && mc.thePlayer.isCollidedHorizontally)
|| (!blindness && mc.thePlayer.isPotionActive(Potion.blindness) && !mc.thePlayer.isSprinting)
|| (!hunger && !(mc.thePlayer.foodStats.foodLevel > 6f || mc.thePlayer.capabilities.allowFlying))
if (isUsingItem && (!usingItem || usingItemOnlyNoSlow && !NoSlow.doNoSlow())
|| !inventory && serverOpenInventory
|| !sneaking && mc.thePlayer.isSneaking
|| !collide && mc.thePlayer.isCollidedHorizontally
|| !blindness && mc.thePlayer.isPotionActive(Potion.blindness) && !mc.thePlayer.isSprinting
|| !hunger && mc.thePlayer.foodStats.foodLevel <= 6f && !mc.thePlayer.capabilities.allowFlying
) return true

if (!isMoving)
Expand Down

0 comments on commit edac39e

Please sign in to comment.