Skip to content

Commit

Permalink
Allow for playerless block raycasts (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object authored Aug 20, 2024
2 parents a763cdf + 9da2ab7 commit 2759689
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import at.petrak.hexcasting.api.casting.getVec3
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.iota.NullIota
import at.petrak.hexcasting.api.misc.MediaConstants
import net.minecraft.world.entity.Entity
import net.minecraft.world.level.ClipContext
import net.minecraft.world.phys.HitResult
import net.minecraft.world.phys.Vec3

@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
object OpBlockAxisRaycast : ConstMediaAction {
override val argc = 2
override val mediaCost: Long = MediaConstants.DUST_UNIT / 100
Expand All @@ -29,6 +27,7 @@ object OpBlockAxisRaycast : ConstMediaAction {
Action.raycastEnd(origin, look),
ClipContext.Block.COLLIDER,
ClipContext.Fluid.NONE,
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
env.castingEntity
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import at.petrak.hexcasting.api.casting.getVec3
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.iota.NullIota
import at.petrak.hexcasting.api.misc.MediaConstants
import net.minecraft.world.entity.Entity
import net.minecraft.world.level.ClipContext
import net.minecraft.world.phys.HitResult
import net.minecraft.world.phys.Vec3
Expand All @@ -28,7 +27,8 @@ object OpBlockRaycast : ConstMediaAction {
Action.raycastEnd(origin, look),
ClipContext.Block.COLLIDER,
ClipContext.Fluid.NONE,
env.castingEntity as Entity
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
env.castingEntity
)
)

Expand Down

0 comments on commit 2759689

Please sign in to comment.