GregoryAM-SP / The-Minecraft-Overviewer

The Minecraft Overviewer | Successor
https://overviewer.gregoryam.com
GNU General Public License v3.0
88 stars 12 forks source link

fix: add new attributs sign if old format #13

Closed johann-lecocq closed 7 months ago

johann-lecocq commented 1 year ago

It's a fix to manage sign in version 1.20.X and lower.

I updated my config to manage the new configuration (front/back) of the signs as below.

{
    'back_text': {'has_glowing_text': 0, 'color': 'black', 'messages': ['', '', '', '']},
    'front_text': {'has_glowing_text': 0, 'color': 'black', 'messages': ['$z:v:0:1:2', '', '', '']},
    'keepPacked': 0, 'is_waxed': 0, 'x': -381, 'y': 62, 'z': -372, 'id': 'minecraft:sign',
}

But on my map, I haven't visited all chunk since upgrading to 1.20.X, many sign have not front_text value.

I added a code to manage signs in the old format.

Before

{
    'id': 'minecraft:sign', 'keepPacked': 0, 'x': -381, 'y': 62, 'z': -372,
    'Color': 'black', 'GlowingText': 0, 
    'Text1': '$z:v:0:1:2', 'Text2': '', 'Text3': '', 'Text4': ''
}

After

{
    'back_text': {'has_glowing_text': 0, 'color': 'black', 'messages': ['', '', '', '']},
    'front_text': {'has_glowing_text': 0, 'color': 'black', 'messages': ['$z:v:0:1:2', '', '', '']},
    'keepPacked': 0, 'is_waxed': 0, 'x': -381, 'y': 62, 'z': -372, 'id': 'minecraft:sign',
    'Text1': '$z:v:0:1:2', 'Text2': '', 'Text3': '', 'Text4': ''
}
Gregory-AM commented 1 year ago

I'll be adding this to the project tonight. Thank you for the updated code.

I didn't think to add waxed or glowing text.

Gregory-AM commented 1 year ago

@johann-lecocq, I forgot about this. In your Configuration, how do you have this set up? I remember when I added the options into the configuration it was a bit different after updating it to work with backwards compatibility and 1.20.

since this is new, how would the config look?