Intendation ftw
This commit is contained in:
@@ -51,7 +51,7 @@ public class Main extends JavaPlugin {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void loadConfig() {
|
||||
File config = new File(getDataFolder() + File.separator + "config.yml");
|
||||
if(!config.exists()) {
|
||||
@@ -66,11 +66,11 @@ public class Main extends JavaPlugin {
|
||||
getDataFolder().mkdir();
|
||||
lang.createNewFile();
|
||||
InputStream defConfigStream = this.getResource("lang.yml");
|
||||
if (defConfigStream != null) {
|
||||
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
|
||||
defConfig.save(lang);
|
||||
return defConfig;
|
||||
}
|
||||
if (defConfigStream != null) {
|
||||
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
|
||||
defConfig.save(lang);
|
||||
return defConfig;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace(); //So they notice
|
||||
log.severe("[PlayerVaults] Couldn't create language file.");
|
||||
@@ -82,7 +82,7 @@ public class Main extends JavaPlugin {
|
||||
Lang.setFile(conf);
|
||||
return conf;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Methods to get values from the config.
|
||||
* public so any class / plugin can get them.
|
||||
|
||||
@@ -4,18 +4,18 @@ public class VaultViewInfo {
|
||||
|
||||
String s;
|
||||
int i;
|
||||
|
||||
|
||||
public VaultViewInfo(String s, int i) {
|
||||
this.s = s;
|
||||
this.i = i;
|
||||
}
|
||||
|
||||
|
||||
public String getHolder() {
|
||||
return this.s;
|
||||
}
|
||||
|
||||
|
||||
public int getNumber() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,18 +14,18 @@ public enum Lang {
|
||||
MUST_BE_NUMBER("must-be-number"),
|
||||
DELETE_VAULT_ERROR("delete-vault-error"),
|
||||
NO_PERMS("no-permissions");
|
||||
|
||||
|
||||
private String path = "";
|
||||
private static YamlConfiguration lang;
|
||||
|
||||
|
||||
Lang(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
|
||||
public static void setFile(YamlConfiguration yc) {
|
||||
lang = yc;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ChatColor.translateAlternateColorCodes('&', lang.getString(this.path));
|
||||
|
||||
@@ -19,7 +19,7 @@ public class VaultManager {
|
||||
public VaultManager(Main instance) {
|
||||
this.plugin = instance;
|
||||
}
|
||||
|
||||
|
||||
private final String directory = "plugins" + File.separator + "PlayerVaults" + File.separator + "vaults";
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user