2023-01-20 20:27:35 +01:00
|
|
|
package at.petrak.hexcasting.api.casting.mishaps
|
2022-04-16 22:33:55 +02:00
|
|
|
|
2023-01-22 03:29:09 +01:00
|
|
|
import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
|
2023-01-20 20:27:35 +01:00
|
|
|
import at.petrak.hexcasting.api.casting.eval.ResolvedPatternType
|
|
|
|
import at.petrak.hexcasting.api.casting.iota.Iota
|
2023-04-27 21:26:15 +02:00
|
|
|
import at.petrak.hexcasting.api.pigment.FrozenPigment
|
2022-04-16 22:33:55 +02:00
|
|
|
import net.minecraft.world.item.DyeColor
|
|
|
|
|
2022-06-01 02:02:56 +02:00
|
|
|
class MishapDisallowedSpell(val type: String = "disallowed") : Mishap() {
|
2023-04-27 21:26:15 +02:00
|
|
|
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
|
2022-04-16 22:33:55 +02:00
|
|
|
dyeColor(DyeColor.BLACK)
|
|
|
|
|
2023-01-22 03:29:09 +01:00
|
|
|
override fun resolutionType(ctx: CastingEnvironment) = ResolvedPatternType.INVALID
|
2022-05-22 22:56:58 +02:00
|
|
|
|
2023-01-22 03:29:09 +01:00
|
|
|
override fun execute(ctx: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
|
2022-05-22 22:56:58 +02:00
|
|
|
// NO-OP
|
2022-04-16 22:33:55 +02:00
|
|
|
}
|
|
|
|
|
2023-01-22 03:29:09 +01:00
|
|
|
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context) =
|
2023-01-20 20:27:35 +01:00
|
|
|
error(type)
|
2022-05-22 22:56:58 +02:00
|
|
|
}
|