Skip to content

Commit eafa509

Browse files
committed
change playerless sentinel check to check for a player and not just an entity
1 parent 92b668f commit eafa509

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/sentinel/OpCreateSentinel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class OpCreateSentinel(val extendsRange: Boolean) : SpellAction {
2020
args: List<Iota>,
2121
env: CastingEnvironment
2222
): SpellAction.Result {
23-
if (env.castingEntity == null)
23+
if (env.castingEntity !is ServerPlayer)
2424
throw MishapBadCaster()
2525

2626
val target = args.getVec3(0, argc)

Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/sentinel/OpDestroySentinel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object OpDestroySentinel : SpellAction {
1717
args: List<Iota>,
1818
env: CastingEnvironment
1919
): SpellAction.Result {
20-
if (env.castingEntity == null)
20+
if (env.castingEntity !is ServerPlayer)
2121
throw MishapBadCaster()
2222

2323
val sentinel = IXplatAbstractions.INSTANCE.getSentinel(env.castingEntity as? ServerPlayer)

Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/sentinel/OpGetSentinelPos.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object OpGetSentinelPos : ConstMediaAction {
1515
override val argc = 0
1616
override val mediaCost: Long = MediaConstants.DUST_UNIT / 10
1717
override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
18-
if (env.castingEntity == null)
18+
if (env.castingEntity !is ServerPlayer)
1919
throw MishapBadCaster()
2020

2121
val sentinel = IXplatAbstractions.INSTANCE.getSentinel(env.castingEntity as? ServerPlayer) ?: return listOf(NullIota())

Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/sentinel/OpGetSentinelWayfind.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object OpGetSentinelWayfind : ConstMediaAction {
1818
override val argc = 1
1919
override val mediaCost: Long = MediaConstants.DUST_UNIT / 10
2020
override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
21-
if (env.castingEntity == null)
21+
if (env.castingEntity !is ServerPlayer)
2222
throw MishapBadCaster()
2323

2424
val from = args.getVec3(0, argc)

0 commit comments

Comments
 (0)