PersonTheCat / OreStoneVariants

A powerful utility for generating new blocks when given a foreground and background.
GNU General Public License v3.0
6 stars 8 forks source link

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

Open MundM2007 opened 1 year ago

MundM2007 commented 1 year ago

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:

Additional context for minecraft version 1.18, the coal ore preset (txt, because github doesn't support xjs): coal_ore.txt

PersonTheCat commented 1 year ago

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.

PersonTheCat commented 1 year ago

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

MundM2007 commented 1 year ago

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)

PersonTheCat commented 1 year ago

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.

PersonTheCat commented 1 year ago

This was caused by the fact that two possible codecs exist for these 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:

I will most likely use this instead since it fixes the ambiguity, which was the actual problem

MundM2007 commented 1 year ago

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

PersonTheCat commented 1 year ago

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

MundM2007 commented 1 year ago

np, all good!

MundM2007 commented 7 months ago

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