diff --git a/src/main/java/me/blackvein/quests/QuestFactory.java b/src/main/java/me/blackvein/quests/QuestFactory.java index 70b66ebee..e13cb5456 100644 --- a/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/src/main/java/me/blackvein/quests/QuestFactory.java @@ -431,7 +431,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { public String getPromptText(ConversationContext context) { String text = GOLD + "- Create Quest -\n"; - text += AQUA + "Create new Quest " + GOLD + "- Enter a name for the Quest (Or enter \'cancel\' to return)"; + text += AQUA + "Create new Quest " + GOLD + "- " + Lang.get("enterQuestName"); return text; diff --git a/src/main/java/me/blackvein/quests/Quests.java b/src/main/java/me/blackvein/quests/Quests.java index 30ea91850..58e4fe260 100644 --- a/src/main/java/me/blackvein/quests/Quests.java +++ b/src/main/java/me/blackvein/quests/Quests.java @@ -69,6 +69,7 @@ import com.gmail.nossr50.datatypes.skills.SkillType; public class Quests extends JavaPlugin implements ConversationAbandonedListener, ColorUtil { + public final static Logger log = Logger.getLogger("Minecraft"); public static Economy economy = null; public static Permission permission = null; public static mcMMO mcmmo = null; @@ -77,35 +78,35 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, public static boolean npcEffects = true; public static boolean broadcastPartyCreation = true; public static int maxPartySize = 0; - public static String effect = "note"; - final List questerBlacklist = new LinkedList(); - public ConversationFactory conversationFactory; - ConversationFactory NPCConversationFactory; - QuestFactory questFactory; - EventFactory eventFactory; - Vault vault = null; - public CitizensPlugin citizens; - PlayerListener pListener; - NpcEffectThread effListener; - NpcListener npcListener; - EpicBossListener bossListener; - public Denizen denizen = null; - QuestTaskTrigger trigger; - final Map questers = new HashMap(); - final LinkedList quests = new LinkedList(); - public final LinkedList events = new LinkedList(); - final LinkedList questNPCs = new LinkedList(); - boolean allowCommands = true; - boolean allowCommandsForNpcQuests = false; - boolean showQuestReqs = true; - boolean allowQuitting = true; - boolean debug = false; - boolean load = false; - int killDelay = 0; public static int acceptTimeout = 20; public static int inviteTimeout = 20; - int totalQuestPoints = 0; - public final static Logger log = Logger.getLogger("Minecraft"); + public static String effect = "note"; + public final Map questers = new HashMap(); + public final List questerBlacklist = new LinkedList(); + public final LinkedList quests = new LinkedList(); + public final LinkedList events = new LinkedList(); + public final LinkedList questNPCs = new LinkedList(); + public ConversationFactory conversationFactory; + public ConversationFactory NPCConversationFactory; + public QuestFactory questFactory; + public EventFactory eventFactory; + public Vault vault = null; + public CitizensPlugin citizens; + public PlayerListener pListener; + public NpcListener npcListener; + public EpicBossListener bossListener; + public NpcEffectThread effListener; + public Denizen denizen = null; + public QuestTaskTrigger trigger; + public boolean allowCommands = true; + public boolean allowCommandsForNpcQuests = false; + public boolean showQuestReqs = true; + public boolean allowQuitting = true; + public boolean debug = false; + public boolean load = false; + public int killDelay = 0; + public int totalQuestPoints = 0; + public Lang lang; @Override public void onEnable() { @@ -180,7 +181,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, } loadConfig(); - Lang.initPhrases(); + lang = new Lang(this); + lang.initPhrases(); + lang.save(); if (new File(this.getDataFolder(), "quests.yml").exists() == false) { printInfo("[Quests] Quest data not found, writing default to file."); @@ -326,6 +329,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener, debug = config.getBoolean("debug-mode"); killDelay = config.getInt("kill-delay"); acceptTimeout = config.getInt("accept-timeout"); + + if (config.contains("language")) { + Lang.lang = config.getString("language"); + } else { + config.set("language", "en"); + } if(config.contains("broadcast-party-creation")){ broadcastPartyCreation = config.getBoolean("broadcast-party-creation"); diff --git a/src/main/java/me/blackvein/quests/util/Lang.java b/src/main/java/me/blackvein/quests/util/Lang.java index 0f2af55ed..86d8b011f 100644 --- a/src/main/java/me/blackvein/quests/util/Lang.java +++ b/src/main/java/me/blackvein/quests/util/Lang.java @@ -1,242 +1,246 @@ -package me.blackvein.quests.util; - -import java.util.HashMap; -import java.util.Map; - -public class Lang { - - public static String lang = "en"; - private static Map en = new HashMap(); - private static Map fr = new HashMap(); - private static Map es = new HashMap(); - private static Map de = new HashMap(); - private static Map sv = new HashMap(); - private static Map nl = new HashMap(); - private static Map pl = new HashMap(); - private static Map da = new HashMap(); - private static Map zh = new HashMap(); - private static Map no = new HashMap(); - - public static String get(String key){ - - if(lang.equals("en")) - return en.get(key); - else if(lang.equals("fr")) - return fr.get(key); - else if(lang.equals("es")) - return es.get(key); - else if(lang.equals("de")) - return de.get(key); - else if(lang.equals("sv")) - return sv.get(key); - else if(lang.equals("nl")) - return nl.get(key); - else if(lang.equals("pl")) - return pl.get(key); - else if(lang.equals("da")) - return da.get(key); - else if(lang.equals("zh")) - return zh.get(key); - else if(lang.equals("no")) - return no.get(key); - else - return en.get(key); - - } - - public static void initPhrases(){ - - //English - - //Quests - en.put("enterQuestName", "Enter Quest name (or \"cancel\" to return)"); - - - // - - - //Events - en.put("eventEditorTitle", "Event Editor"); - en.put("eventEditorCreate", "Create new Event"); - en.put("eventEditorEdit", "Edit an Event"); - en.put("eventEditorDelete", "Delete an Event"); - - en.put("eventEditorNoneToEdit", "No Events currently exist to be edited!"); - en.put("eventEditorNoneToDelete", "No Events currently exist to be deleted!"); - en.put("eventEditorNotFound", "Event not found!"); - en.put("eventEditorExists", "Event already exists!"); - en.put("eventEditorSomeone", "Someone is already creating or editing an Event with that name!"); - en.put("eventEditorAlpha", "Name must be alphanumeric!"); - - en.put("eventEditorErrorReadingFile", "Error reading Events file."); - en.put("eventEditorErrorSaving", "An error occurred while saving."); - en.put("eventEditorDeleted", "Event deleted, Quests and Events reloaded."); - en.put("eventEditorSaved", "Event saved, Quests and Events reloaded."); - - en.put("eventEditorEnterEventName", "Enter an Event name, or \"cancel\" to return."); - en.put("eventEditorDeletePrompt", "Are you sure you want to delete the Event"); - en.put("eventEditorQuitWithoutSaving", "Are you sure you want to quit without saving?"); - en.put("eventEditorFinishAndSave", "Are you sure you want to finish and save the Event"); - en.put("eventEditorModifiedNote", "Note: You have modified an Event that the following Quests use:"); - en.put("eventEditorForcedToQuit", "If you save the Event, anyone who is actively doing any of these Quests will be forced to quit them."); - - en.put("eventEditorEventInUse", "The following Quests use the Event"); - en.put("eventEditorMustModifyQuests", "eventEditorNotFound"); - en.put("eventEditorListSizeMismatch", "The lists are not the same size!"); - en.put("eventEditorListDuplicates", "List contains duplicates!"); - en.put("eventEditorNotANumberList", "Input was not a list of numbers!"); - en.put("eventEditorInvalidEntry", "Invalid entry"); - - en.put("eventEditorSetName", "Set name"); - en.put("eventEditorSetMessage", "Set message"); - - - - en.put("eventEditorClearInv", "Clear player inventory"); - en.put("eventEditorSetExplosions", "Set explosion locations"); - en.put("eventEditorSetLightning", "Set lightning strike locations"); - en.put("eventEditorSetEffects", "Set effects"); - en.put("eventEditorSetStorm", "Set storm"); - en.put("eventEditorSetThunder", "Set thunder"); - en.put("eventEditorSetMobSpawns", "Set mob spawns"); - en.put("eventEditorSetPotionEffects", "Set potion effects"); - en.put("eventEditorSetHunger", "Set player hunger level"); - en.put("eventEditorSetSaturation", "Set player saturation level"); - en.put("eventEditorSetHealth", "Set player health level"); - en.put("eventEditorSetTeleport", "Set player teleport location"); - en.put("eventEditorSetCommands", "Set commands to execute"); - - en.put("eventEditorItems", "Event Items"); - en.put("eventEditorSetItems", "Give items"); - en.put("eventEditorItemsCleared", "Event items cleared."); - en.put("eventEditorSetItemIDs", "Set item IDs"); - en.put("eventEditorSetItemAmounts", "Set item amounts"); - en.put("eventEditorNoIDs", "No IDs set"); - en.put("eventEditorMustSetIDs", "You must set item IDs first!"); - en.put("eventEditorInvalidID", "___ is not a valid item ID!"); - en.put("eventEditorNotGreaterThanZero", "___ is not greater than 0!"); - en.put("eventEditorNotANumber", "___ is not a number!"); - - en.put("eventEditorStorm", "Event Storm"); - en.put("eventEditorSetWorld", "Set world"); - en.put("eventEditorSetDuration", "Set duration"); - en.put("eventEditorNoWorld", "(No world set)"); - en.put("eventEditorSetWorldFirst", "You must set a world first!"); - en.put("eventEditorInvalidWorld", "___ is not a valid world name!"); - en.put("eventEditorMustSetStormDuration", "You must set a storm duration!"); - en.put("eventEditorStormCleared", "Storm data cleared."); - en.put("eventEditorEnterStormWorld", "Enter a world name for the storm to occur in, or enter \"cancel\" to return"); - en.put("eventEditorEnterDuration", "Enter duration (in milliseconds)"); - en.put("eventEditorAtLeastOneSecond", "Amount must be at least 1 second! (1000 milliseconds)"); - en.put("eventEditorNotGreaterThanOneSecond", "___ is not greater than 1 second! (1000 milliseconds)"); - - en.put("eventEditorThunder", "Event Thunder"); - en.put("eventEditorInvalidWorld", "___ is not a valid world name!"); - en.put("eventEditorMustSetThunderDuration", "You must set a thunder duration!"); - en.put("eventEditorThunderCleared", "Thunder data cleared."); - en.put("eventEditorEnterThunderWorld", "Enter a world name for the thunder to occur in, or enter \"cancel\" to return"); - - en.put("eventEditorEffects", "Event Effects"); - en.put("eventEditorAddEffect", "Add effect"); - en.put("eventEditorAddEffectLocation", "Add effect location"); - en.put("eventEditorNoEffects", "No effects set"); - en.put("eventEditorMustAddEffects", "You must add effects first!"); - en.put("eventEditorInvalidEffect", "___ is not a valid effect name!"); - en.put("eventEditorEffectsCleared", "Event effects cleared."); - en.put("eventEditorEffectLocationPrompt", "Right-click on a block to play an effect at, then enter \"add\" to add it to the list, or enter \"cancel\" to return"); - - en.put("eventEditorMobSpawns", "Event Mob Spawns"); - en.put("eventEditorSetMobTypes", "Set mob types"); - en.put("eventEditorNoTypesSet", "(No types set)"); - en.put("eventEditorMustSetMobTypesFirst", "You must set mob types first!"); - en.put("eventEditorSetMobAmounts", "Set mob amounts"); - en.put("eventEditorNoAmountsSet", "(No amounts set)"); - en.put("eventEditorMustSetMobAmountsFirst", "You must set mob amounts first!"); - en.put("eventEditorMustSetMobTypesAndAmountsFirst", "You must set mob types and amounts first!"); - en.put("eventEditorAddSpawnLocation", "Add spawn location"); - en.put("eventEditorMobSpawnsCleared", "Mob spawns cleared."); - en.put("eventEditorInvalidMob", "___ is not a valid mob name!"); - - en.put("eventEditorLightningPrompt", "Right-click on a block to spawn a lightning strike at, then enter \"add\" to add it to the list, or enter \"clear\" to clear the locations list, or \"cancel\" to return"); - - en.put("eventEditorPotionEffects", "Event Potion Effects"); - en.put("eventEditorSetPotionEffects", "Set potion effect types"); - en.put("eventEditorMustSetPotionTypesFirst", "You must set potion effect types first!"); - en.put("eventEditorSetPotionDurations", "Set potion effect durations"); - en.put("eventEditorMustSetPotionDurationsFirst", "You must set potion effect durations first!"); - en.put("eventEditorMustSetPotionTypesAndDurationsFirst", "You must set potion effect types and durations first!"); - en.put("eventEditorNoDurationsSet", "(No durations set)"); - en.put("eventEditorSetPotionMagnitudes", "Set potion effect magnitudes"); - en.put("eventEditorPotionsCleared", "Potion effects cleared."); - en.put("eventEditorInvalidPotionType", "___ is not a valid potion effect type!"); - - en.put("eventEditorEnterNPCId", "Enter NPC ID (or -1 to return)"); - en.put("eventEditorNoNPCExists", "No NPC exists with that id!"); - en.put("eventEditorExplosionPrompt", "Right-click on a block to spawn an explosion at, then enter \"add\" to add it to the list, or enter \"clear\" to clear the explosions list, or \"cancel\" to return"); - en.put("eventEditorSelectBlockFirst", "You must select a block first."); - en.put("eventEditorSetMessagePrompt", "Enter message, or enter \'none\' to delete, (or \'cancel\' to return)"); - en.put("eventEditorSetItemIDsPrompt", "Enter item IDs separating each one by a space, or enter \"cancel\" to return."); - en.put("eventEditorSetItemAmountsPrompt", "Enter item amounts (numbers) separating each one by a space, or enter \"cancel\" to return."); - en.put("eventEditorSetMobTypesPrompt", "Enter mob names separating each one by a space, or enter \"cancel\" to return"); - en.put("eventEditorSetMobAmountsPrompt", "Enter mob amounts separating each one by a space, or enter \"cancel\" to return"); - en.put("eventEditorMobLocationPrompt", "Right-click on a block to select it, then enter \"add\" to add it to the mob spawn location list, or enter \"cancel\" to return"); - en.put("eventEditorSetPotionEffectsPrompt", "Enter potion effect types separating each one by a space, or enter \"cancel\" to return"); - en.put("eventEditorSetPotionDurationsPrompt", "Enter effect durations (in milliseconds) separating each one by a space, or enter \"cancel\" to return"); - en.put("eventEditorSetPotionMagnitudesPrompt", "Enter potion effect magnitudes separating each one by a space, or enter \"cancel\" to return"); - en.put("eventEditorSetHungerPrompt", "Enter hunger level, or -1 to remove it"); - en.put("eventEditorHungerLevelAtLeastZero", "Hunger level must be at least 0!"); - en.put("eventEditorSetSaturationPrompt", "Enter saturation level, or -1 to remove it"); - en.put("eventEditorSaturationLevelAtLeastZero", "Saturation level must be at least 0!"); - en.put("eventEditorSetHealthPrompt", "Enter health level, or -1 to remove it"); - en.put("eventEditorHealthLevelAtLeastZero", "Health level must be at least 0!"); - en.put("eventEditorSetTeleportPrompt", "Right-click on a block to teleport the player to, then enter \"done\" to finish,\nor enter \"clear\" to clear the teleport location, or \"cancel\" to return"); - en.put("eventEditorCommandsNote", "Note: You may use to refer to the player's name."); - en.put("eventEditorSetCommandsPrompt", "Enter commands separating each one by a comma, or enter \"clear\" to clear the list, or enter \"cancel\" to return."); - en.put("eventEditorSet", ""); - en.put("eventEditorSet", ""); - en.put("eventEditorSet", ""); - - - // - - //Effects - en.put("effBlazeShoot", "Sound of a Blaze firing"); - en.put("effBowFire", "Sound of a bow firing"); - en.put("effClick1", "A click sound"); - en.put("effClick2", "A different click sound"); - en.put("effDoorToggle", "Sound of a door opening or closing"); - en.put("effExtinguish", "Sound of fire being extinguished"); - en.put("effGhastShoot", "Sound of a Ghast firing"); - en.put("effGhastShriek", "Sound of a Ghast shrieking"); - en.put("effZombieWood", "Sound of a Zombie chewing an iron door"); - en.put("effZombieIron", "Sound of a Zombie chewing a wooden door"); - en.put("effEnterName", "Enter an effect name to add it to the list, or enter \"cancel\" to return"); - - // - - //Inputs - en.put("cmdCancel", "cancel"); - en.put("cmdAdd", "add"); - en.put("cmdClear", "clear"); - en.put("cmdNone", "none"); - en.put("cmdDone", "done"); - // - - //Misc - en.put("event", "Event"); - en.put("exit", "Exit"); - en.put("exited", "Exited."); - en.put("yes", "Yes"); - en.put("no", "No"); - en.put("done", "Done"); - en.put("quit", "Quit"); - en.put("clear", "Clear"); - en.put("noneSet", "None set"); - en.put("worlds", "Worlds"); - en.put("mobs", "Mobs"); - en.put("invalidOption", "Invalid option!"); - // - // - - } -} +package me.blackvein.quests.util; + +import java.io.File; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Map.Entry; + +import me.blackvein.quests.Quests; + +import org.bukkit.configuration.file.YamlConfiguration; + +public class Lang { + + public static String lang = "en"; + + private static Map en = new LinkedHashMap(); + + private Quests plugin; + + public Lang (Quests plugin) { + this.plugin = plugin; + } + + public static String get(String key){ + return en.get(key); + } + + public void initPhrases(){ + + //English + + //Quests + en.put("enterQuestName", "Enter Quest name (or \"cancel\" to return)"); + + + // + + + //Events + en.put("eventEditorTitle", "Event Editor"); + en.put("eventEditorCreate", "Create new Event"); + en.put("eventEditorEdit", "Edit an Event"); + en.put("eventEditorDelete", "Delete an Event"); + + en.put("eventEditorNoneToEdit", "No Events currently exist to be edited!"); + en.put("eventEditorNoneToDelete", "No Events currently exist to be deleted!"); + en.put("eventEditorNotFound", "Event not found!"); + en.put("eventEditorExists", "Event already exists!"); + en.put("eventEditorSomeone", "Someone is already creating or editing an Event with that name!"); + en.put("eventEditorAlpha", "Name must be alphanumeric!"); + + en.put("eventEditorErrorReadingFile", "Error reading Events file."); + en.put("eventEditorErrorSaving", "An error occurred while saving."); + en.put("eventEditorDeleted", "Event deleted, Quests and Events reloaded."); + en.put("eventEditorSaved", "Event saved, Quests and Events reloaded."); + + en.put("eventEditorEnterEventName", "Enter an Event name, or \"cancel\" to return."); + en.put("eventEditorDeletePrompt", "Are you sure you want to delete the Event"); + en.put("eventEditorQuitWithoutSaving", "Are you sure you want to quit without saving?"); + en.put("eventEditorFinishAndSave", "Are you sure you want to finish and save the Event"); + en.put("eventEditorModifiedNote", "Note: You have modified an Event that the following Quests use:"); + en.put("eventEditorForcedToQuit", "If you save the Event, anyone who is actively doing any of these Quests will be forced to quit them."); + + en.put("eventEditorEventInUse", "The following Quests use the Event"); + en.put("eventEditorMustModifyQuests", "eventEditorNotFound"); + en.put("eventEditorListSizeMismatch", "The lists are not the same size!"); + en.put("eventEditorListDuplicates", "List contains duplicates!"); + en.put("eventEditorNotANumberList", "Input was not a list of numbers!"); + en.put("eventEditorInvalidEntry", "Invalid entry"); + + en.put("eventEditorSetName", "Set name"); + en.put("eventEditorSetMessage", "Set message"); + + + + en.put("eventEditorClearInv", "Clear player inventory"); + en.put("eventEditorSetExplosions", "Set explosion locations"); + en.put("eventEditorSetLightning", "Set lightning strike locations"); + en.put("eventEditorSetEffects", "Set effects"); + en.put("eventEditorSetStorm", "Set storm"); + en.put("eventEditorSetThunder", "Set thunder"); + en.put("eventEditorSetMobSpawns", "Set mob spawns"); + en.put("eventEditorSetPotionEffects", "Set potion effects"); + en.put("eventEditorSetHunger", "Set player hunger level"); + en.put("eventEditorSetSaturation", "Set player saturation level"); + en.put("eventEditorSetHealth", "Set player health level"); + en.put("eventEditorSetTeleport", "Set player teleport location"); + en.put("eventEditorSetCommands", "Set commands to execute"); + + en.put("eventEditorItems", "Event Items"); + en.put("eventEditorSetItems", "Give items"); + en.put("eventEditorItemsCleared", "Event items cleared."); + en.put("eventEditorSetItemIDs", "Set item IDs"); + en.put("eventEditorSetItemAmounts", "Set item amounts"); + en.put("eventEditorNoIDs", "No IDs set"); + en.put("eventEditorMustSetIDs", "You must set item IDs first!"); + en.put("eventEditorInvalidID", "___ is not a valid item ID!"); + en.put("eventEditorNotGreaterThanZero", "___ is not greater than 0!"); + en.put("eventEditorNotANumber", "___ is not a number!"); + + en.put("eventEditorStorm", "Event Storm"); + en.put("eventEditorSetWorld", "Set world"); + en.put("eventEditorSetDuration", "Set duration"); + en.put("eventEditorNoWorld", "(No world set)"); + en.put("eventEditorSetWorldFirst", "You must set a world first!"); + en.put("eventEditorInvalidWorld", "___ is not a valid world name!"); + en.put("eventEditorMustSetStormDuration", "You must set a storm duration!"); + en.put("eventEditorStormCleared", "Storm data cleared."); + en.put("eventEditorEnterStormWorld", "Enter a world name for the storm to occur in, or enter \"cancel\" to return"); + en.put("eventEditorEnterDuration", "Enter duration (in milliseconds)"); + en.put("eventEditorAtLeastOneSecond", "Amount must be at least 1 second! (1000 milliseconds)"); + en.put("eventEditorNotGreaterThanOneSecond", "___ is not greater than 1 second! (1000 milliseconds)"); + + en.put("eventEditorThunder", "Event Thunder"); + en.put("eventEditorInvalidWorld", "___ is not a valid world name!"); + en.put("eventEditorMustSetThunderDuration", "You must set a thunder duration!"); + en.put("eventEditorThunderCleared", "Thunder data cleared."); + en.put("eventEditorEnterThunderWorld", "Enter a world name for the thunder to occur in, or enter \"cancel\" to return"); + + en.put("eventEditorEffects", "Event Effects"); + en.put("eventEditorAddEffect", "Add effect"); + en.put("eventEditorAddEffectLocation", "Add effect location"); + en.put("eventEditorNoEffects", "No effects set"); + en.put("eventEditorMustAddEffects", "You must add effects first!"); + en.put("eventEditorInvalidEffect", "___ is not a valid effect name!"); + en.put("eventEditorEffectsCleared", "Event effects cleared."); + en.put("eventEditorEffectLocationPrompt", "Right-click on a block to play an effect at, then enter \"add\" to add it to the list, or enter \"cancel\" to return"); + + en.put("eventEditorMobSpawns", "Event Mob Spawns"); + en.put("eventEditorSetMobTypes", "Set mob types"); + en.put("eventEditorNoTypesSet", "(No types set)"); + en.put("eventEditorMustSetMobTypesFirst", "You must set mob types first!"); + en.put("eventEditorSetMobAmounts", "Set mob amounts"); + en.put("eventEditorNoAmountsSet", "(No amounts set)"); + en.put("eventEditorMustSetMobAmountsFirst", "You must set mob amounts first!"); + en.put("eventEditorMustSetMobTypesAndAmountsFirst", "You must set mob types and amounts first!"); + en.put("eventEditorAddSpawnLocation", "Add spawn location"); + en.put("eventEditorMobSpawnsCleared", "Mob spawns cleared."); + en.put("eventEditorInvalidMob", "___ is not a valid mob name!"); + + en.put("eventEditorLightningPrompt", "Right-click on a block to spawn a lightning strike at, then enter \"add\" to add it to the list, or enter \"clear\" to clear the locations list, or \"cancel\" to return"); + + en.put("eventEditorPotionEffects", "Event Potion Effects"); + en.put("eventEditorSetPotionEffects", "Set potion effect types"); + en.put("eventEditorMustSetPotionTypesFirst", "You must set potion effect types first!"); + en.put("eventEditorSetPotionDurations", "Set potion effect durations"); + en.put("eventEditorMustSetPotionDurationsFirst", "You must set potion effect durations first!"); + en.put("eventEditorMustSetPotionTypesAndDurationsFirst", "You must set potion effect types and durations first!"); + en.put("eventEditorNoDurationsSet", "(No durations set)"); + en.put("eventEditorSetPotionMagnitudes", "Set potion effect magnitudes"); + en.put("eventEditorPotionsCleared", "Potion effects cleared."); + en.put("eventEditorInvalidPotionType", "___ is not a valid potion effect type!"); + + en.put("eventEditorEnterNPCId", "Enter NPC ID (or -1 to return)"); + en.put("eventEditorNoNPCExists", "No NPC exists with that id!"); + en.put("eventEditorExplosionPrompt", "Right-click on a block to spawn an explosion at, then enter \"add\" to add it to the list, or enter \"clear\" to clear the explosions list, or \"cancel\" to return"); + en.put("eventEditorSelectBlockFirst", "You must select a block first."); + en.put("eventEditorSetMessagePrompt", "Enter message, or enter \'none\' to delete, (or \'cancel\' to return)"); + en.put("eventEditorSetItemIDsPrompt", "Enter item IDs separating each one by a space, or enter \"cancel\" to return."); + en.put("eventEditorSetItemAmountsPrompt", "Enter item amounts (numbers) separating each one by a space, or enter \"cancel\" to return."); + en.put("eventEditorSetMobTypesPrompt", "Enter mob names separating each one by a space, or enter \"cancel\" to return"); + en.put("eventEditorSetMobAmountsPrompt", "Enter mob amounts separating each one by a space, or enter \"cancel\" to return"); + en.put("eventEditorMobLocationPrompt", "Right-click on a block to select it, then enter \"add\" to add it to the mob spawn location list, or enter \"cancel\" to return"); + en.put("eventEditorSetPotionEffectsPrompt", "Enter potion effect types separating each one by a space, or enter \"cancel\" to return"); + en.put("eventEditorSetPotionDurationsPrompt", "Enter effect durations (in milliseconds) separating each one by a space, or enter \"cancel\" to return"); + en.put("eventEditorSetPotionMagnitudesPrompt", "Enter potion effect magnitudes separating each one by a space, or enter \"cancel\" to return"); + en.put("eventEditorSetHungerPrompt", "Enter hunger level, or -1 to remove it"); + en.put("eventEditorHungerLevelAtLeastZero", "Hunger level must be at least 0!"); + en.put("eventEditorSetSaturationPrompt", "Enter saturation level, or -1 to remove it"); + en.put("eventEditorSaturationLevelAtLeastZero", "Saturation level must be at least 0!"); + en.put("eventEditorSetHealthPrompt", "Enter health level, or -1 to remove it"); + en.put("eventEditorHealthLevelAtLeastZero", "Health level must be at least 0!"); + en.put("eventEditorSetTeleportPrompt", "Right-click on a block to teleport the player to, then enter \"done\" to finish,\nor enter \"clear\" to clear the teleport location, or \"cancel\" to return"); + en.put("eventEditorCommandsNote", "Note: You may use to refer to the player's name."); + en.put("eventEditorSetCommandsPrompt", "Enter commands separating each one by a comma, or enter \"clear\" to clear the list, or enter \"cancel\" to return."); + en.put("eventEditorSet", ""); + //en.put("eventEditorSet", ""); + //en.put("eventEditorSet", ""); + + + // + + //Effects + en.put("effBlazeShoot", "Sound of a Blaze firing"); + en.put("effBowFire", "Sound of a bow firing"); + en.put("effClick1", "A click sound"); + en.put("effClick2", "A different click sound"); + en.put("effDoorToggle", "Sound of a door opening or closing"); + en.put("effExtinguish", "Sound of fire being extinguished"); + en.put("effGhastShoot", "Sound of a Ghast firing"); + en.put("effGhastShriek", "Sound of a Ghast shrieking"); + en.put("effZombieWood", "Sound of a Zombie chewing an iron door"); + en.put("effZombieIron", "Sound of a Zombie chewing a wooden door"); + en.put("effEnterName", "Enter an effect name to add it to the list, or enter \"cancel\" to return"); + + // + + //Inputs + en.put("cmdCancel", "cancel"); + en.put("cmdAdd", "add"); + en.put("cmdClear", "clear"); + en.put("cmdNone", "none"); + en.put("cmdDone", "done"); + // + + //Misc + en.put("event", "Event"); + en.put("exit", "Exit"); + en.put("exited", "Exited."); + en.put("yes", "Yes"); + en.put("no", "No"); + en.put("done", "Done"); + en.put("quit", "Quit"); + en.put("clear", "Clear"); + en.put("noneSet", "None set"); + en.put("worlds", "Worlds"); + en.put("mobs", "Mobs"); + en.put("invalidOption", "Invalid option!"); + // + // + + File file = new File(plugin.getDataFolder(), "/lang/" + lang + ".yml"); + YamlConfiguration langFile = YamlConfiguration.loadConfiguration(file); + + for (Entry e : langFile.getValues(true).entrySet()) { + en.put(e.getKey(), (String) e.getValue()); + } + + } + + public void save() { + File file = new File(plugin.getDataFolder(), "/lang/" + lang + ".yml"); + YamlConfiguration langFile = YamlConfiguration.loadConfiguration(file); + + for (Entry e : en.entrySet()) { + langFile.set(e.getKey(), e.getValue()); + } + + try { + langFile.save(file); + } catch (IOException e1) { + e1.printStackTrace(); + } + } +}