File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
common/src/main/kotlin/com/lambda/task/tasks Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ import com.lambda.task.Task
3030import com.lambda.util.BlockUtils.blockState
3131import com.lambda.util.Communication.warn
3232import net.minecraft.block.BlockState
33- import net.minecraft.util.ActionResult
3433
3534class PlaceBlock @Ta5kBuilder constructor(
3635 private val ctx : PlaceContext ,
@@ -97,20 +96,19 @@ class PlaceBlock @Ta5kBuilder constructor(
9796 }
9897
9998 private fun SafeContext.placeBlock () {
100- val stack = player.getStackInHand(ctx.hand)
101- val stackCount = stack.count
10299 val actionResult = interaction.interactBlock(
103100 player,
104101 ctx.hand,
105102 ctx.result
106103 )
107104
108- if (actionResult is ActionResult . Success ) {
109- if (actionResult.swingSource() == ActionResult . SwingSource . CLIENT && interact.swingHand) {
105+ if (actionResult.isAccepted ) {
106+ if (interact.swingHand) {
110107 player.swingHand(ctx.hand)
111- if (! player.getStackInHand(ctx.hand).isEmpty && (stack.count != stackCount || interaction.hasCreativeInventory())) {
112- mc.gameRenderer.firstPersonRenderer.resetEquipProgress(ctx.hand)
113- }
108+ }
109+
110+ if (! player.getStackInHand(ctx.hand).isEmpty && interaction.hasCreativeInventory()) {
111+ mc.gameRenderer.firstPersonRenderer.resetEquipProgress(ctx.hand)
114112 }
115113
116114 state = State .CONFIRMING
You can’t perform that action at this time.
0 commit comments