lambda-client / lambda

Minecraft utility mod coded in Kotlin
GNU Lesser General Public License v3.0
579 stars 145 forks source link

Map downloader bugged #569

Closed jaer3221 closed 11 months ago

jaer3221 commented 1 year ago

Describe the bug Map downloader module doesn't download maps with special characters in map name

Steps to reproduce the bug

  1. Have map name with any special character (\, |, /, :,*, ?, ", <, > ) in your inventory
  2. Activate MapDownloader module
  3. Map is not present in /lambda/map-images folder
  4. Minecraft console logs java.io.FileNotFoundException

Expected behavior Map should apear in the folder named with no special character in its name

Debug info the ;tsc command doesn't work after the bug occurs (probably something u guys have to look into also) but here it is the same command right before the bug is replicated: image

Additional context / media The bug is actually pretty easy to fix. Just add ".replace("char", "_")" in "src/main/kotlin/com/lambda/client/module/modules/misc/MapDownloader.kt", where char is a special character (\, |, /, :,*, ?, ", <, > ). This could be done better just by turning the string into an ASCII or just using a good regular expression.