diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/ConstManaOperator.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/ConstManaOperator.kt index c1425ec1..a9f2770f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/ConstManaOperator.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/ConstManaOperator.kt @@ -13,9 +13,9 @@ interface ConstManaOperator : Operator { val manaCost: Int get() = 0 - fun execute(args: List>, ctx: CastingContext): List> + fun execute(args: List, ctx: CastingContext): List - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { if (this.argc > stack.size) throw MishapNotEnoughArgs(this.argc, stack.size) val args = stack.takeLast(this.argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/OperationResult.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/OperationResult.kt index 6454b5b6..214e0f29 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/OperationResult.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/OperationResult.kt @@ -6,4 +6,4 @@ import at.petrak.hexcasting.api.spell.casting.SpellContinuation /** * What happens when an operator is through? */ -data class OperationResult(val newContinuation: SpellContinuation, val newStack: List>, val newLocalIota: LegacySpellDatum<*>, val sideEffects: List) +data class OperationResult(val newContinuation: SpellContinuation, val newStack: List, val newLocalIota: Iota, val sideEffects: List) diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/Operator.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/Operator.kt index f2398d02..96886c2b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/Operator.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/Operator.kt @@ -21,7 +21,7 @@ interface Operator { * * A particle effect at the cast site and various messages and advancements are done automagically. */ - fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult + fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult /** * Do you need to be enlightened to use this operator? (i.e. is this operator a Great Pattern) @@ -50,11 +50,11 @@ interface Operator { origin.add(look.normalize().scale(MAX_DISTANCE)) @JvmStatic - fun makeConstantOp(x: LegacySpellDatum<*>): Operator = object : ConstManaOperator { + fun makeConstantOp(x: Iota): Operator = object : ConstManaOperator { override val argc: Int get() = 0 - override fun execute(args: List>, ctx: CastingContext): List> = + override fun execute(args: List, ctx: CastingContext): List = listOf(x) } } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/OperatorUtils.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/OperatorUtils.kt index 95e8f981..b02c6da2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/OperatorUtils.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/OperatorUtils.kt @@ -13,7 +13,7 @@ import net.minecraft.world.entity.Entity import net.minecraft.world.phys.Vec3 import kotlin.math.abs -fun numOrVec(datum: LegacySpellDatum<*>, reverseIdx: Int): Either = +fun numOrVec(datum: Iota, reverseIdx: Int): Either = when (datum.payload) { is Double -> Either.left(datum.payload) is Vec3 -> Either.right(datum.payload) @@ -24,7 +24,7 @@ fun numOrVec(datum: LegacySpellDatum<*>, reverseIdx: Int): Either ) } -fun numOrList(datum: LegacySpellDatum<*>, reverseIdx: Int): Either = +fun numOrList(datum: Iota, reverseIdx: Int): Either = when (datum.payload) { is Double -> Either.left(datum.payload) is SpellList -> Either.right(datum.payload) @@ -35,15 +35,15 @@ fun numOrList(datum: LegacySpellDatum<*>, reverseIdx: Int): Either> { - val out = ArrayList>(vs.size) +fun spellListOf(vararg vs: Any): List { + val out = ArrayList(vs.size) for (v in vs) { out.add(LegacySpellDatum.make(v)) } return out } -inline fun List>.getChecked(idx: Int, argc: Int = 0): T { +inline fun List.getChecked(idx: Int, argc: Int = 0): T { val x = this.getOrElse(idx) { throw MishapNotEnoughArgs(idx + 1, this.size) } if (x.payload is T) return x.payload @@ -57,7 +57,7 @@ inline val Double.asSpellResult get() = spellListOf(this) inline val Number.asSpellResult get() = spellListOf(this.toDouble()) inline val SpellList.asSpellResult get() = spellListOf(this) -inline val List>.asSpellResult get() = spellListOf(this) +inline val List.asSpellResult get() = spellListOf(this) inline val Widget.asSpellResult get() = spellListOf(this) @@ -74,9 +74,9 @@ fun Any.tolerantEquals(other: Any) = tolerantEquals(other, 64) private fun Any.tolerantEquals(other: Any, recursionsLeft: Int): Boolean { return when { - this is LegacySpellDatum<*> && other is LegacySpellDatum<*> -> this.payload.tolerantEquals(other.payload, recursionsLeft) - this is LegacySpellDatum<*> -> this.payload.tolerantEquals(other, recursionsLeft) - other is LegacySpellDatum<*> -> this.tolerantEquals(other.payload, recursionsLeft) + this is Iota && other is Iota -> this.payload.tolerantEquals(other.payload, recursionsLeft) + this is Iota -> this.payload.tolerantEquals(other, recursionsLeft) + other is Iota -> this.tolerantEquals(other.payload, recursionsLeft) this is HexPattern && other is HexPattern -> this.angles == other.angles this is Double && other is Double -> abs(this - other) < TOLERANCE diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/SpellOperator.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/SpellOperator.kt index ea94e702..5976ebf2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/SpellOperator.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/SpellOperator.kt @@ -13,11 +13,11 @@ interface SpellOperator : Operator { fun awardsCastingStat(ctx: CastingContext): Boolean = true fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple>? - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { if (this.argc > stack.size) throw MishapNotEnoughArgs(this.argc, stack.size) val args = stack.takeLast(this.argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/Widget.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/Widget.kt index e2458244..f8410df8 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/Widget.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/Widget.kt @@ -16,7 +16,7 @@ enum class Widget : ConstManaOperator { override val argc: Int get() = 0 - override fun execute(args: List>, ctx: CastingContext): List> = + override fun execute(args: List, ctx: CastingContext): List = this.asSpellResult companion object { diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/casting/FunctionalData.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/casting/FunctionalData.kt index 6be36e6b..79431dae 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/casting/FunctionalData.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/casting/FunctionalData.kt @@ -1,14 +1,14 @@ package at.petrak.hexcasting.api.spell.casting -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota /** * A change to the data in a CastHarness after a pattern is drawn. */ data class FunctionalData( - val stack: List>, + val stack: List, val parenCount: Int, - val parenthesized: List>, + val parenthesized: List, val escapeNext: Boolean, ) { /** diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/Mishap.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/Mishap.kt index f4150750..bf1b0956 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/Mishap.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/Mishap.kt @@ -3,7 +3,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer import at.petrak.hexcasting.api.mod.HexItemTags import at.petrak.hexcasting.api.spell.ParticleSpray -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.ResolvedPatternType import at.petrak.hexcasting.api.spell.math.HexPattern @@ -38,7 +38,7 @@ sealed class Mishap : Throwable() { * * You can also mess up the stack with this. */ - abstract fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) + abstract fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) abstract fun errorMessage(ctx: CastingContext, errorCtx: Context): Component diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapAlreadyBrainswept.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapAlreadyBrainswept.kt index 0e5699f0..d23b1092 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapAlreadyBrainswept.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapAlreadyBrainswept.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer import at.petrak.hexcasting.api.misc.HexDamageSources -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.entity.npc.Villager @@ -12,7 +12,7 @@ class MishapAlreadyBrainswept(val villager: Villager) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.GREEN) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { villager.hurt(HexDamageSources.overcastDamageFrom(ctx.caster), villager.health) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBlock.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBlock.kt index 69662fc3..822515c1 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBlock.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBlock.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer import at.petrak.hexcasting.api.spell.ParticleSpray -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.utils.asTranslatedComponent import net.minecraft.core.BlockPos @@ -15,7 +15,7 @@ class MishapBadBlock(val pos: BlockPos, val expected: Component) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.LIME) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { ctx.world.explode(null, pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, 0.25f, Explosion.BlockInteraction.NONE) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBrainsweep.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBrainsweep.kt index 8972f768..7f121c18 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBrainsweep.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadBrainsweep.kt @@ -3,7 +3,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer import at.petrak.hexcasting.api.misc.HexDamageSources import at.petrak.hexcasting.api.spell.ParticleSpray -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.core.BlockPos import net.minecraft.world.entity.npc.Villager @@ -14,7 +14,7 @@ class MishapBadBrainsweep(val villager: Villager, val pos: BlockPos) : Mishap() override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.GREEN) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { trulyHurt(villager, HexDamageSources.overcastDamageFrom(ctx.caster), villager.health) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadItem.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadItem.kt index 8db9820b..e147e634 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadItem.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadItem.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.utils.asTranslatedComponent import net.minecraft.network.chat.Component @@ -12,7 +12,7 @@ class MishapBadItem(val item: ItemEntity, val wanted: Component) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BROWN) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { item.deltaMovement = item.deltaMovement.add((Math.random() - 0.5) * 0.05, 0.75, (Math.random() - 0.5) * 0.05) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadOffhandItem.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadOffhandItem.kt index 641a8db6..71dda350 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadOffhandItem.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapBadOffhandItem.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.utils.asTranslatedComponent import net.minecraft.network.chat.Component @@ -13,7 +13,7 @@ class MishapBadOffhandItem(val item: ItemStack, val hand: InteractionHand, val w override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BROWN) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { yeetHeldItem(ctx, hand) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDisallowedSpell.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDisallowedSpell.kt index 39c59275..65da779f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDisallowedSpell.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDisallowedSpell.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.ResolvedPatternType import net.minecraft.world.item.DyeColor @@ -12,7 +12,7 @@ class MishapDisallowedSpell(val type: String = "disallowed") : Mishap() { override fun resolutionType(ctx: CastingContext) = ResolvedPatternType.INVALID - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { // NO-OP } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDivideByZero.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDivideByZero.kt index bb1bfa3a..8694bc3c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDivideByZero.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapDivideByZero.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer import at.petrak.hexcasting.api.misc.HexDamageSources -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.utils.asTranslatedComponent @@ -15,7 +15,7 @@ class MishapDivideByZero(val operand1: Component, val operand2: Component, val s override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.RED) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { stack.add(LegacySpellDatum.make(Widget.GARBAGE)) trulyHurt(ctx.caster, HexDamageSources.OVERCAST, ctx.caster.health / 2) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEntityTooFarAway.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEntityTooFarAway.kt index c42c1cdc..81b81783 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEntityTooFarAway.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEntityTooFarAway.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.network.chat.Component import net.minecraft.world.entity.Entity @@ -11,7 +11,7 @@ class MishapEntityTooFarAway(val entity: Entity) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.PINK) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { // Knock the player's items out of their hands yeetHeldItemsTowards(ctx, entity.position()) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapError.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapError.kt index 1771d64b..0f6d4666 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapError.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapError.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.item.DyeColor @@ -9,7 +9,7 @@ class MishapError(val exception: Exception) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BLACK) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { // NO-OP } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEvalTooDeep.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEvalTooDeep.kt index 9c74a3a5..c118486f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEvalTooDeep.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapEvalTooDeep.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.item.DyeColor @@ -9,7 +9,7 @@ class MishapEvalTooDeep : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BLUE) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { ctx.caster.airSupply -= 290 } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapImmuneEntity.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapImmuneEntity.kt index b06cc288..01a8e238 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapImmuneEntity.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapImmuneEntity.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.entity.Entity import net.minecraft.world.item.DyeColor @@ -10,7 +10,7 @@ class MishapImmuneEntity(val entity: Entity) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BLUE) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { yeetHeldItemsTowards(ctx, entity.position()) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidIota.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidIota.kt index 0bc1fdac..3fa0edac 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidIota.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidIota.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellList import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -22,14 +22,14 @@ import net.minecraft.world.phys.Vec3 * [MishapInvalidIota.reverseIdx] is the index from the *back* of the stack. */ class MishapInvalidIota( - val perpetrator: LegacySpellDatum<*>, + val perpetrator: Iota, val reverseIdx: Int, val expected: Component ) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.GRAY) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { stack[stack.size - 1 - reverseIdx] = LegacySpellDatum.make(Widget.GARBAGE) } @@ -39,7 +39,7 @@ class MishapInvalidIota( companion object { @JvmStatic - fun ofClass(perpetrator: LegacySpellDatum<*>, reverseIdx: Int, cls: Class<*>): MishapInvalidIota { + fun ofClass(perpetrator: Iota, reverseIdx: Int, cls: Class<*>): MishapInvalidIota { val key = "hexcasting.mishap.invalid_value.class." + when { Double::class.java.isAssignableFrom(cls) || Double::class.javaObjectType.isAssignableFrom(cls) -> "double" Vec3::class.java.isAssignableFrom(cls) -> "vector" diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidPattern.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidPattern.kt index 8d3fc82d..b093888a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidPattern.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidPattern.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.ResolvedPatternType @@ -13,7 +13,7 @@ class MishapInvalidPattern : Mishap() { override fun resolutionType(ctx: CastingContext) = ResolvedPatternType.INVALID - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { stack.add(LegacySpellDatum.make(Widget.GARBAGE)) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidSpellDatumType.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidSpellDatumType.kt index 96f9efb5..49ea0825 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidSpellDatumType.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapInvalidSpellDatumType.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.item.DyeColor @@ -12,7 +12,7 @@ class MishapInvalidSpellDatumType(val perpetrator: Any) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BLACK) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { // NO-OP } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationInWrongDimension.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationInWrongDimension.kt index cbbf306b..6fa7308b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationInWrongDimension.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationInWrongDimension.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.network.chat.Component @@ -12,7 +12,7 @@ class MishapLocationInWrongDimension(val properDimension: ResourceLocation) : Mi override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.MAGENTA) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { stack.add(LegacySpellDatum.make(Widget.GARBAGE)) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationTooFarAway.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationTooFarAway.kt index d0d08cc0..619636c3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationTooFarAway.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapLocationTooFarAway.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.network.chat.Component import net.minecraft.world.item.DyeColor @@ -11,7 +11,7 @@ class MishapLocationTooFarAway(val location: Vec3, val type: String = "too_far") override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.MAGENTA) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { yeetHeldItemsTowards(ctx, location) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoAkashicRecord.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoAkashicRecord.kt index b44226db..66a323f2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoAkashicRecord.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoAkashicRecord.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.core.BlockPos import net.minecraft.world.item.DyeColor @@ -10,7 +10,7 @@ class MishapNoAkashicRecord(val pos: BlockPos) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.PURPLE) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { ctx.caster.giveExperiencePoints(-100) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoSpellCircle.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoSpellCircle.kt index e6f06a31..33ec87d9 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoSpellCircle.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNoSpellCircle.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.item.DyeColor @@ -9,7 +9,7 @@ class MishapNoSpellCircle : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.LIGHT_BLUE) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { ctx.caster.inventory.dropAll() } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNotEnoughArgs.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNotEnoughArgs.kt index 3b846bb2..13b9f01d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNotEnoughArgs.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapNotEnoughArgs.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.network.chat.Component @@ -11,7 +11,7 @@ class MishapNotEnoughArgs(val expected: Int, val got: Int) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.LIGHT_GRAY) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { for (i in got until expected) stack.add(LegacySpellDatum.make(Widget.GARBAGE)) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapOthersName.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapOthersName.kt index 440db1f9..f673ba84 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapOthersName.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapOthersName.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellList import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.effect.MobEffectInstance @@ -13,7 +13,7 @@ class MishapOthersName(val other: Player) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.BLACK) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { ctx.caster.addEffect(MobEffectInstance(MobEffects.BLINDNESS, 20 * 60)) } @@ -22,14 +22,14 @@ class MishapOthersName(val other: Player) : Mishap() { companion object { @JvmStatic - fun getTrueNameFromDatum(datum: LegacySpellDatum<*>, caster: Player): Player? { + fun getTrueNameFromDatum(datum: Iota, caster: Player): Player? { if (datum.payload is Player && datum.payload != caster) return datum.payload else if (datum.payload !is SpellList) return null - val poolToSearch: MutableList> = - datum.payload.filterIsInstance>().toMutableList() + val poolToSearch: MutableList = + datum.payload.filterIsInstance().toMutableList() while (poolToSearch.isNotEmpty()) { val datumToCheck = poolToSearch[0] @@ -38,14 +38,14 @@ class MishapOthersName(val other: Player) : Mishap() { if (datumToCheck.payload is Player && datumToCheck.payload != caster) return datumToCheck.payload else if (datumToCheck.payload is SpellList) - poolToSearch.addAll(datumToCheck.payload.filterIsInstance>()) + poolToSearch.addAll(datumToCheck.payload.filterIsInstance()) } return null } @JvmStatic - fun getTrueNameFromArgs(datums: List>, caster: Player): Player? { + fun getTrueNameFromArgs(datums: List, caster: Player): Player? { return datums.firstNotNullOfOrNull { getTrueNameFromDatum(it, caster) } } } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapTooManyCloseParens.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapTooManyCloseParens.kt index 3c2a3cca..e0f1f4a6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapTooManyCloseParens.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapTooManyCloseParens.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.network.chat.Component import net.minecraft.world.item.DyeColor @@ -10,7 +10,7 @@ class MishapTooManyCloseParens : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.ORANGE) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { stack.add(LegacySpellDatum.make(errorCtx.pattern)) } diff --git a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapUnescapedValue.kt b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapUnescapedValue.kt index f9c79bd5..f952f6d0 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapUnescapedValue.kt +++ b/Common/src/main/java/at/petrak/hexcasting/api/spell/mishaps/MishapUnescapedValue.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.api.spell.mishaps import at.petrak.hexcasting.api.misc.FrozenColorizer -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.item.DyeColor @@ -9,12 +9,12 @@ import net.minecraft.world.item.DyeColor * The value was a naked iota without being Considered or Retrospected. */ class MishapUnescapedValue( - val perpetrator: LegacySpellDatum<*> + val perpetrator: Iota ) : Mishap() { override fun accentColor(ctx: CastingContext, errorCtx: Context): FrozenColorizer = dyeColor(DyeColor.GRAY) - override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList>) { + override fun execute(ctx: CastingContext, errorCtx: Context, stack: MutableList) { // TODO /* val idx = stack.indexOfLast { it.getType() == DatumType.LIST } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt index 8bdd53f7..470606bb 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockAxisRaycast.kt @@ -10,7 +10,7 @@ import net.minecraft.world.phys.Vec3 object OpBlockAxisRaycast : ConstManaOperator { override val argc = 2 override val manaCost = ManaConstants.DUST_UNIT / 100 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val origin: Vec3 = args.getChecked(0, argc) val look: Vec3 = args.getChecked(1, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt index 027222c8..d9b33ab6 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpBlockRaycast.kt @@ -10,7 +10,7 @@ import net.minecraft.world.phys.Vec3 object OpBlockRaycast : ConstManaOperator { override val argc = 2 override val manaCost = ManaConstants.DUST_UNIT / 100 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val origin: Vec3 = args.getChecked(0, argc) val look: Vec3 = args.getChecked(1, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityHeight.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityHeight.kt index a8c5f743..e572145c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityHeight.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityHeight.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -10,7 +10,7 @@ import net.minecraft.world.entity.Entity object OpEntityHeight : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val e: Entity = args.getChecked(0, argc) ctx.assertEntityInRange(e) return e.bbHeight.asSpellResult diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityLook.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityLook.kt index aadee9ae..e36d1644 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityLook.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityLook.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -10,7 +10,7 @@ import net.minecraft.world.entity.Entity object OpEntityLook : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val e: Entity = args.getChecked(0, argc) ctx.assertEntityInRange(e) return e.lookAngle.asSpellResult diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityPos.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityPos.kt index 1c1c52bf..78cd8f98 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityPos.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityPos.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ import net.minecraft.world.entity.player.Player object OpEntityPos : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val e: Entity = args.getChecked(0, argc) ctx.assertEntityInRange(e) // If this is a player, "expected behavior" is to get the *eye* position so raycasts don't immediately diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt index 45c01950..82b8a760 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityRaycast.kt @@ -10,7 +10,7 @@ import net.minecraft.world.phys.Vec3 object OpEntityRaycast : ConstManaOperator { override val argc = 2 override val manaCost = ManaConstants.DUST_UNIT / 100 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val origin: Vec3 = args.getChecked(0, argc) val look: Vec3 = args.getChecked(1, argc) val endp = Operator.raycastEnd(origin, look) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityVelocity.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityVelocity.kt index bb0f1b47..1ae59e9e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityVelocity.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpEntityVelocity.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -12,7 +12,7 @@ import net.minecraft.world.entity.Entity object OpEntityVelocity : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val e: Entity = args.getChecked(0, argc) ctx.assertEntityInRange(e) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpRead.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpRead.kt index 3d371db0..28ac6323 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpRead.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpRead.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapBadOffhandItem import at.petrak.hexcasting.xplat.IXplatAbstractions @@ -9,7 +9,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions object OpRead : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val (handStack, hand) = ctx.getHeldItemToOperateOn { val dataHolder = IXplatAbstractions.INSTANCE.findDataHolder(it) dataHolder != null && (dataHolder.readIota(ctx.world) != null || dataHolder.emptyIota() != null) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpReadable.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpReadable.kt index 374b0f2a..d9789b84 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpReadable.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpReadable.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.xplat.IXplatAbstractions @@ -9,7 +9,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions object OpReadable : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val (handStack) = ctx.getHeldItemToOperateOn { IXplatAbstractions.INSTANCE.findDataHolder(it) != null } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerRead.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerRead.kt index 9e0cb4e5..290ea068 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerRead.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerRead.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.mishaps.MishapBadItem @@ -12,9 +12,9 @@ object OpTheCoolerRead : ConstManaOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext - ): List> { + ): List { val target = args.getChecked(0, argc) ctx.assertEntityInRange(target) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerReadable.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerReadable.kt index 93626512..8188af97 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerReadable.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpTheCoolerReadable.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -12,9 +12,9 @@ object OpTheCoolerReadable : ConstManaOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext - ): List> { + ): List { val target = args.getChecked(0, argc) ctx.assertEntityInRange(target) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWritable.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWritable.kt index 5c1f509a..a8374af3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWritable.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWritable.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapOthersName @@ -10,7 +10,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions object OpWritable : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val datum = args[0] val (handStack) = ctx.getHeldItemToOperateOn { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWrite.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWrite.kt index 987bb34e..80acbd5d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWrite.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/OpWrite.kt @@ -1,6 +1,6 @@ package at.petrak.hexcasting.common.casting.operators -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell import at.petrak.hexcasting.api.spell.SpellOperator @@ -13,7 +13,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions object OpWrite : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val datum = args[0] @@ -41,7 +41,7 @@ object OpWrite : SpellOperator { ) } - private data class Spell(val datum: LegacySpellDatum<*>) : RenderedSpell { + private data class Spell(val datum: Iota) : RenderedSpell { override fun cast(ctx: CastingContext) { val (handStack) = ctx.getHeldItemToOperateOn { val datumHolder = IXplatAbstractions.INSTANCE.findDataHolder(it) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicRead.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicRead.kt index 4f8cd59f..a14e9afe 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicRead.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicRead.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.akashic import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -16,7 +16,7 @@ object OpAkashicRead : ConstManaOperator { override val argc = 2 override val manaCost = ManaConstants.DUST_UNIT - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val pos = args.getChecked(0, argc) val key = args.getChecked(1, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicWrite.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicWrite.kt index 2d0fdcba..b74c886e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicWrite.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/akashic/OpAkashicWrite.kt @@ -20,7 +20,7 @@ object OpAkashicWrite : SpellOperator { override val causesBlindDiversion = false override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val pos = args.getChecked(0, argc) @@ -46,7 +46,7 @@ object OpAkashicWrite : SpellOperator { ) } - private data class Spell(val record: BlockEntityAkashicRecord, val key: HexPattern, val datum: LegacySpellDatum<*>) : + private data class Spell(val record: BlockEntityAkashicRecord, val key: HexPattern, val datum: Iota) : RenderedSpell { override fun cast(ctx: CastingContext) { record.addNewDatum(key, datum) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpCircleBounds.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpCircleBounds.kt index 9fe358ca..dc19269c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpCircleBounds.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpCircleBounds.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.circles import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapNoSpellCircle @@ -10,7 +10,7 @@ import net.minecraft.world.phys.Vec3 class OpCircleBounds(val max: Boolean) : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { if (ctx.spellCircle == null) throw MishapNoSpellCircle() diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusDir.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusDir.kt index 22915b74..724fa28a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusDir.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusDir.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.circles import at.petrak.hexcasting.api.block.circle.BlockAbstractImpetus import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapNoSpellCircle @@ -10,7 +10,7 @@ import at.petrak.hexcasting.api.spell.mishaps.MishapNoSpellCircle object OpImpetusDir : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { if (ctx.spellCircle == null) throw MishapNoSpellCircle() diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusPos.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusPos.kt index 243d6878..377c2b6c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusPos.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/circles/OpImpetusPos.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.circles import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapNoSpellCircle @@ -10,7 +10,7 @@ import net.minecraft.world.phys.Vec3 object OpImpetusPos : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { if (ctx.spellCircle == null) throw MishapNoSpellCircle() diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEval.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEval.kt index 64dfc5c1..b672bde2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEval.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEval.kt @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.spell.casting.ContinuationFrame import at.petrak.hexcasting.api.spell.casting.SpellContinuation object OpEval : Operator { - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { val instrs: SpellList = stack.getChecked(stack.lastIndex) stack.removeLastOrNull() diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEvalDelay.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEvalDelay.kt index 20f4bfe4..a3a52f25 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEvalDelay.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpEvalDelay.kt @@ -2,12 +2,12 @@ package at.petrak.hexcasting.common.casting.operators.eval import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.SpellContinuation object OpEvalDelay : Operator { - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { return OperationResult(continuation, stack, local, listOf()) } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpForEach.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpForEach.kt index 76d3e193..4faa92b0 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpForEach.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpForEach.kt @@ -9,8 +9,8 @@ import at.petrak.hexcasting.api.spell.mishaps.MishapNotEnoughArgs object OpForEach : Operator { override fun operate( continuation: SpellContinuation, - stack: MutableList>, - local: LegacySpellDatum<*>, + stack: MutableList, + local: Iota, ctx: CastingContext ): OperationResult { if (stack.size < 2) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpHalt.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpHalt.kt index c73082af..f397c76e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpHalt.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/eval/OpHalt.kt @@ -1,6 +1,6 @@ package at.petrak.hexcasting.common.casting.operators.eval -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -9,8 +9,8 @@ import at.petrak.hexcasting.api.spell.casting.SpellContinuation object OpHalt : Operator { override fun operate( continuation: SpellContinuation, - stack: MutableList>, - local: LegacySpellDatum<*>, + stack: MutableList, + local: Iota, ctx: CastingContext ): OperationResult { var newStack = stack.toList() diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpAppend.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpAppend.kt index 2af98124..94997629 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpAppend.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpAppend.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpAppend : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc).toMutableList() val datum = args[1] list.add(datum) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpConcat.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpConcat.kt index 2d32126b..dec2e468 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpConcat.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpConcat.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpConcat : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = args.getChecked(0, argc).toMutableList() val rhs = args.getChecked(1, argc) lhs.addAll(rhs) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpCons.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpCons.kt index c3bc6eac..6d682d76 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpCons.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpCons.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpCons : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val bottom = args.getChecked(0, argc) val top = args[1] return SpellList.LPair(top, bottom).asSpellResult diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpEmptyList.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpEmptyList.kt index abcb213a..f34a25df 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpEmptyList.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpEmptyList.kt @@ -1,13 +1,13 @@ package at.petrak.hexcasting.common.casting.operators.lists import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext object OpEmptyList : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { - return emptyList>().asSpellResult // sorry for taking all the easy impls, hudeler + override fun execute(args: List, ctx: CastingContext): List { + return emptyList().asSpellResult // sorry for taking all the easy impls, hudeler } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndex.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndex.kt index e067b800..8a156cad 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndex.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndex.kt @@ -6,7 +6,7 @@ import kotlin.math.roundToInt object OpIndex : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc).toMutableList() val index = args.getChecked(1, argc) val x = list.getOrElse(index.roundToInt()) { LegacySpellDatum.make(Widget.NULL) } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndexOf.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndexOf.kt index c62c1832..7fe90693 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndexOf.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpIndexOf.kt @@ -7,7 +7,7 @@ object OpIndexOf : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc).toMutableList() val value = args[1] return list.indexOfFirst(value::tolerantEquals).asSpellResult diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpLastNToList.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpLastNToList.kt index 895f8dd2..64d92862 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpLastNToList.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpLastNToList.kt @@ -10,7 +10,7 @@ import kotlin.math.abs import kotlin.math.roundToInt object OpLastNToList : Operator { - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { if (stack.isEmpty()) throw MishapNotEnoughArgs(1, 0) val arg = stack.takeLast(1).getChecked(0) @@ -23,7 +23,7 @@ object OpLastNToList : Operator { "hexcasting.mishap.invalid_value.int.between".asTranslatedComponent(0, stack.size) ) } - val output = mutableListOf>() + val output = mutableListOf() output.addAll(stack.takeLast(arg.toInt())) val endSize = stack.size - output.toList().size while (stack.size != endSize) { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpListSize.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpListSize.kt index 6c37fb51..1bec1c9e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpListSize.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpListSize.kt @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext // it's still called beancounter's distillation in my heart object OpListSize : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return args.getChecked(0, argc).toList().size.asSpellResult // mmm one-liner } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpModifyInPlace.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpModifyInPlace.kt index a95b10a3..2279627a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpModifyInPlace.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpModifyInPlace.kt @@ -6,7 +6,7 @@ import kotlin.math.roundToInt object OpModifyInPlace : ConstManaOperator { override val argc = 3 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc) val index = args.getChecked(1, argc).roundToInt() val iota = args[2] diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpRemove.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpRemove.kt index d2605f1b..809d363c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpRemove.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpRemove.kt @@ -7,7 +7,7 @@ object OpRemove : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc).toMutableList() val index = args.getChecked(1, argc).toInt() if (index < 0 || index >= list.size) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpReverski.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpReverski.kt index cf3de86d..136f85d5 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpReverski.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpReverski.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpReverski : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return args.getChecked(0, argc).toList().asReversed().asSpellResult // okay kotlin kinda pogged for this } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSingleton.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSingleton.kt index 6d2404c4..4cb28c85 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSingleton.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSingleton.kt @@ -1,13 +1,13 @@ package at.petrak.hexcasting.common.casting.operators.lists import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext object OpSingleton : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return listOf(args[0]).asSpellResult // god i love one-liners } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSlice.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSlice.kt index 1458ad1f..9bd3eed0 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSlice.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSlice.kt @@ -9,13 +9,13 @@ import kotlin.math.roundToInt object OpSlice : ConstManaOperator { override val argc = 3 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc).toList() val index1 = Mth.clamp(args.getChecked(1, argc).roundToInt(), 0, list.size) val index2 = Mth.clamp(args.getChecked(2, argc).roundToInt(), 0, list.size) if (index1 == index2) - return emptyList>().asSpellResult + return emptyList().asSpellResult return list.subList(min(index1, index2), max(index1, index2)).asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSplat.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSplat.kt index 8908c2b2..76673e96 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSplat.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpSplat.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.lists import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.getChecked -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellList import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -10,6 +10,6 @@ object OpSplat : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> = + override fun execute(args: List, ctx: CastingContext): List = args.getChecked(0, argc).toMutableList() } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpUnCons.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpUnCons.kt index 0fa5eaad..b32a4d09 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpUnCons.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/lists/OpUnCons.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpUnCons : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val list = args.getChecked(0, argc) if (list.nonEmpty) { return spellListOf(list.cdr, list.car) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPeekLocal.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPeekLocal.kt index 448ad6e1..da31f75d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPeekLocal.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPeekLocal.kt @@ -2,15 +2,15 @@ package at.petrak.hexcasting.common.casting.operators.local import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.SpellContinuation object OpPeekLocal : Operator { override fun operate( continuation: SpellContinuation, - stack: MutableList>, - local: LegacySpellDatum<*>, + stack: MutableList, + local: Iota, ctx: CastingContext ): OperationResult { stack.add(local) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPushLocal.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPushLocal.kt index da7efbbb..379e29c0 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPushLocal.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/local/OpPushLocal.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.local import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapNotEnoughArgs import at.petrak.hexcasting.api.spell.casting.SpellContinuation @@ -10,8 +10,8 @@ import at.petrak.hexcasting.api.spell.casting.SpellContinuation object OpPushLocal : Operator { override fun operate( continuation: SpellContinuation, - stack: MutableList>, - local: LegacySpellDatum<*>, + stack: MutableList, + local: Iota, ctx: CastingContext ): OperationResult { if (stack.isEmpty()) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAbsLen.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAbsLen.kt index 1a12bbb5..391a9f44 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAbsLen.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAbsLen.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.numOrVec -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import kotlin.math.absoluteValue @@ -11,7 +11,7 @@ object OpAbsLen : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val x = numOrVec(args[0], 0) return x.map({ num -> num.absoluteValue }, { vec -> vec.length() }).asSpellResult diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAdd.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAdd.kt index 39d16205..bf99c9fe 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAdd.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpAdd.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.numOrVec -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.spellListOf @@ -10,7 +10,7 @@ object OpAdd : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = numOrVec(args[0], 1) val rhs = numOrVec(args[1], 0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCeil.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCeil.kt index 009c49a2..b7784c16 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCeil.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCeil.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ object OpCeil : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val value = args.getChecked(0, argc) return ceil(value).asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCoerceToAxial.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCoerceToAxial.kt index c310e239..81aeb59c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCoerceToAxial.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpCoerceToAxial.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -12,7 +12,7 @@ object OpCoerceToAxial : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val vec = args.getChecked(0, argc) if (vec == Vec3.ZERO) return vec.asSpellResult diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpConstructVec.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpConstructVec.kt index a7bf403d..39963b2b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpConstructVec.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpConstructVec.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -9,7 +9,7 @@ import net.minecraft.world.phys.Vec3 object OpConstructVec : ConstManaOperator { override val argc = 3 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val x = args.getChecked(0, argc) val y = args.getChecked(1, argc) val z = args.getChecked(2, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDeconstructVec.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDeconstructVec.kt index d69c2c3a..0b331576 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDeconstructVec.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDeconstructVec.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.spellListOf @@ -9,7 +9,7 @@ import net.minecraft.world.phys.Vec3 object OpDeconstructVec : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val v = args.getChecked(0, argc) return spellListOf(v.x, v.y, v.z) } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDivCross.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDivCross.kt index 2f11848e..b20ace24 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDivCross.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpDivCross.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.numOrVec -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapDivideByZero import at.petrak.hexcasting.api.spell.spellListOf @@ -12,7 +12,7 @@ object OpDivCross : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = numOrVec(args[0], 1) val rhs = numOrVec(args[1], 0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpFloor.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpFloor.kt index 8472fbb7..cca56977 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpFloor.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpFloor.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ object OpFloor : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val value = args.getChecked(0, argc) return floor(value).asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpLog.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpLog.kt index 7a036d78..3276d7ec 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpLog.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpLog.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -12,7 +12,7 @@ object OpLog : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val value = args.getChecked(0, argc) val base = args.getChecked(1, argc) if (value <= 0.0 || base <= 0.0 || base == 1.0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpModulo.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpModulo.kt index e5c1dd4a..7349c402 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpModulo.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpModulo.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ object OpModulo : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val l = args.getChecked(0, argc) val r = args.getChecked(1, argc) if (r == 0.0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpMulDot.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpMulDot.kt index c952fc94..fc04f02d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpMulDot.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpMulDot.kt @@ -3,14 +3,14 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.numOrVec import at.petrak.hexcasting.api.spell.spellListOf -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext object OpMulDot : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = numOrVec(args[0], 1) val rhs = numOrVec(args[1], 0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpPowProj.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpPowProj.kt index 4f916498..b044e7fa 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpPowProj.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpPowProj.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.numOrVec -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapDivideByZero import at.petrak.hexcasting.api.spell.spellListOf @@ -13,7 +13,7 @@ object OpPowProj : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = numOrVec(args[0], 1) val rhs = numOrVec(args[1], 0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpRandom.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpRandom.kt index 3c88e05c..5fcbdc0f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpRandom.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpRandom.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -9,7 +9,7 @@ object OpRandom : ConstManaOperator { override val argc: Int get() = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return ctx.world.random.nextDouble().asSpellResult } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpSub.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpSub.kt index 64bd528c..5b8eef9b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpSub.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/OpSub.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.math import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.numOrVec -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.spellListOf import net.minecraft.world.phys.Vec3 @@ -11,7 +11,7 @@ object OpSub : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = numOrVec(args[0], 1) val rhs = numOrVec(args[1], 0) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpAnd.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpAnd.kt index c9b00f7f..78e75806 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpAnd.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpAnd.kt @@ -7,7 +7,7 @@ import kotlin.math.roundToInt object OpAnd : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val firstParam = numOrList(args[0], 0) if (firstParam.right().isPresent) { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpNot.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpNot.kt index 6917b4d5..915511cc 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpNot.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpNot.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.bit import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -10,7 +10,7 @@ import kotlin.math.roundToInt object OpNot : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val num = args.getChecked(0, argc).roundToInt() return num.inv().asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpOr.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpOr.kt index 7640339f..97a57ba7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpOr.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpOr.kt @@ -7,7 +7,7 @@ import kotlin.math.roundToInt object OpOr : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val firstParam = numOrList(args[0], 0) if (firstParam.right().isPresent) { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpToSet.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpToSet.kt index f3ab4a15..723169f1 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpToSet.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpToSet.kt @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpToSet : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return args.getChecked(0, argc).toSet().toList().asSpellResult } } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpXor.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpXor.kt index 01f388d6..19777bf2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpXor.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/bit/OpXor.kt @@ -7,7 +7,7 @@ import kotlin.math.roundToInt object OpXor : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val firstParam = numOrList(args[0], 0) if (firstParam.right().isPresent) { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolAnd.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolAnd.kt index 22946066..e9ac134f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolAnd.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolAnd.kt @@ -1,14 +1,14 @@ package at.petrak.hexcasting.common.casting.operators.math.logic import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext object OpBoolAnd : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return listOf( if (args[0].payload == Widget.NULL) LegacySpellDatum.make(Widget.NULL) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolIdentityKindOf.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolIdentityKindOf.kt index cb140cfa..5683ce29 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolIdentityKindOf.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolIdentityKindOf.kt @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.spell.casting.CastingContext object OpBoolIdentityKindOf : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val payload = args[0].payload if (payload == Widget.NULL) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolNot.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolNot.kt index 7c4f93c6..16342bce 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolNot.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolNot.kt @@ -7,7 +7,7 @@ import net.minecraft.world.phys.Vec3 object OpBoolNot : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val payload = args[0].payload val falsy = payload == Widget.NULL || payload.tolerantEquals(0.0) || payload.tolerantEquals(Vec3.ZERO) || (payload is SpellList && !payload.nonEmpty) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolOr.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolOr.kt index 7e420455..61b0aeb5 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolOr.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolOr.kt @@ -1,14 +1,14 @@ package at.petrak.hexcasting.common.casting.operators.math.logic import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext object OpBoolOr : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return listOf( if (args[0].payload == Widget.NULL) args[1] diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolXor.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolXor.kt index cae0a83b..17215e48 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolXor.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpBoolXor.kt @@ -1,14 +1,14 @@ package at.petrak.hexcasting.common.casting.operators.math.logic import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.Widget import at.petrak.hexcasting.api.spell.casting.CastingContext object OpBoolXor : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { return listOf( if (args[0].payload != Widget.NULL && args[1].payload == Widget.NULL) args[0] diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpCompare.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpCompare.kt index 0577f300..a74386ca 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpCompare.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpCompare.kt @@ -7,7 +7,7 @@ import java.util.function.BiPredicate class OpCompare(val acceptsEqual: Boolean, val cmp: BiPredicate) : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = args.getChecked(0, argc) val rhs = args.getChecked(1, argc) if (lhs.tolerantEquals(rhs)) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpEquality.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpEquality.kt index 782816ea..01533a8e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpEquality.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/logic/OpEquality.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.logic import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.tolerantEquals @@ -9,7 +9,7 @@ import at.petrak.hexcasting.api.spell.tolerantEquals class OpEquality(val invert: Boolean) : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val lhs = args[0] val rhs = args[1] diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcCos.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcCos.kt index a0597fd3..55cbdcee 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcCos.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcCos.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.trig import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -13,7 +13,7 @@ object OpArcCos : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val value = args.getChecked(0, argc) if (value < -1 || value > 1) throw MishapInvalidIota( diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcSin.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcSin.kt index 76468f30..35a90aa2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcSin.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcSin.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.trig import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -13,7 +13,7 @@ object OpArcSin : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val value = args.getChecked(0, argc) if (value < -1 || value > 1) throw MishapInvalidIota( diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcTan.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcTan.kt index 38615522..f1806111 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcTan.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpArcTan.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.trig import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ object OpArcTan : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val value = args.getChecked(0, argc) return atan(value).asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpCos.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpCos.kt index 01885ce9..ce12d1d2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpCos.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpCos.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.trig import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ object OpCos : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val angle = args.getChecked(0, argc) return cos(angle).asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpSin.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpSin.kt index 18a6dc2b..a3f6e4d3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpSin.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpSin.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.trig import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -11,7 +11,7 @@ object OpSin : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val angle = args.getChecked(0, argc) return sin(angle).asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpTan.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpTan.kt index 7219d3d0..d1335d9e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpTan.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/math/trig/OpTan.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.math.trig import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -13,7 +13,7 @@ object OpTan : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val angle = args.getChecked(0, argc) if (cos(angle) == 0.0) throw MishapDivideByZero.tan(angle) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetCaster.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetCaster.kt index b153cab7..e1126ee7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetCaster.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetCaster.kt @@ -1,14 +1,14 @@ package at.petrak.hexcasting.common.casting.operators.selectors import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext object OpGetCaster : ConstManaOperator { override val argc = 0 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { ctx.assertEntityInRange(ctx.caster) return ctx.caster.asSpellResult } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntitiesBy.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntitiesBy.kt index 45a9999b..f4b0a804 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntitiesBy.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntitiesBy.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.selectors import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.Operator.Companion.MAX_DISTANCE -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.spellListOf @@ -20,7 +20,7 @@ import java.util.function.Predicate class OpGetEntitiesBy(val checker: Predicate, val negate: Boolean) : ConstManaOperator { override val argc = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val pos = args.getChecked(0, argc) val maybeRadius = args.getChecked(1, argc) ctx.assertVecInRange(pos) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntityAt.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntityAt.kt index 6b47ccd9..a2829fba 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntityAt.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/selectors/OpGetEntityAt.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.selectors import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -12,7 +12,7 @@ import java.util.function.Predicate class OpGetEntityAt(val checker: Predicate) : ConstManaOperator { override val argc = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val pos = args.getChecked(0, argc) ctx.assertVecInRange(pos) val aabb = AABB(pos.add(Vec3(-0.5, -0.5, -0.5)), pos.add(Vec3(0.5, 0.5, 0.5))) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpAddMotion.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpAddMotion.kt index a714dc1d..d42a8192 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpAddMotion.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpAddMotion.kt @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.world.entity.Entity @@ -15,7 +15,7 @@ object OpAddMotion : SpellOperator { get() = 2 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBeep.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBeep.kt index d8a7da0f..4a3c2e35 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBeep.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBeep.kt @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.common.network.MsgBeepAck @@ -16,7 +16,7 @@ object OpBeep : SpellOperator { override val argc = 3 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBlink.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBlink.kt index b6ef67ec..d2813c4b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBlink.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBlink.kt @@ -15,7 +15,7 @@ import kotlin.math.roundToInt object OpBlink : SpellOperator { override val argc = 2 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt index 96138479..03a67018 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpBreakBlock.kt @@ -13,7 +13,7 @@ object OpBreakBlock : SpellOperator { get() = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val pos = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpColorize.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpColorize.kt index 043c3a76..7d2dd3ca 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpColorize.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpColorize.kt @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.misc.FrozenColorizer import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapBadOffhandItem @@ -14,7 +14,7 @@ object OpColorize : SpellOperator { override val argc = 0 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val (handStack, hand) = ctx.getHeldItemToOperateOn(IXplatAbstractions.INSTANCE::isColorizer) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpConjure.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpConjure.kt index 56824369..487b7b47 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpConjure.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpConjure.kt @@ -16,7 +16,7 @@ import net.minecraft.world.phys.Vec3 class OpConjure(val light: Boolean) : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple>? { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpCreateWater.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpCreateWater.kt index 0be47437..324b8f3e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpCreateWater.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpCreateWater.kt @@ -18,7 +18,7 @@ import net.minecraft.world.phys.Vec3 object OpCreateWater : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpDestroyWater.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpDestroyWater.kt index ef85b5df..19fb4e22 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpDestroyWater.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpDestroyWater.kt @@ -20,7 +20,7 @@ import net.minecraft.world.phys.Vec3 object OpDestroyWater : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpEdifySapling.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpEdifySapling.kt index 065902a7..e4fa77e3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpEdifySapling.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpEdifySapling.kt @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapBadBlock @@ -17,7 +17,7 @@ object OpEdifySapling : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val pos = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpErase.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpErase.kt index 0988a569..e11d0b66 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpErase.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpErase.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.spells import at.petrak.hexcasting.api.misc.ManaConstants -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell import at.petrak.hexcasting.api.spell.SpellOperator @@ -13,7 +13,7 @@ class OpErase : SpellOperator { override val argc = 0 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val (handStack, hand) = ctx.getHeldItemToOperateOn { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExplode.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExplode.kt index 241460ec..7b5491ce 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExplode.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExplode.kt @@ -13,7 +13,7 @@ class OpExplode(val fire: Boolean) : SpellOperator { get() = 2 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val pos = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExtinguish.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExtinguish.kt index a16bc450..ed5777d2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExtinguish.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpExtinguish.kt @@ -19,7 +19,7 @@ import net.minecraft.world.phys.Vec3 object OpExtinguish : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpIgnite.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpIgnite.kt index c6154100..9b86e382 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpIgnite.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpIgnite.kt @@ -17,7 +17,7 @@ import net.minecraft.world.phys.Vec3 object OpIgnite : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakeBattery.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakeBattery.kt index f89340d2..15bb43b2 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakeBattery.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakeBattery.kt @@ -19,7 +19,7 @@ object OpMakeBattery : SpellOperator { override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val entity = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakePackagedSpell.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakePackagedSpell.kt index ae91f4cb..d5bfbdb7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakePackagedSpell.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpMakePackagedSpell.kt @@ -3,7 +3,7 @@ package at.petrak.hexcasting.common.casting.operators.spells import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellList import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -19,7 +19,7 @@ import net.minecraft.world.entity.item.ItemEntity class OpMakePackagedSpell(val itemType: T, val cost: Int) : SpellOperator { override val argc = 2 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val entity = args.getChecked(0, argc) @@ -56,7 +56,7 @@ class OpMakePackagedSpell(val itemType: T, val cost: Int) : return Triple(Spell(entity, patterns), cost, listOf(ParticleSpray.burst(entity.position(), 0.5))) } - private inner class Spell(val itemEntity: ItemEntity, val patterns: List>) : RenderedSpell { + private inner class Spell(val itemEntity: ItemEntity, val patterns: List) : RenderedSpell { override fun cast(ctx: CastingContext) { val (handStack) = ctx.getHeldItemToOperateOn { it.`is`(itemType) } val hexHolder = IXplatAbstractions.INSTANCE.findHexHolder(handStack) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPlaceBlock.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPlaceBlock.kt index 74d0c95c..17a39d8a 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPlaceBlock.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPlaceBlock.kt @@ -20,7 +20,7 @@ object OpPlaceBlock : SpellOperator { get() = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple>? { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt index 0219e5b1..84679576 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPotionEffect.kt @@ -20,7 +20,7 @@ class OpPotionEffect( get() = if (this.allowPotency) 3 else 2 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPrint.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPrint.kt index c560c012..3e11f304 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPrint.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpPrint.kt @@ -3,7 +3,7 @@ package at.petrak.hexcasting.common.casting.operators.spells import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.OperatorSideEffect import at.petrak.hexcasting.api.spell.casting.SpellContinuation @@ -11,7 +11,7 @@ import at.petrak.hexcasting.api.spell.mishaps.MishapNotEnoughArgs import net.minecraft.Util object OpPrint : Operator { - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { if (stack.isEmpty()) { throw MishapNotEnoughArgs(1, 0) } @@ -23,7 +23,7 @@ object OpPrint : Operator { ) } - private data class Spell(val datum: LegacySpellDatum<*>) : RenderedSpell { + private data class Spell(val datum: Iota) : RenderedSpell { override fun cast(ctx: CastingContext) { ctx.caster.sendMessage( datum.display(), diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpRecharge.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpRecharge.kt index 5c19595a..6cb86379 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpRecharge.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpRecharge.kt @@ -13,7 +13,7 @@ import net.minecraft.world.entity.item.ItemEntity object OpRecharge : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple>? { val (handStack, hand) = ctx.getHeldItemToOperateOn { diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpTheOnlyReasonAnyoneDownloadedPsi.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpTheOnlyReasonAnyoneDownloadedPsi.kt index b9c2805c..210d3ed1 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpTheOnlyReasonAnyoneDownloadedPsi.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/OpTheOnlyReasonAnyoneDownloadedPsi.kt @@ -16,7 +16,7 @@ import net.minecraft.world.phys.Vec3 object OpTheOnlyReasonAnyoneDownloadedPsi : SpellOperator { override val argc = 1 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpBrainsweep.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpBrainsweep.kt index 4dcab445..118e7861 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpBrainsweep.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpBrainsweep.kt @@ -23,7 +23,7 @@ object OpBrainsweep : SpellOperator { override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val sacrifice = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpCreateLava.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpCreateLava.kt index ae60ea2d..5b4ef2b1 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpCreateLava.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpCreateLava.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.xplat.IXplatAbstractions @@ -22,7 +22,7 @@ object OpCreateLava : SpellOperator { override val argc = 1 override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpFlight.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpFlight.kt index d2de2aad..91bfb41e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpFlight.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpFlight.kt @@ -15,7 +15,7 @@ object OpFlight : SpellOperator { override val argc = 3 override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpLightning.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpLightning.kt index 9a882a3b..79c07978 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpLightning.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpLightning.kt @@ -4,7 +4,7 @@ import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import net.minecraft.core.BlockPos @@ -17,7 +17,7 @@ object OpLightning : SpellOperator { override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpTeleport.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpTeleport.kt index 4d629b54..f875fbb7 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpTeleport.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpTeleport.kt @@ -15,7 +15,7 @@ object OpTeleport : SpellOperator { override val argc = 2 override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val teleportee = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpWeather.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpWeather.kt index 1d8ce396..afa6c722 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpWeather.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/great/OpWeather.kt @@ -3,7 +3,7 @@ package at.petrak.hexcasting.common.casting.operators.spells.great import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -12,7 +12,7 @@ class OpWeather(val rain: Boolean) : SpellOperator { override val isGreat = true override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple>? { if (ctx.world.isRaining == rain) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpCreateSentinel.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpCreateSentinel.kt index 9fd5bbd4..3a9668c3 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpCreateSentinel.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpCreateSentinel.kt @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.player.Sentinel import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.xplat.IXplatAbstractions @@ -17,7 +17,7 @@ class OpCreateSentinel(val extendsRange: Boolean) : SpellOperator { override val isGreat = this.extendsRange override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val target = args.getChecked(0, argc) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpDestroySentinel.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpDestroySentinel.kt index 6a215eb7..484f1dcf 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpDestroySentinel.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpDestroySentinel.kt @@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.player.Sentinel import at.petrak.hexcasting.api.spell.ParticleSpray import at.petrak.hexcasting.api.spell.RenderedSpell -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.SpellOperator import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapLocationInWrongDimension @@ -14,7 +14,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions object OpDestroySentinel : SpellOperator { override val argc = 0 override fun execute( - args: List>, + args: List, ctx: CastingContext ): Triple> { val particles = mutableListOf() diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelPos.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelPos.kt index 11ef3c2d..adc50a61 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelPos.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelPos.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.spells.sentinel import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.mishaps.MishapLocationInWrongDimension @@ -11,7 +11,7 @@ import at.petrak.hexcasting.xplat.IXplatAbstractions object OpGetSentinelPos : ConstManaOperator { override val argc = 0 override val manaCost = ManaConstants.DUST_UNIT / 10 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val sentinel = IXplatAbstractions.INSTANCE.getSentinel(ctx.caster) if (sentinel.dimension != ctx.world.dimension()) throw MishapLocationInWrongDimension(sentinel.dimension.location()) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelWayfind.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelWayfind.kt index c652f8d8..08754f9e 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelWayfind.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/spells/sentinel/OpGetSentinelWayfind.kt @@ -2,7 +2,7 @@ package at.petrak.hexcasting.common.casting.operators.spells.sentinel import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.asSpellResult import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked @@ -13,7 +13,7 @@ import net.minecraft.world.phys.Vec3 object OpGetSentinelWayfind : ConstManaOperator { override val argc = 1 override val manaCost = ManaConstants.DUST_UNIT / 10 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val from = args.getChecked(0, argc) val sentinel = IXplatAbstractions.INSTANCE.getSentinel(ctx.caster) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpAlwinfyHasAscendedToABeingOfPureMath.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpAlwinfyHasAscendedToABeingOfPureMath.kt index 307b984a..f7287382 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpAlwinfyHasAscendedToABeingOfPureMath.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpAlwinfyHasAscendedToABeingOfPureMath.kt @@ -3,7 +3,7 @@ package at.petrak.hexcasting.common.casting.operators.stack import at.petrak.hexcasting.api.misc.ManaConstants import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.OperatorSideEffect import at.petrak.hexcasting.api.spell.casting.SpellContinuation @@ -20,8 +20,8 @@ import kotlin.math.roundToInt object OpAlwinfyHasAscendedToABeingOfPureMath : Operator { override fun operate( continuation: SpellContinuation, - stack: MutableList>, - local: LegacySpellDatum<*>, + stack: MutableList, + local: Iota, ctx: CastingContext ): OperationResult { if (stack.isEmpty()) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicate.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicate.kt index ee11e82f..599057b5 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicate.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicate.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.stack import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.spellListOf @@ -10,7 +10,7 @@ object OpDuplicate : ConstManaOperator { override val argc: Int get() = 1 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val datum = args.getChecked(0, argc) return spellListOf(datum, datum) } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicateN.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicateN.kt index 2b995a05..0c1fd07f 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicateN.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpDuplicateN.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.stack import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.mishaps.MishapInvalidIota @@ -13,7 +13,7 @@ object OpDuplicateN : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val countDouble = args.getChecked(1, argc) if (abs(countDouble.roundToInt() - countDouble) >= 0.05f) @@ -25,7 +25,7 @@ object OpDuplicateN : ConstManaOperator { val count = countDouble.roundToInt() // there's gotta be a better way to do this - val out = mutableListOf>() + val out = mutableListOf() for (n in 0 until count) out.add(args[0]) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt index b4b9d9d5..0c2daaaf 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt @@ -1,6 +1,6 @@ package at.petrak.hexcasting.common.casting.operators.stack -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator import at.petrak.hexcasting.api.spell.casting.CastingContext @@ -15,8 +15,8 @@ import kotlin.math.roundToInt object OpFisherman : Operator { override fun operate( continuation: SpellContinuation, - stack: MutableList>, - local: LegacySpellDatum<*>, + stack: MutableList, + local: Iota, ctx: CastingContext ): OperationResult { if (stack.size < 2) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpMask.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpMask.kt index a9a1ae6e..2f2b6052 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpMask.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpMask.kt @@ -1,7 +1,7 @@ package at.petrak.hexcasting.common.casting.operators.stack import at.petrak.hexcasting.api.spell.ConstManaOperator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import it.unimi.dsi.fastutil.booleans.BooleanList @@ -9,8 +9,8 @@ class OpMask(val mask: BooleanList) : ConstManaOperator { override val argc: Int get() = mask.size - override fun execute(args: List>, ctx: CastingContext): List> { - val out = ArrayList>(this.mask.size) + override fun execute(args: List, ctx: CastingContext): List { + val out = ArrayList(this.mask.size) for ((i, include) in this.mask.withIndex()) { if (include) out.add(args[i]) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpStackSize.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpStackSize.kt index 66169112..3a2fc109 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpStackSize.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpStackSize.kt @@ -2,12 +2,12 @@ package at.petrak.hexcasting.common.casting.operators.stack import at.petrak.hexcasting.api.spell.OperationResult import at.petrak.hexcasting.api.spell.Operator -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext import at.petrak.hexcasting.api.spell.casting.SpellContinuation object OpStackSize : Operator { - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: LegacySpellDatum<*>, ctx: CastingContext): OperationResult { + override fun operate(continuation: SpellContinuation, stack: MutableList, local: Iota, ctx: CastingContext): OperationResult { stack.add(LegacySpellDatum.make(stack.size.toDouble())) return OperationResult(continuation, stack, local, listOf()) } diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpSwap.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpSwap.kt index aa396f3d..a04a414b 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpSwap.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpSwap.kt @@ -3,14 +3,14 @@ package at.petrak.hexcasting.common.casting.operators.stack import at.petrak.hexcasting.api.spell.ConstManaOperator import at.petrak.hexcasting.api.spell.getChecked import at.petrak.hexcasting.api.spell.spellListOf -import at.petrak.hexcasting.api.spell.LegacySpellDatum +import at.petrak.hexcasting.api.spell.iota.Iota import at.petrak.hexcasting.api.spell.casting.CastingContext object OpSwap : ConstManaOperator { override val argc: Int get() = 2 - override fun execute(args: List>, ctx: CastingContext): List> { + override fun execute(args: List, ctx: CastingContext): List { val a = args.getChecked(0, argc) val b = args.getChecked(1, argc) return spellListOf(b, a)