Intendation ftw

This commit is contained in:
Trent Hensler
2013-03-08 14:56:28 -06:00
parent 34095a43e9
commit b4944b0093
4 changed files with 16 additions and 16 deletions
+7 -7
View File
@@ -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;
}
}
+4 -4
View File
@@ -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";
/**