port of 9d089a20a6
This commit is contained in:
yrsegal@gmail.com 2022-07-24 20:03:07 -04:00
parent 7e92a8352c
commit 150f646ddf
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@ object OpBlockAxisRaycast : ConstManaOperator {
)
)
return if (blockHitResult.type == HitResult.Type.BLOCK) {
return if (blockHitResult.type == HitResult.Type.BLOCK && ctx.isVecInRange(Vec3.atCenterOf(blockHitResult.blockPos))) {
blockHitResult.direction.step().asSpellResult
} else {
null.asSpellResult

View file

@ -24,7 +24,7 @@ object OpBlockRaycast : ConstManaOperator {
)
)
return if (blockHitResult.type == HitResult.Type.BLOCK) {
return if (blockHitResult.type == HitResult.Type.BLOCK && ctx.isVecInRange(Vec3.atCenterOf(blockHitResult.blockPos))) {
// the position on the bhr is the position of the specific *hit point*, which is actually on the outside of the block
// this is weird (for example, casting OpBreakBlock at this position will not break the block we're looking at)
// so we return the block pos instead