Ore Stone Variants

Ore Stone Variants

1M Downloads

[1.16.5, 1.18.2] Item / Formatters section in ore presents doesn't work

MundM2007 opened this issue ยท 9 comments

commented

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

  1. 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)
  2. make sure the ore is active in the common config
  3. start the game
  4. see the item name

Expected behavior
that it shows the correct text, not none

Screenshots
image

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

commented

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.

commented

Also @MundM2007 to include indentation in your description, use a code block, like this:
```
code here, indentation preserved
```

commented

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)

commented

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.

commented

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

commented

Hey, Just wanted to ask if you will fix this for 1.16.5 aswell? or are you finished with that version?

commented

Hey! Sorry, I'm just seeing this. I'll take a look soon.

commented

np, all good!

commented

Sorry for annoying you again, but what's you Definition of soon Here xd?