[1.16.5, 1.18.2] Item / Formatters section in ore presents doesn't work
MundM2007 opened this issue ยท 9 comments
Describe the bug
if wanting to overwrite the Name of a Ore using the formatters section, it will not work and it will give the item no name.
To Reproduce
- add this piece of text to the coal ore configuration file (for 1.16 add quotation marks before the double point in the 3rd line)
item: {
formatters: {
: [
{
text: '{fg} Ore ({bg})'
}
]
}
}
(indents have been removed for some reason) - make sure the ore is active in the common config
- start the game
- see the item name
Expected behavior
that it shows the correct text, not none
Versions:
- Ore Stone Variants Version: Newest
- Forge Version: 36.2.39 / 40.2.0
Additional context
for minecraft version 1.18, the coal ore preset (txt, because github doesn't support xjs):
coal_ore.txt
The syntax is definitely invalid for 1.16.5, but my guess is that there's some kind of parser error. I also wrote the xjs parser and it's still in pre-release. The version used by OSV is quite old at this point. will be updated in the next couple of weeks.
Also @MundM2007 to include indentation in your description, use a code block, like this:
```
code here, indentation preserved
```
Reason i didn't use a code block, was because then everything was on one line for some reason
The complete file for 1.16 i have posted here:
coal_ore.txt
(Sorry for late response, txt again, because not supported)
Hey, sorry this took so long to look at. Have hit some milestones on other projects, mostly recovered from surgery, and am looking into this now. It looks like the component schema I wrote is working, but it doesn't work as a blockstate map. No idea why, but will update here when I find out.
This was caused by the fact that two possible codecs exist for these formatters:
- one for the map of variant -> formatters
- one for just formatters
The issue was that the second codec was always valid. I fixed this by changing the priority of the codecs, so it will default to just formatters if we don't have a map. This might technically mean that we effectively only have the first schema now, but I'm not super concerned. Will include these changes in the next release.
Edit:
a second solution is to require the use of an array for the RHS value. this way, we have the following logic:
- user types an object -> it's a state map
- user types an array -> it's an array of formatters for the default state (
""
)
I will most likely use this instead since it fixes the ambiguity, which was the actual problem
Hey, Just wanted to ask if you will fix this for 1.16.5 aswell? or are you finished with that version?