HexCasting/Common/src/main/java/at/petrak/hexcasting/api/casting/mishaps/MishapInvalidSpellDatumType.kt

22 lines
783 B
Kotlin
Raw Normal View History

package at.petrak.hexcasting.api.casting.mishaps
2022-03-26 07:01:44 +01:00
2023-01-22 03:29:09 +01:00
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.pigment.FrozenPigment
2022-03-26 07:01:44 +01:00
import net.minecraft.world.item.DyeColor
/**
* this is bad
*/
2022-03-26 07:01:44 +01:00
class MishapInvalidSpellDatumType(val perpetrator: Any) : Mishap() {
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
2022-03-26 07:01:44 +01:00
dyeColor(DyeColor.BLACK)
2023-01-22 03:29:09 +01:00
override fun execute(ctx: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
2022-05-25 22:34:46 +02:00
// NO-OP
2022-03-26 07:01:44 +01:00
}
2023-01-22 03:29:09 +01:00
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context) =
2022-03-26 07:01:44 +01:00
error("invalid_spell_datum_type", this.perpetrator.toString(), this.perpetrator.javaClass.typeName)
2022-04-12 21:13:51 +02:00
}