Skip to content

Commit 14c8cd1

Browse files
committed
more cleanup
1 parent 79799aa commit 14c8cd1

File tree

1 file changed

+4
-8
lines changed
  • common/src/main/kotlin/com/lambda/interaction/construction/simulation

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,9 @@ object BuildSimulator {
525525
resultState = blockItem.getPlacementState(context)
526526
?: return@placeState PlaceResult.BlockedByEntity(pos)
527527

528-
if (!targetState.matches(resultState, pos, world, preProcessing.ignore)) {
529-
return@placeState PlaceResult.NoIntegrity(
530-
pos, resultState, context, (targetState as? TargetState.State)?.blockState
531-
)
532-
} else {
533-
return@placeState null
534-
}
528+
return@placeState if (!targetState.matches(resultState, pos, world, preProcessing.ignore))
529+
PlaceResult.NoIntegrity(pos, resultState, context, (targetState as? TargetState.State)?.blockState)
530+
else null
535531
}
536532

537533
val currentDirIsValid = simulatePlaceState()?.let { basePlaceResult ->
@@ -552,7 +548,7 @@ object BuildSimulator {
552548
}
553549

554550
fakePlayer.rotation = player.rotation
555-
simulatePlaceState() ?: run {
551+
if (simulatePlaceState() == null) {
556552
rot = fakePlayer.rotation
557553
return@rotate
558554
}

0 commit comments

Comments
 (0)