File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/main/kotlin/com/lambda Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import com.lambda.task.RootTask.run
3030import com.lambda.task.Task
3131import com.lambda.task.tasks.BuildTask.Companion.build
3232import com.lambda.util.BlockUtils.blockState
33+ import com.lambda.util.extension.shrinkByEpsilon
3334import com.lambda.util.item.ItemUtils.block
3435import com.lambda.util.math.flooredBlockPos
3536import com.lambda.util.player.SlotUtils.hotbarAndStorage
@@ -88,8 +89,8 @@ object PlayerTrap : Module(
8889 }
8990
9091 fun SafeContext.getTrapPositions (player : PlayerEntity ): Set <BlockPos > {
91- val min = player.boundingBox.minPos.flooredBlockPos.add(- 1 , - 1 , - 1 )
92- val max = player.boundingBox.maxPos.flooredBlockPos.add(1 , 1 , 1 )
92+ val min = player.boundingBox.shrinkByEpsilon(). minPos.flooredBlockPos.add(- 1 , - 1 , - 1 )
93+ val max = player.boundingBox.shrinkByEpsilon(). maxPos.flooredBlockPos.add(1 , 1 , 1 )
9394
9495 return buildSet {
9596 (min.x + 1 .. < max.x).forEach { x ->
Original file line number Diff line number Diff line change @@ -23,5 +23,7 @@ import net.minecraft.util.math.Vec3d
2323val Box .min get() = Vec3d (minX, minY, minZ)
2424val Box .max get() = Vec3d (maxX, maxY, maxZ)
2525
26+ fun Box.shrinkByEpsilon (): Box = expand(- 1e- 7 )
27+
2628operator fun Box.contains (boundingBox : Box ) = this .intersects(boundingBox)
2729operator fun DoubleArray.component6 () = this [5 ]
You can’t perform that action at this time.
0 commit comments