Skip to content

Commit 80e6929

Browse files
committed
Change MishapInvalidIota type lang to use the full namespaced ID of the iota
1 parent 720c027 commit 80e6929

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ class MishapInvalidIota(
2525
}
2626

2727
override fun errorMessage(ctx: CastingEnvironment, errorCtx: Context): Component? {
28-
val typeStr = HexIotaTypes.REGISTRY.getKey(perpetrator.getType())?.getPath();
29-
val typeComp = Component.translatable("hexcasting.mishap.invalid_value.class.${typeStr}")
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+
)
3033
return error(
3134
"invalid_value", expected, reverseIdx,
32-
typeComp, perpetrator.display()
35+
perpDesc, perpetrator.display()
3336
)
3437
}
3538

Common/src/main/resources/assets/hexcasting/lang/en_us.flatten.json5

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -960,16 +960,44 @@
960960
escape: "Consideration",
961961
undo: "Evanition",
962962
},
963-
963+
964964
"iota.hexcasting:": {
965-
"null": "Null",
966-
double: "Number",
967-
boolean: "Boolean",
968-
entity: "Entity",
969-
list: "List",
970-
pattern: "Pattern",
971-
garbage: "Garbage",
972-
vec3: "Vector",
965+
null: {
966+
"": "Null",
967+
desc: "a null value",
968+
},
969+
double: {
970+
"": "Number",
971+
desc: "a number",
972+
},
973+
boolean: {
974+
"": "Boolean",
975+
desc: "a boolean",
976+
},
977+
entity: {
978+
"": "Entity",
979+
desc: "an entity",
980+
},
981+
list: {
982+
"": "List",
983+
desc: "a list",
984+
},
985+
pattern: {
986+
"": "Pattern",
987+
desc: "a pattern",
988+
},
989+
garbage: {
990+
"": "Garbage",
991+
desc: "garbage",
992+
},
993+
vec3: {
994+
"": "Vector",
995+
desc: "a vector",
996+
},
997+
continution: {
998+
"": "Continuation",
999+
desc: "a jump iota",
1000+
},
9731001
},
9741002

9751003
mishap: {
@@ -1026,6 +1054,7 @@
10261054

10271055
invalid_value: {
10281056
"": "expected %s at index %s of the stack, but got %s: %s",
1057+
no_perp_desc: "expected %s at index %s of the stack, but got %s",
10291058

10301059
class: {
10311060
double: "a number",

0 commit comments

Comments
 (0)