diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java index cbee9b871..dc1d78cc2 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/EffectPrompt.java @@ -25,6 +25,7 @@ import me.blackvein.quests.util.MiscUtil; import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; @@ -180,7 +181,7 @@ public class EffectPrompt extends ActionsEditorNumericPrompt { @Override public String getTitle(final ConversationContext context) { - return Lang.get("eventEditorEffects"); + return Lang.get("eventEditorEffectsTitle"); } @Override public ChatColor getNumberColor(final ConversationContext context, final int number) { @@ -252,7 +253,7 @@ public class EffectPrompt extends ActionsEditorNumericPrompt { = new ActionsEditorPostOpenNumericPromptEvent(context, this); plugin.getServer().getPluginManager().callEvent(event); - final StringBuilder text = new StringBuilder(ChatColor.GOLD + "- " + getTitle(context) + " -"); + final StringBuilder text = new StringBuilder(ChatColor.GOLD + getTitle(context)); for (int i = 1; i <= size; i++) { text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i) .append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ") @@ -337,17 +338,15 @@ public class EffectPrompt extends ActionsEditorNumericPrompt { plugin.getServer().getPluginManager().callEvent(event); final StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"); - final Effect[] values = Effect.values(); - for (int i = 0; i < values.length; i++) { - final Effect eff = values[i]; - if (i < (values.length - 1)) { - effects.append(MiscUtil.snakeCaseToUpperCamelCase(eff.name())).append(", "); - } else { - effects.append(MiscUtil.snakeCaseToUpperCamelCase(eff.name())).append("\n"); + final Effect[] worldArr = Effect.values(); + for (int i = 0; i < worldArr.length; i++) { + effects.append(ChatColor.AQUA).append(MiscUtil.snakeCaseToUpperCamelCase(worldArr[i].name())); + if (i < (worldArr.length - 1)) { + effects.append(ChatColor.GRAY).append(", "); } - } - return effects.toString() + ChatColor.YELLOW + getQueryText(context); + effects.append("\n").append(ChatColor.YELLOW).append(getQueryText(context)); + return effects.toString(); } @SuppressWarnings("unchecked") diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java index 3c8bd3bce..698d7ca50 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/PlayerPrompt.java @@ -27,6 +27,7 @@ import me.blackvein.quests.util.MiscUtil; import me.blackvein.quests.util.RomanNumeral; import org.bukkit.ChatColor; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.conversations.ConversationContext; import org.bukkit.conversations.Prompt; @@ -631,12 +632,17 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt { final ActionsEditorPostOpenStringPromptEvent event = new ActionsEditorPostOpenStringPromptEvent(context, this); plugin.getServer().getPluginManager().callEvent(event); - - final StringBuilder effs = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context)); - for (final PotionEffectType pet : PotionEffectType.values()) { - effs.append(pet != null ? "\n" + ChatColor.DARK_PURPLE + pet.getName() : ""); + + final StringBuilder potions = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"); + final PotionEffectType[] potionArr = PotionEffectType.values(); + for (int i = 0; i < potionArr.length; i++) { + potions.append(ChatColor.AQUA).append(potionArr[i].getName()); + if (i < (potionArr.length - 1)) { + potions.append(ChatColor.GRAY).append(", "); + } } - return effs.toString() + ChatColor.YELLOW + getQueryText(context); + potions.append("\n").append(ChatColor.YELLOW).append(getQueryText(context)); + return potions.toString(); } @Override diff --git a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java index 2a7b33415..7b7ecbc64 100644 --- a/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java +++ b/core/src/main/java/me/blackvein/quests/convo/actions/tasks/WeatherPrompt.java @@ -32,6 +32,7 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import java.util.LinkedList; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.UUID; @@ -315,13 +316,16 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt { = new ActionsEditorPostOpenStringPromptEvent(context, this); plugin.getServer().getPluginManager().callEvent(event); - StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) - + ChatColor.DARK_PURPLE); - for (final World w : plugin.getServer().getWorlds()) { - effects.append("\n").append(w.getName()).append(", "); + final StringBuilder worlds = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"); + final List worldArr = plugin.getServer().getWorlds(); + for (int i = 0; i < worldArr.size(); i++) { + worlds.append(ChatColor.AQUA).append(worldArr.get(i).getName()); + if (i < (worldArr.size() - 1)) { + worlds.append(ChatColor.GRAY).append(", "); + } } - effects = new StringBuilder(effects.substring(0, effects.length())); - return effects + "\n" + ChatColor.YELLOW + getQueryText(context); + worlds.append("\n").append(ChatColor.YELLOW).append(getQueryText(context)); + return worlds.toString(); } @Override @@ -531,14 +535,17 @@ public class WeatherPrompt extends ActionsEditorNumericPrompt { final ActionsEditorPostOpenStringPromptEvent event = new ActionsEditorPostOpenStringPromptEvent(context, this); plugin.getServer().getPluginManager().callEvent(event); - - StringBuilder effects = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) - + ChatColor.DARK_PURPLE); - for (final World w : plugin.getServer().getWorlds()) { - effects.append("\n").append(w.getName()).append(", "); + + final StringBuilder worlds = new StringBuilder(ChatColor.LIGHT_PURPLE + getTitle(context) + "\n"); + final List worldArr = plugin.getServer().getWorlds(); + for (int i = 0; i < worldArr.size(); i++) { + worlds.append(ChatColor.AQUA).append(worldArr.get(i).getName()); + if (i < (worldArr.size() - 1)) { + worlds.append(ChatColor.GRAY).append(", "); + } } - effects = new StringBuilder(effects.substring(0, effects.length())); - return ChatColor.YELLOW + effects.toString() + getQueryText(context); + worlds.append("\n").append(ChatColor.YELLOW).append(getQueryText(context)); + return worlds.toString(); } @Override diff --git a/core/src/main/resources/strings.yml b/core/src/main/resources/strings.yml index 9ccb2d072..3d33b3417 100644 --- a/core/src/main/resources/strings.yml +++ b/core/src/main/resources/strings.yml @@ -318,7 +318,6 @@ eventEditorSetItemAmounts: "Set item amounts" eventEditorNoNames: "No names set" eventEditorMustSetNames: "You must set item names first!" eventEditorInvalidName: "is not a valid item name!" -eventEditorStorm: "Action Storm" eventEditorSetWorld: "Set world" eventEditorSetDuration: "Set duration" eventEditorSetWorldFirst: "You must set a world first!" @@ -327,18 +326,15 @@ eventEditorMustSetStormDuration: "You must set a storm duration!" eventEditorStormCleared: "Storm data cleared." eventEditorEnterStormWorld: "Enter a world name for the storm to occur in, " eventEditorEnterDuration: "Enter duration (in seconds)" -eventEditorThunder: "Action Thunder" eventEditorMustSetThunderDuration: "You must set a thunder duration!" eventEditorThunderCleared: "Thunder data cleared." eventEditorEnterThunderWorld: "Enter a world name for the thunder to occur in, " -eventEditorEffects: "Action Sound Effects" eventEditorAddEffect: "Add sound effect" eventEditorAddEffectLocation: "Add sound effect location" eventEditorMustAddEffects: "You must add sound effects first!" eventEditorInvalidEffect: "is not a valid sound effect name!" eventEditorEffectsCleared: "Action sound effects cleared." eventEditorEffectLocationPrompt: "Right-click on a block to play a sound effect at, , " -eventEditorMobSpawns: "Action Mob Spawns" eventEditorAddMobTypes: "Add mob" eventEditorSetMobName: "Set custom name for mob" eventEditorSetMobType: "Set mob type" @@ -361,7 +357,6 @@ eventEditorSetMobChestPlateDrop: "Set drop chance of chest plate" eventEditorSetMobHelmet: "Set helmet" eventEditorSetMobHelmetDrop: "Set drop chance of helmet" eventEditorSetDropChance: "Enter drop chance between and , " -eventEditorPotionEffects: "Action Potion Effects" eventEditorSetPotionEffectTypes: "Set potion effect types" eventEditorMustSetPotionTypesFirst: "You must set potion effect types first!" eventEditorSetPotionDurations: "Set potion effect durations"