-
Bug
-
Resolution: Invalid
-
None
-
Minecraft 1.11.2, Minecraft 1.12
-
OS: Windows 7
-
Confirmed
-
(Unassigned)
Based on 1.11.2 decompiled using MCP 9.35 rc1
The bug
Some file opening methods do not work when Minecraft is launched with a gameDir containing dots.
Affected situations
List might be incomplete
Last updated for 1.11.2
- opening screenshots (net.minecraft.util.ScreenShotHelper.saveScreenshot(File, String, int, int, Framebuffer))
- opening crash reports
- net.minecraft.client.Minecraft.displayCrashReport(CrashReport)
- net.minecraft.server.MinecraftServer.run()
- parts of realms (?) (net.minecraft.realms.Realms.getGameDirectoryPath())
How to reproduce (old Java launcher)
- Create a profile with the following game directory
./game-data
- Start Minecraft with the profile
- Take a screenshot and try to open it by clicking on the message in chat
→ The file is not opened
Additionally something like the following will appear in the Game Output of your launcher:
20:02:05] [Client thread/ERROR]: Couldn't open link: Failed to open file:/LAUNCHER_PATH/./game-data/screenshots/2017-02-04_19.58.40.png. Error message: The system cannot find the file specified.
Code analysis
This happens because the affected methods call the method java.io.File.getAbsolutePath() for the screenshot file path which does not resolve dots. Instead the method java.io.File.getCanonicalPath() could be used.
- is duplicated by
-
MC-117793 When creating a screenshot the clickable link in chat doesn't work
- Resolved