File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
common/src/main/kotlin/com/lambda/module/modules/player Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -736,7 +736,7 @@ object PacketMine : Module(
736736 if (! swapped) return
737737
738738 when {
739- player.inventory.selectedSlot != swappedSlot -> cancelSwap ()
739+ player.inventory.selectedSlot != swappedSlot -> resetSwap ()
740740
741741 swapMode.isConstant() -> {
742742 if (swappedSlot != bestTool) swapTo(bestTool)
@@ -947,18 +947,19 @@ object PacketMine : Module(
947947 doubleBreakReturnSlot = 0
948948 }
949949
950- returnSlot = - 1
951- swappedSlot = - 1
952- swapped = false
950+ resetSwap()
953951
954952 return
955953 }
956954
957955 private fun SafeContext.doubleBreakSwapTo (slot : Int ) {
958956 val currentSelectedSlot = player.inventory.selectedSlot
959957
960- if (slot != currentSelectedSlot ) {
958+ if (! doubleBreakSwapped ) {
961959 doubleBreakReturnSlot = currentSelectedSlot
960+ }
961+
962+ if (slot != currentSelectedSlot) {
962963 player.inventory.selectedSlot = slot
963964 connection.sendPacket(UpdateSelectedSlotC2SPacket (slot))
964965 }
@@ -975,11 +976,10 @@ object PacketMine : Module(
975976 connection.sendPacket(UpdateSelectedSlotC2SPacket (doubleBreakReturnSlot))
976977 }
977978
978- doubleBreakReturnSlot = 0
979979 doubleBreakSwapped = false
980980 }
981981
982- private fun cancelSwap () {
982+ private fun resetSwap () {
983983 returnSlot = - 1
984984 swappedSlot = - 1
985985 swapped = false
You can’t perform that action at this time.
0 commit comments