From 972a6932b27c317efae6be1279220034b5962371 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 18 Feb 2024 22:51:21 +0100 Subject: [PATCH] Fixed platform loading Closes https://github.com/ViaVersion/VIAaaS/issues/237 --- .../com/viaversion/aas/platform/AspirinAprilFools.java | 5 +++-- .../com/viaversion/aas/platform/AspirinBackwards.java | 5 +++-- .../java/com/viaversion/aas/platform/AspirinLegacy.java | 4 ++-- .../java/com/viaversion/aas/platform/AspirinRewind.java | 8 +++++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/viaversion/aas/platform/AspirinAprilFools.java b/src/main/java/com/viaversion/aas/platform/AspirinAprilFools.java index f0151df..2e217e9 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinAprilFools.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinAprilFools.java @@ -1,5 +1,6 @@ package com.viaversion.aas.platform; +import com.viaversion.viaversion.api.Via; import net.raphimc.viaaprilfools.platform.ViaAprilFoolsPlatform; import java.io.File; @@ -13,11 +14,11 @@ public class AspirinAprilFools implements ViaAprilFoolsPlatform { } public void init() { - init(new File("config/viaaprilfools.yml")); + init(new File(getDataFolder(), "viaaprilfools.yml")); } @Override public File getDataFolder() { - return new File("config/viaaprilfools"); + return Via.getPlatform().getDataFolder(); } } diff --git a/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java b/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java index 504a16d..1975ef0 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java @@ -1,6 +1,7 @@ package com.viaversion.aas.platform; import com.viaversion.viabackwards.api.ViaBackwardsPlatform; +import com.viaversion.viaversion.api.Via; import java.io.File; import java.util.logging.Logger; @@ -13,7 +14,7 @@ public class AspirinBackwards implements ViaBackwardsPlatform { } public void init() { - init(getDataFolder().toPath().resolve("config.yml").toFile()); + init(new File(getDataFolder(), "viabackwards.yml")); } @Override @@ -22,6 +23,6 @@ public class AspirinBackwards implements ViaBackwardsPlatform { @Override public File getDataFolder() { - return new File("config/viabackwards"); + return Via.getPlatform().getDataFolder(); } } diff --git a/src/main/java/com/viaversion/aas/platform/AspirinLegacy.java b/src/main/java/com/viaversion/aas/platform/AspirinLegacy.java index 336e6ab..bb54be3 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinLegacy.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinLegacy.java @@ -14,10 +14,10 @@ public class AspirinLegacy implements ViaLegacyPlatform { @Override public File getDataFolder() { - return new File("config/vialegacy"); + return Via.getPlatform().getDataFolder(); } public void init() { - init(new File("config/vialegacy.yml")); + init(new File(getDataFolder(), "vialegacy.yml")); } } diff --git a/src/main/java/com/viaversion/aas/platform/AspirinRewind.java b/src/main/java/com/viaversion/aas/platform/AspirinRewind.java index b6be96d..9dc8a99 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinRewind.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinRewind.java @@ -1,6 +1,7 @@ package com.viaversion.aas.platform; import com.viaversion.viarewind.api.ViaRewindPlatform; +import com.viaversion.viaversion.api.Via; import java.io.File; import java.util.logging.Logger; @@ -13,6 +14,11 @@ public class AspirinRewind implements ViaRewindPlatform { } public void init() { - init(new File("config/viarewind.yml")); + init(new File(getDataFolder(), "viarewind.yml")); + } + + @Override + public File getDataFolder() { + return Via.getPlatform().getDataFolder(); } }