From df3f5b3041530e5bba1249b9ec3c67b1135e4cce Mon Sep 17 00:00:00 2001 From: ZakeyWolf Date: Mon, 26 Oct 2015 22:51:18 +0100 Subject: [PATCH] Moved all language settings to language.yml Moved two config options for ingame messages from config.yml to languages.yml for consistency --- .../aio/jetpacks/ConfigurationManager.java | 14 +------------- .../aio/jetpacks/JetpackManager.java | 4 ++-- .../aio/jetpacks/LocalizationManager.java | 12 ++++++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/de/freestylecrafter/aio/jetpacks/ConfigurationManager.java b/src/de/freestylecrafter/aio/jetpacks/ConfigurationManager.java index 2506b5e..911d48a 100644 --- a/src/de/freestylecrafter/aio/jetpacks/ConfigurationManager.java +++ b/src/de/freestylecrafter/aio/jetpacks/ConfigurationManager.java @@ -5,7 +5,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.bukkit.ChatColor; import org.bukkit.configuration.file.YamlConfiguration; public class ConfigurationManager @@ -53,18 +52,7 @@ public class ConfigurationManager changedConfig = true; } - if (!this.config.isString("message-equip")) - { - this.config.set("message-equip", ChatColor.AQUA + "[Jetpacks] " + ChatColor.GRAY + "%name%" + ChatColor.GREEN + " is now equipped." + ChatColor.YELLOW + " [Double jump to use]"); - - changedConfig = true; - } - if (!this.config.isString("message-unequip")) - { - this.config.set("message-unequip", ChatColor.AQUA + "[Jetpacks] " + ChatColor.GRAY + "%name%" + ChatColor.RED + " is no longer equipped!"); - - changedConfig = true; - } + if (!this.config.isConfigurationSection("jetpacks")) { this.config.set("jetpacks.example.displayName", "Example Jetpack"); diff --git a/src/de/freestylecrafter/aio/jetpacks/JetpackManager.java b/src/de/freestylecrafter/aio/jetpacks/JetpackManager.java index 475ec5c..bd61909 100644 --- a/src/de/freestylecrafter/aio/jetpacks/JetpackManager.java +++ b/src/de/freestylecrafter/aio/jetpacks/JetpackManager.java @@ -150,7 +150,7 @@ public class JetpackManager } String name = (profile == null || profile.getName() == null ? "unknown" : profile.getName()); - p.sendMessage(AIOPlugin.getInstance().getConfigManager().getConfiguration().getString("message-unequip", "").replace("%name%", "#" + name)); + p.sendMessage(AIOPlugin.getInstance().getLocalizationManager().getConfiguration().getString("message-unequip", "").replace("%name%", "#" + name)); } } @@ -190,7 +190,7 @@ public class JetpackManager } String name = (i.getProfile() == null || i.getProfile().getName() == null ? "unknown" : i.getProfile().getName()); - p.sendMessage(AIOPlugin.getInstance().getConfigManager().getConfiguration().getString("message-equip", "").replace("%name%", "#" + name)); + p.sendMessage(AIOPlugin.getInstance().getLocalizationManager().getConfiguration().getString("message-equip", "").replace("%name%", "#" + name)); } } } diff --git a/src/de/freestylecrafter/aio/jetpacks/LocalizationManager.java b/src/de/freestylecrafter/aio/jetpacks/LocalizationManager.java index 9d650bf..251d49f 100644 --- a/src/de/freestylecrafter/aio/jetpacks/LocalizationManager.java +++ b/src/de/freestylecrafter/aio/jetpacks/LocalizationManager.java @@ -131,6 +131,18 @@ public class LocalizationManager this.languageConfig.set("message-general-nopermissions", ChatColor.RED + "You don't have permission to use this command!"); changedConfig = true; } + if (!this.languageConfig.isString("message-equip")) + { + this.languageConfig.set("message-equip", ChatColor.AQUA + "[Jetpacks] " + ChatColor.GRAY + "%name%" + ChatColor.GREEN + " is now equipped." + ChatColor.YELLOW + " [Double jump to use]"); + + changedConfig = true; + } + if (!this.languageConfig.isString("message-unequip")) + { + this.languageConfig.set("message-unequip", ChatColor.AQUA + "[Jetpacks] " + ChatColor.GRAY + "%name%" + ChatColor.RED + " is no longer equipped!"); + + changedConfig = true; + } if (changedConfig) {