Skip to content

Commit 4b6f410

Browse files
committed
subject currently held item to the same scrutiny as other items
1 parent 3515c29 commit 4b6f410

File tree

1 file changed

+5
-3
lines changed
  • common/src/main/kotlin/com/lambda/interaction/construction/simulation

1 file changed

+5
-3
lines changed

common/src/main/kotlin/com/lambda/interaction/construction/simulation/BuildSimulator.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,13 @@ object BuildSimulator {
797797
.flatten()
798798
.filter { BreakManager.currentStackSelection.filterStack(it) }
799799
.let { containerStacks ->
800-
var bestStack = player.mainHandStack
801-
var bestBreakDelta = state.calcItemBlockBreakingDelta(player, world, pos, bestStack)
800+
var bestStack = ItemStack.EMPTY
801+
var bestBreakDelta = -1f
802802
containerStacks.forEach { stack ->
803803
val breakDelta = state.calcItemBlockBreakingDelta(player, world, pos, stack)
804-
if (breakDelta > bestBreakDelta) {
804+
if (breakDelta > bestBreakDelta ||
805+
(stack == player.mainHandStack && breakDelta >= bestBreakDelta))
806+
{
805807
bestBreakDelta = breakDelta
806808
bestStack = stack
807809
}

0 commit comments

Comments
 (0)