supsm/MCPPPP

Parsing issues with FSB conversion

Closed this issue · 5 comments

I'm trying to convert a Optifine skybox resource pack to FabricSkyBoxes format. I'm getting problems:

  • paths featuring an extra . mess up the process resulting in blank .png files and hence a non-working conversion.
  • \r appearing out of nowhere
  • not sure the time conversion is right

OS: Ubuntu 20.04, MC: 1.19, MCPPPP: 0.7.2 (latest release as of this time)

Filename issues

The following line seems to be an issue in the .properties file:
source=./sky_box.png

Because it generates this warning in the log:
[11:29:38] (warn) FSB: File not found: /home/[...]/assets/minecraft/optifine/sky/world0/sky_box..png
which obviously won't exist.

It then generates names like this in the .json file:
"bottom": "fabricskyboxes:sky/sky_box._bottom.png",
plus an empty (72b) sky_box._bottom.png file.

Something tells me that the parsing issue is showing up here, and it shouldn't have that extra . before the underscore either. Perhaps an unsuffix is busted in fsb.cpp? With all the encoding back-and-forth it's a bit hard to tell.

I tried this with another resource pack, https://www.curseforge.com/minecraft/texture-packs/dramatic-skys and got the same filename issues.

Extra \r

That same file has:
blend=add
which gets converted to:

	"blend": {
		"type": "add\r"
	},

This may be related to incorrectly parsing line endings under Linux. The .properties files presumably came from a windows system and hence have DOS line endings.

Time conversion

The pack says:
endFadeIn=6\:00 (which is either 0 or 24000 in minecraft time)
but comes out as:
"endFadeIn": 19000 (which is 1:00)

In "dramatic skys", sky1.properties says:
startFadeIn=18:00 (which would be 12000 in minecraft time)
but comes out as:
"startFadeIn": 20333

Something is odd here.

supsm commented

The line ending and CR issues should have been fixed in some commit (but unreleased). Binaries can be downloaded from github actions. As for the second issue, I will investigate and let you know in a couple of minutes (hopefully).

supsm commented

By the way, thanks for the bug report

supsm commented

I think the second issue might also be fixed, please try and let me know.

I checked out the version from github actions. You are correct, these issues have been fixed. Checked the time conversion as well, and it looks fine. I feel rather silly, apologies, and thank you for investigating.

Perhaps you could be persuaded to release a new version for the next person trying to have skyboxes on fabric?

supsm commented

It is published, I forgot that I had made changes other than the web converter 😅