Add config updater.
This commit is contained in:
@@ -128,6 +128,37 @@ public class Main extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateConfig() {
|
||||||
|
if(getConfig().get("check-update") == null) {
|
||||||
|
getConfig().set("check-update", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConfig().get("economy.enabled") == null) {
|
||||||
|
getConfig().set("economy.enabled", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConfig().get("economy.cost-to-create") == null) {
|
||||||
|
getConfig().set("economy.cost-to-create", 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConfig().get("economy.cost-to-open") == null) {
|
||||||
|
getConfig().set("economy.cost-to-create", 10);
|
||||||
|
}
|
||||||
|
if(getConfig().get("economy.refund-on-delete") == null) {
|
||||||
|
getConfig().set("economy.refund-on-delete", 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConfig().get("drop-on-death.enabled") == null) {
|
||||||
|
getConfig().set("drop-on-death.enabled", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getConfig().get("drop-on-death.inventories") == null) {
|
||||||
|
getConfig().set("drop-on-death.inventories", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
public YamlConfiguration loadLang() {
|
public YamlConfiguration loadLang() {
|
||||||
File lang = new File(getDataFolder(), "lang.yml");
|
File lang = new File(getDataFolder(), "lang.yml");
|
||||||
if(!lang.exists()) {
|
if(!lang.exists()) {
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class BackwardsCompatibility {
|
|||||||
return inventory;
|
return inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static CraftItemStack getCraftVersion(org.bukkit.inventory.ItemStack stack) {
|
private static CraftItemStack getCraftVersion(org.bukkit.inventory.ItemStack stack) {
|
||||||
if ((stack instanceof CraftItemStack))
|
if ((stack instanceof CraftItemStack))
|
||||||
return (CraftItemStack) stack;
|
return (CraftItemStack) stack;
|
||||||
|
|||||||
Reference in New Issue
Block a user