emortalmc / TNT

TNT is an experimental world format for Minestom
MIT License
32 stars 3 forks source link

Convert MCA (Anvil) to TNT fails on backup region files #2

Closed TropicalShadow closed 1 year ago

TropicalShadow commented 2 years ago

This isn't a major issue, but I found a issue while converting an Anvil world it threw an error

Unexpected exception thrown: java.lang.NumberFormatException: For input string: "mca"

I found that it was trying to read r.0.0.mca.2710657221739100675.backup This line here reads the last two items in the array... which from the backup file is ["mca", "2710657221739100675"]

My suggestion to fix it would be Replace val args = it.nameWithoutExtension.split(".").takeLast(2) with

MrlnHi commented 2 years ago

PR your suggestion maybe

TropicalShadow commented 2 years ago

PR your suggestion maybe

I was going to but as there are many different ways to resolve this issue I couldn’t figure out which was the best, so I thought the repo owner may have more knowledge and is able to choose the correct result.

emortaldev commented 1 year ago

Turns out this was fixed in 723cb52!