Skip to content

Commit 2ec256d

Browse files
committed
use current rotation rather than player rotation when checking the validity of the previous rotation for direction
1 parent d3eda36 commit 2ec256d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/src/main/kotlin/com/lambda/interaction/construction/context/PlaceContext.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ data class PlaceContext(
8181
val validRotation = if (request.build.placing.rotate) {
8282
//ToDo: add a rotation compare to the !previousDirWasInvalid check in case the player
8383
// was able to perform actions after updating the server rotation in the same tick
84-
request.rotation.request(rotation).done && !previousDirWasInvalid
84+
request.rotation.request(rotation, false).done && !previousDirWasInvalid
8585
} else true
8686
return hotbarRequest.done && validRotation
8787
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ object BuildSimulator {
241241
// ToDo: For each hand and sneak or not?
242242
val fakePlayer = copyPlayer(player).apply {
243243
setPos(eye.x, eye.y - standingEyeHeight, eye.z)
244+
this.rotation = RotationManager.serverRotation
244245
}
245246

246247
val checkedResult = checkedHit.hit
@@ -293,7 +294,7 @@ object BuildSimulator {
293294
}
294295

295296
lateinit var resultState: BlockState
296-
var rot = fakePlayer.rotation
297+
var rot = player.rotation
297298

298299
val simulatePlaceState = placeState@ {
299300
resultState = blockItem.getPlacementState(context)
@@ -330,7 +331,6 @@ object BuildSimulator {
330331
if (place.axisRotate && currentDirIsInvalid) run axisRotations@ {
331332
placementRotations.forEachIndexed direction@ { index, angle ->
332333
fakePlayer.rotation = angle
333-
334334
when (val placeResult = simulatePlaceState()) {
335335
is PlaceResult.BlockedByEntity -> {
336336
acc.add(placeResult)

0 commit comments

Comments
 (0)