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