mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-14 19:15:08 -05:00
Added method to get the recommended plugin data folder
This commit is contained in:
parent
8f780e03b3
commit
e43bf553e4
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
package net.raphimc.viaproxy.plugins;
|
package net.raphimc.viaproxy.plugins;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -51,6 +52,14 @@ public abstract class ViaProxyPlugin {
|
||||||
public void onDisable() {
|
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() {
|
public final String getName() {
|
||||||
return (String) this.viaProxyYaml.get("name");
|
return (String) this.viaProxyYaml.get("name");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue