Provide a platform independent method of retrieving the datafolder (#769)

* Provide a platform independent method of retrieving the datafolder

* LocaleUtils now uses datafolder

* Make use of Path instead of File

Changes:
* Rename getDataFolder() to getConfigFile() and update to return a Path in each bootstrap

* Rename filePath to tmpFilePath

* Update Velocity configFile to configFile Path
This commit is contained in:
bundabrg 2020-06-21 01:54:40 +08:00 committed by GitHub
parent 100d7b7759
commit e66f57f9f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 12 deletions

View file

@ -50,6 +50,7 @@ import org.spongepowered.api.plugin.Plugin;
import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.file.Path;
import java.util.UUID;
@Plugin(id = "geyser", name = GeyserConnector.NAME + "-Sponge", version = GeyserConnector.VERSION, url = "https://geysermc.org", authors = "GeyserMC")
@ -147,6 +148,11 @@ public class GeyserSpongePlugin implements GeyserBootstrap {
return geyserSpongePingPassthrough;
}
@Override
public Path getConfigFolder() {
return configDir.toPath();
}
@Listener
public void onServerStart(GameStartedServerEvent event) {
onEnable();