17 lines
598 B
Kotlin
17 lines
598 B
Kotlin
package at.petrak.hex.common.casting.operators
|
|
|
|
import at.petrak.hex.common.casting.CastingContext
|
|
import at.petrak.hex.common.casting.SpellDatum
|
|
import at.petrak.hex.common.casting.SpellOperator.Companion.spellListOf
|
|
import at.petrak.hex.common.items.ItemSpellbook
|
|
|
|
object OpWriteToSpellbook : SimpleOperator {
|
|
override val argc: Int
|
|
get() = 1
|
|
|
|
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): List<SpellDatum<*>> {
|
|
val spellbook = ctx.getSpellbook()
|
|
ItemSpellbook.WriteDatum(spellbook.orCreateTag, args[0])
|
|
return spellListOf()
|
|
}
|
|
} |