-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pattern to check if something has hex flight; closes #687
- Loading branch information
1 parent
c4fec7d
commit 567c643
Showing
4 changed files
with
51 additions
and
17 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...rc/main/java/at/petrak/hexcasting/common/casting/actions/queryentity/OpCanEntityHexFly.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package at.petrak.hexcasting.common.casting.actions.queryentity | ||
|
||
import at.petrak.hexcasting.api.casting.asActionResult | ||
import at.petrak.hexcasting.api.casting.castables.ConstMediaAction | ||
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment | ||
import at.petrak.hexcasting.api.casting.getPlayer | ||
import at.petrak.hexcasting.api.casting.iota.Iota | ||
import at.petrak.hexcasting.xplat.IXplatAbstractions | ||
|
||
object OpCanEntityHexFly : ConstMediaAction { | ||
override val argc = 1 | ||
|
||
override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> { | ||
val player = args.getPlayer(0, argc) | ||
env.assertEntityInRange(player) | ||
|
||
val flightAbility = IXplatAbstractions.INSTANCE.getFlight(player) | ||
return (flightAbility != null).asActionResult | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters