File tree Expand file tree Collapse file tree 2 files changed +47
-12
lines changed
java/at/petrak/hexcasting/api/casting/mishaps
resources/assets/hexcasting/lang Expand file tree Collapse file tree 2 files changed +47
-12
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import at.petrak.hexcasting.api.casting.iota.GarbageIota
55import at.petrak.hexcasting.api.casting.iota.Iota
66import at.petrak.hexcasting.api.pigment.FrozenPigment
77import at.petrak.hexcasting.api.utils.asTranslatedComponent
8+ import at.petrak.hexcasting.common.lib.hex.HexIotaTypes
89import net.minecraft.network.chat.Component
910import net.minecraft.world.item.DyeColor
1011
@@ -23,11 +24,17 @@ class MishapInvalidIota(
2324 stack[stack.size - 1 - reverseIdx] = GarbageIota ();
2425 }
2526
26- override fun errorMessage (ctx : CastingEnvironment , errorCtx : Context ) =
27- error(
27+ override fun errorMessage (ctx : CastingEnvironment , errorCtx : Context ): Component ? {
28+ val perpKey = HexIotaTypes .REGISTRY .getKey(perpetrator.getType())
29+ val perpDesc = Component .translatableWithFallback(
30+ " hexcasting.iota.${perpKey} .desc" ,
31+ " hexcasting.mishap.invalid_value.class.${perpKey?.getPath()} "
32+ )
33+ return error(
2834 " invalid_value" , expected, reverseIdx,
29- perpetrator.display()
35+ perpDesc, perpetrator.display()
3036 )
37+ }
3138
3239 companion object {
3340 @JvmStatic
Original file line number Diff line number Diff line change 971971 } ,
972972
973973 "iota.hexcasting:" : {
974- "null" : "Null" ,
975- double : "Number" ,
976- boolean : "Boolean" ,
977- entity : "Entity" ,
978- list : "List" ,
979- pattern : "Pattern" ,
980- garbage : "Garbage" ,
981- vec3 : "Vector" ,
974+ null : {
975+ "" : "Null" ,
976+ desc : "a null value" ,
977+ } ,
978+ double : {
979+ "" : "Number" ,
980+ desc : "a number" ,
981+ } ,
982+ boolean : {
983+ "" : "Boolean" ,
984+ desc : "a boolean" ,
985+ } ,
986+ entity : {
987+ "" : "Entity" ,
988+ desc : "an entity" ,
989+ } ,
990+ list : {
991+ "" : "List" ,
992+ desc : "a list" ,
993+ } ,
994+ pattern : {
995+ "" : "Pattern" ,
996+ desc : "a pattern" ,
997+ } ,
998+ garbage : {
999+ "" : "Garbage" ,
1000+ desc : "garbage" ,
1001+ } ,
1002+ vec3 : {
1003+ "" : "Vector" ,
1004+ desc : "a vector" ,
1005+ } ,
1006+ continution : {
1007+ "" : "Continuation" ,
1008+ desc : "a jump iota" ,
1009+ } ,
9821010 } ,
9831011
9841012 mishap : {
10351063 bad_caster : "Tried to execute a pattern that requires a greater mind" ,
10361064
10371065 invalid_value : {
1038- "" : "expected %s at index %s of the stack, but got %s" ,
1066+ "" : "expected %s at index %s of the stack, but got %s: %s " ,
10391067
10401068 class : {
10411069 double : "a number" ,
You can’t perform that action at this time.
0 commit comments