mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-21 11:46:49 +01:00
Fix broken root folder reference in VV platform
Closes https://github.com/ViaVersion/ViaFabricPlus/issues/567
This commit is contained in:
parent
67f51ffd93
commit
419a296587
@ -265,13 +265,13 @@ public class ProtocolTranslator {
|
||||
/**
|
||||
* Apply recommended config options to the ViaVersion config files
|
||||
*
|
||||
* @param configFolder The directory where the ViaVersion config files is located
|
||||
* @param directory The directory where the ViaVersion config files is located
|
||||
*/
|
||||
private static void patchConfigs(final File configFolder) {
|
||||
configFolder.mkdirs();
|
||||
private static void patchConfigs(final File directory) {
|
||||
directory.mkdirs();
|
||||
|
||||
try {
|
||||
final File viaVersionConfig = new File(configFolder, "viaversion.yml");
|
||||
final File viaVersionConfig = new File(directory, "viaversion.yml");
|
||||
Files.writeString(viaVersionConfig.toPath(), """
|
||||
fix-infested-block-breaking: false
|
||||
shield-blocking: false
|
||||
@ -284,7 +284,7 @@ public class ProtocolTranslator {
|
||||
}
|
||||
|
||||
try {
|
||||
final File viaLegacyConfig = new File(configFolder, "vialegacy.yml");
|
||||
final File viaLegacyConfig = new File(directory, "vialegacy.yml");
|
||||
Files.writeString(viaLegacyConfig.toPath(), """
|
||||
legacy-skull-loading: true
|
||||
legacy-skin-loading: true
|
||||
|
@ -22,6 +22,7 @@ package de.florianmichael.viafabricplus.protocoltranslator.impl.platform;
|
||||
import com.viaversion.viaversion.configuration.AbstractViaConfig;
|
||||
import com.viaversion.viaversion.libs.gson.JsonArray;
|
||||
import com.viaversion.viaversion.libs.gson.JsonObject;
|
||||
import de.florianmichael.viafabricplus.ViaFabricPlus;
|
||||
import de.florianmichael.viafabricplus.injection.ViaFabricPlusMixinPlugin;
|
||||
import de.florianmichael.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import de.florianmichael.viafabricplus.protocoltranslator.impl.viaversion.ViaFabricPlusVLViaConfig;
|
||||
@ -32,16 +33,14 @@ import java.io.File;
|
||||
|
||||
public class ViaFabricPlusViaVersionPlatformImpl extends ViaVersionPlatformImpl {
|
||||
|
||||
private final File rootFolder;
|
||||
|
||||
public ViaFabricPlusViaVersionPlatformImpl(File rootFolder) {
|
||||
public ViaFabricPlusViaVersionPlatformImpl(File rootFolder) { // Only required to not throw an exception, not used
|
||||
super(rootFolder);
|
||||
this.rootFolder = rootFolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractViaConfig createConfig() {
|
||||
return new ViaFabricPlusVLViaConfig(new File(this.getDataFolder(), "viaversion.yml"), this.getLogger());
|
||||
// Use config overload and change directory to root folder
|
||||
return new ViaFabricPlusVLViaConfig(new File(getDataFolder(), "viaversion.yml"), this.getLogger());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,7 +79,7 @@ public class ViaFabricPlusViaVersionPlatformImpl extends ViaVersionPlatformImpl
|
||||
@Override
|
||||
public File getDataFolder() {
|
||||
// Move ViaLoader files directly into root folder
|
||||
return this.rootFolder;
|
||||
return ViaFabricPlus.global().getDirectory();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user