Skip to content

Commit e4451f3

Browse files
committed
fixed swing issue with placing
1 parent 4fe34c1 commit e4451f3

File tree

2 files changed

+3
-146
lines changed

2 files changed

+3
-146
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.lambda.util.BlockUtils
2828
import com.lambda.util.BlockUtils.blockState
2929
import com.lambda.util.Communication.warn
3030
import net.minecraft.block.BlockState
31+
import net.minecraft.util.ActionResult
3132
import net.minecraft.util.Hand
3233
import net.minecraft.util.hit.BlockHitResult
3334
import net.minecraft.util.math.BlockPos
@@ -58,8 +59,8 @@ data class PlaceContext(
5859
player, hand, result
5960
)
6061

61-
if (actionResult.isAccepted) {
62-
if (swingHand) {
62+
if (actionResult is ActionResult.Success) {
63+
if (actionResult.swingSource() == ActionResult.SwingSource.CLIENT && swingHand) {
6364
player.swingHand(hand)
6465
}
6566

common/src/main/kotlin/com/lambda/task/tasks/PlaceBlock.kt

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)