HexCasting/src/main/java/at/petrak/hex/casting/operators/OpEntityPos.kt

16 lines
567 B
Kotlin
Raw Normal View History

2021-12-25 17:58:16 +01:00
package at.petrak.hex.casting.operators
import at.petrak.hex.casting.CastingContext
import at.petrak.hex.casting.SpellDatum
import at.petrak.hex.casting.operators.SpellOperator.Companion.getChecked
import at.petrak.hex.casting.operators.SpellOperator.Companion.spellListOf
import net.minecraft.world.entity.Entity
object OpEntityPos : SpellOperator {
override val argc = 1
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): List<SpellDatum<*>> {
val e: Entity = args.getChecked(0)
return spellListOf(e.position())
}
}