mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2025-01-02 18:28:33 +01:00
Added method to get the recommended plugin data folder
This commit is contained in:
parent
8f780e03b3
commit
e43bf553e4
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package net.raphimc.viaproxy.plugins;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -51,6 +52,14 @@ public abstract class ViaProxyPlugin {
|
||||
public void onDisable() {
|
||||
}
|
||||
|
||||
public final File getDataFolder() {
|
||||
final File dataFolder = new File(PluginManager.PLUGINS_DIR, (String) this.viaProxyYaml.get("name"));
|
||||
if (!dataFolder.exists()) {
|
||||
dataFolder.mkdirs();
|
||||
}
|
||||
return dataFolder;
|
||||
}
|
||||
|
||||
public final String getName() {
|
||||
return (String) this.viaProxyYaml.get("name");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user