File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
common/src/main/kotlin/com/lambda Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ object BuildTest : Module(
1717 onEnable {
1818 buildStructure {
1919 player.blockPos
20- .offset(player.horizontalFacing)
21- .offset(player.horizontalFacing)
20+ .offset(player.horizontalFacing, 2 )
2221 .toStructure(TargetState .Block (Blocks .NETHERRACK ))
2322 .toBlueprint()
2423 }.start(null )
Original file line number Diff line number Diff line change @@ -171,8 +171,8 @@ class BuildStructure(
171171 val neighPos = pos.offset(neighbor)
172172 val hitSide = neighbor.opposite
173173
174- val voxelShape = neighPos.blockState(world).getOutlineShape(world, pos )
175- val boxes = voxelShape.boundingBoxes.map { it.offset(pos ) }
174+ val voxelShape = neighPos.blockState(world).getOutlineShape(world, neighPos )
175+ val boxes = voxelShape.boundingBoxes.map { it.offset(neighPos ) }
176176 val verify: HitResult .() -> Boolean = {
177177 blockResult?.blockPos == neighPos && blockResult?.side == hitSide
178178 }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.lambda.task.tasks
33import com.lambda.Lambda.LOG
44import com.lambda.context.SafeContext
55import com.lambda.event.events.RotationEvent
6+ import com.lambda.event.events.TickEvent
67import com.lambda.event.listener.SafeListener.Companion.listener
78import com.lambda.interaction.construction.context.PlaceContext
89import com.lambda.task.Task
@@ -49,7 +50,8 @@ class PlaceBlock @Ta5kBuilder constructor(
4950 ctx.result
5051 )
5152
52- if (actionResult.isAccepted) {
53+ val match = ctx.targetState.matches(ctx.resultingPos.blockState(world), ctx.resultingPos, world)
54+ if (actionResult.isAccepted && match) {
5355 if (actionResult.shouldSwingHand() && swingHand) {
5456 player.swingHand(ctx.hand)
5557 }
@@ -58,6 +60,8 @@ class PlaceBlock @Ta5kBuilder constructor(
5860 if (! player.getStackInHand(ctx.hand).isEmpty && interaction.hasCreativeInventory()) {
5961 mc.gameRenderer.firstPersonRenderer.resetEquipProgress(ctx.hand)
6062 }
63+
64+ success(Unit )
6165 } else {
6266 failure(" Failed to place block as simulation does not match actual result $actionResult " )
6367 }
You can’t perform that action at this time.
0 commit comments