Skip to content

Commit 25c7d85

Browse files
committed
default arguments for block search
1 parent c48a2c4 commit 25c7d85

File tree

1 file changed

+4
-4
lines changed
  • common/src/main/kotlin/com/lambda/util/world

1 file changed

+4
-4
lines changed

common/src/main/kotlin/com/lambda/util/world/BlockDsl.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ class BlockDsl(
8585
*/
8686
fun SafeContext.blockSearch(
8787
range: Vec3i,
88-
step: Vec3i,
88+
step: Vec3i = Vec3i(1, 1, 1),
8989
pos: BlockPos = player.blockPos,
90-
predicate: (BlockPos, BlockState) -> Boolean
90+
predicate: (BlockPos, BlockState) -> Boolean = { _, _ -> true }
9191
): Map<BlockPos, BlockState> =
9292
BlockDsl(this, pos, range, step, predicate).build()
9393

@@ -102,8 +102,8 @@ fun SafeContext.blockSearch(
102102
*/
103103
fun SafeContext.blockSearch(
104104
range: Int,
105-
step: Int,
105+
step: Int = 1,
106106
pos: BlockPos = player.blockPos,
107-
predicate: (BlockPos, BlockState) -> Boolean
107+
predicate: (BlockPos, BlockState) -> Boolean = { _, _ -> true }
108108
): Map<BlockPos, BlockState> =
109109
blockSearch(Vec3i(range, range, range), Vec3i(step, step, step), pos, predicate)

0 commit comments

Comments
 (0)