Merge remote-tracking branch 'architectury/1.18' into 1.18.2

This commit is contained in:
shedaniel
2022-03-02 10:21:31 +08:00
2 changed files with 11 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ public final class Platform {
/**
* Gets the root directory for the current instance of Minecraft.
* <p>
* The returned path is guaranteed to be <b>absolute</b>.
* The returned path is guaranteed to be <b>absolute</b> and <b>normalized</b>.
*/
@ExpectPlatform
public static Path getGameFolder() {
@@ -75,7 +75,7 @@ public final class Platform {
/**
* Gets the main <code>config</code> folder for the current instance of Minecraft.
* <p>
* The returned path is guaranteed to be <b>absolute</b>.
* The returned path is guaranteed to be <b>absolute</b> and <b>normalized</b>.
*/
@ExpectPlatform
public static Path getConfigFolder() {
@@ -85,7 +85,7 @@ public final class Platform {
/**
* Gets the <code>mods</code> folder of the current instance of Minecraft.
* <p>
* The returned path is guaranteed to be <b>absolute</b>.
* The returned path is guaranteed to be <b>absolute</b> and <b>normalized</b>.
*/
@ExpectPlatform
public static Path getModsFolder() {

View File

@@ -41,11 +41,17 @@ public class PlatformImpl {
private static final Map<String, Mod> mods = new ConcurrentHashMap<>();
public static Path getGameFolder() {
return FabricLoader.getInstance().getGameDir().toAbsolutePath();
return FabricLoader.getInstance()
.getGameDir()
.toAbsolutePath()
.normalize();
}
public static Path getConfigFolder() {
return FabricLoader.getInstance().getConfigDir().toAbsolutePath();
return FabricLoader.getInstance()
.getConfigDir()
.toAbsolutePath()
.normalize();
}
public static Path getModsFolder() {