Move ViaLoader files directly into root folder, update USAGE.md

This commit is contained in:
FlorianMichael 2024-09-15 00:27:39 +02:00
parent af870cee1a
commit 8b5aee722e
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
3 changed files with 34 additions and 10 deletions

View File

@ -24,13 +24,16 @@ You can use the ViaVersion commands with **/viafabricplus** or **/viaversion**,
For users only the settings in the **General**, **Bedrock**, **Authentication** and **Visual** tab are relevant, the other settings are only for developers, you should not change the settings in the **Debug** tab if you don't know what you are doing.
![](preview/settings-selection.png)
### Configuring the protocol translation libraries
To change the protocol translation settings/features you can look into the ViaLoader folder. You can find 4 config files there depending on the platforms loaded:
The settings are stored in the `settings.json` file. Account credentials for Bedrock/ClassiCube in `accounts.json`.
- viaversion.yml (ViaVersion)
- viabackwards.yml (ViaBackwards)
- vialegacy.yml (ViaLegacy)
- viabedrock.yml (ViaBedrock)
### Configuring the protocol translation libraries
To change the protocol translation settings/features you can look into the config folder. You can find 4 config files there depending on the platforms loaded:
- `viaversion.yml` (ViaVersion)
- `viabackwards.yml` (ViaBackwards)
- `vialegacy.yml` (ViaLegacy)
- `viabedrock.yml` (ViaBedrock)
- `viaaprilfools.yml` (ViaAprilFools)
On it's first launch, ViaFabricPlus will generate the config files with proper default values. Don't touch the config files if you don't know what you are doing.
@ -42,8 +45,7 @@ The debug HUD can be enabled in the settings, it shows some useful information a
Keep in mind that the Java -> Bedrock support is still in beta phase, and therefore many things are not implemented
yet and there is no guarantee that everything will work as it should.
To log in to a Bedrock account you can press the button **"Click to set account for Bedrock edition"** in the settings,
then you can log in via device login, the account logged in there will be stored in **/minecraft./config/viafabricplus/accounts.json**.
To log in to a Bedrock account you can press the button **"Click to set account for Bedrock edition"** in the settings.
### ClassiCube and BetaCraft integration
In the main GUI there is an extra button for ClassiCube and BetaCraft, both buttons send API requests to the respective platforms to get the respective server list.
@ -55,4 +57,3 @@ In the main GUI there is an extra button for ClassiCube and BetaCraft, both butt
For ClassiCube you need an account, which you can make on the official website (https://www.classicube.net/), in case ClassiCube requires MultiFactor, an extra GUI will open in ViaFabricPlus.
![](preview/classicube_login.png)
The ClassiCube account will be stored in **/minecraft./config/viafabricplus/accounts.json**.

View File

@ -302,6 +302,18 @@ public class ProtocolTranslator {
name.set(name.get() + " (Work in progress)");
}
@Deprecated/*(forRemoval = true)*/
private static void migrateOldConfigs(final File directory) {
final File oldDirectory = new File(directory, "ViaLoader");
if (oldDirectory.exists()) {
// Move all files from this folder into the directory itself
for (File file : oldDirectory.listFiles()) {
file.renameTo(new File(directory, file.getName()));
}
oldDirectory.delete();
}
}
/**
* This method is used to initialize the whole Protocol Translator
*
@ -313,7 +325,8 @@ public class ProtocolTranslator {
if (SharedConstants.getProtocolVersion() != NATIVE_VERSION.getOriginalVersion()) {
throw new IllegalStateException("Native version is not the same as the current version");
}
patchConfigs(new File(directory, "ViaLoader"));
migrateOldConfigs(directory);
patchConfigs(directory);
// Register command callback for /viafabricplus
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {

View File

@ -32,8 +32,11 @@ import java.io.File;
public class ViaFabricPlusViaVersionPlatformImpl extends ViaVersionPlatformImpl {
private final File rootFolder;
public ViaFabricPlusViaVersionPlatformImpl(File rootFolder) {
super(rootFolder);
this.rootFolder = rootFolder;
}
@Override
@ -73,4 +76,11 @@ public class ViaFabricPlusViaVersionPlatformImpl extends ViaVersionPlatformImpl
return platformDump;
}
@Override
public File getDataFolder() {
// Move ViaLoader files directly into root folder
return this.rootFolder;
}
}