"empty" is clearer than "0 tall"

This commit is contained in:
yrsegal@gmail.com 2022-09-30 22:23:45 -04:00
parent c3184afb28
commit 051a334e85
2 changed files with 8 additions and 5 deletions

View file

@ -1,10 +1,9 @@
package at.petrak.hexcasting.api.spell.mishaps
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.api.spell.Widget
import at.petrak.hexcasting.api.misc.FrozenColorizer
import net.minecraft.network.chat.Component
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.api.spell.Widget
import at.petrak.hexcasting.api.spell.casting.CastingContext
import net.minecraft.world.item.DyeColor
class MishapNotEnoughArgs(val expected: Int, val got: Int) : Mishap() {
@ -17,5 +16,8 @@ class MishapNotEnoughArgs(val expected: Int, val got: Int) : Mishap() {
}
override fun errorMessage(ctx: CastingContext, errorCtx: Context) =
error("not_enough_args", actionName(errorCtx.action), expected, got)
if (got == 0)
error("no_args", actionName(errorCtx.action), expected)
else
error("not_enough_args", actionName(errorCtx.action), expected, got)
}

View file

@ -426,6 +426,7 @@
"hexcasting.mishap.invalid_value.int.between": "an integer between %d and %d",
"hexcasting.mishap.invalid_value.evaluatable": "something evaluatable",
"hexcasting.mishap.not_enough_args": "%s expected %s or more arguments but the stack was only %s tall",
"hexcasting.mishap.no_args": "%s expected %s or more arguments but the stack was empty",
"hexcasting.mishap.too_many_close_parens": "Used Retrospection without first using Introspection",
"hexcasting.mishap.location_too_far": "%s is out of range for %s",
"hexcasting.mishap.location_out_of_world": "%s is not within the world",