Fixed platform loading

Closes https://github.com/ViaVersion/VIAaaS/issues/237
This commit is contained in:
FlorianMichael 2024-02-18 22:51:21 +01:00
parent 6575cf357a
commit 972a6932b2
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
4 changed files with 15 additions and 7 deletions

View File

@ -1,5 +1,6 @@
package com.viaversion.aas.platform; package com.viaversion.aas.platform;
import com.viaversion.viaversion.api.Via;
import net.raphimc.viaaprilfools.platform.ViaAprilFoolsPlatform; import net.raphimc.viaaprilfools.platform.ViaAprilFoolsPlatform;
import java.io.File; import java.io.File;
@ -13,11 +14,11 @@ public class AspirinAprilFools implements ViaAprilFoolsPlatform {
} }
public void init() { public void init() {
init(new File("config/viaaprilfools.yml")); init(new File(getDataFolder(), "viaaprilfools.yml"));
} }
@Override @Override
public File getDataFolder() { public File getDataFolder() {
return new File("config/viaaprilfools"); return Via.getPlatform().getDataFolder();
} }
} }

View File

@ -1,6 +1,7 @@
package com.viaversion.aas.platform; package com.viaversion.aas.platform;
import com.viaversion.viabackwards.api.ViaBackwardsPlatform; import com.viaversion.viabackwards.api.ViaBackwardsPlatform;
import com.viaversion.viaversion.api.Via;
import java.io.File; import java.io.File;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -13,7 +14,7 @@ public class AspirinBackwards implements ViaBackwardsPlatform {
} }
public void init() { public void init() {
init(getDataFolder().toPath().resolve("config.yml").toFile()); init(new File(getDataFolder(), "viabackwards.yml"));
} }
@Override @Override
@ -22,6 +23,6 @@ public class AspirinBackwards implements ViaBackwardsPlatform {
@Override @Override
public File getDataFolder() { public File getDataFolder() {
return new File("config/viabackwards"); return Via.getPlatform().getDataFolder();
} }
} }

View File

@ -14,10 +14,10 @@ public class AspirinLegacy implements ViaLegacyPlatform {
@Override @Override
public File getDataFolder() { public File getDataFolder() {
return new File("config/vialegacy"); return Via.getPlatform().getDataFolder();
} }
public void init() { public void init() {
init(new File("config/vialegacy.yml")); init(new File(getDataFolder(), "vialegacy.yml"));
} }
} }

View File

@ -1,6 +1,7 @@
package com.viaversion.aas.platform; package com.viaversion.aas.platform;
import com.viaversion.viarewind.api.ViaRewindPlatform; import com.viaversion.viarewind.api.ViaRewindPlatform;
import com.viaversion.viaversion.api.Via;
import java.io.File; import java.io.File;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -13,6 +14,11 @@ public class AspirinRewind implements ViaRewindPlatform {
} }
public void init() { public void init() {
init(new File("config/viarewind.yml")); init(new File(getDataFolder(), "viarewind.yml"));
}
@Override
public File getDataFolder() {
return Via.getPlatform().getDataFolder();
} }
} }