Revert "Fix error message thrown by getChecked"

This reverts commit 608c336cb8.
This commit is contained in:
Hudeler 2022-02-05 08:17:20 +01:00
parent 608c336cb8
commit cb6e1d6a21

View file

@ -3,7 +3,6 @@ package at.petrak.hexcasting.api
import at.petrak.hexcasting.common.casting.CastException
import at.petrak.hexcasting.common.casting.CastingContext
import net.minecraft.world.phys.Vec3
import kotlin.math.abs
/**
* Manipulates the stack in some way, usually by popping some number of values off the stack
@ -44,7 +43,7 @@ interface Operator {
*/
@JvmStatic
inline fun <reified T : Any> List<SpellDatum<*>>.getChecked(idx: Int): T {
val x = this.getOrElse(idx) { throw CastException(CastException.Reason.NOT_ENOUGH_ARGS, abs(idx), this.size) }
val x = this.getOrElse(idx) { throw CastException(CastException.Reason.NOT_ENOUGH_ARGS, idx, this.size) }
return x.tryGet()
}