Skip to content

Commit 339f00d

Browse files
committed
better input sanitizing in break manager
1 parent 6d40644 commit 339f00d

File tree

1 file changed

+4
-1
lines changed
  • common/src/main/kotlin/com/lambda/interaction/request/breaking

1 file changed

+4
-1
lines changed

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakManager.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ object BreakManager : RequestHandler<BreakRequest>(
310310
}
311311
}
312312

313-
return !blockState(ctx.expectedPos).isEmpty
313+
val blockState = blockState(ctx.expectedPos)
314+
val hardness = ctx.checkedState.getHardness(world, ctx.expectedPos)
315+
316+
return !blockState.isEmpty && hardness != 600f && hardness != -1f
314317
}
315318

316319
/**

0 commit comments

Comments
 (0)