Platform.getGameFolder() returns a different path on a Fabric Server than it does the Fabric Client and Forge Client & Server.
Vaelzan opened this issue ยท 1 comments
This is using Architectury 3.7.22, verified with the latest Architectury Template. It has the impact of causing KubeJS to fail when running JsonIO.read(...) on a server, which is breaking a number of scripts that I've recently written.
When running Platform.getGameFolder()
on a Fabric server, an additional trailing \.
is returned at the end of the path, whereas with the Fabric client, and both Forge client & server this isn't the case. This can be fixed by adding .normalize()
to the end of this line:
My tests:
Fabric Client: D:\Gamedev\Projects\2022\Minecraft\architectury-testing\fabric\run
Fabric Server: D:\Gamedev\Projects\2022\Minecraft\architectury-testing\fabric\run\.
Forge Client: D:\Gamedev\Projects\2022\Minecraft\architectury-testing\forge\run
Forge Server: D:\Gamedev\Projects\2022\Minecraft\architectury-testing\forge\run