mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-12 05:34:45 +01:00
Display objects of editor delete prompts alphabetically
This commit is contained in:
parent
5cfff53215
commit
223918ee77
@ -14,6 +14,7 @@ package me.blackvein.quests.convo.actions.menu;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -285,11 +286,15 @@ public class ActionMenuPrompt extends ActionsEditorNumericPrompt {
|
|||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
||||||
for (final Action a : plugin.getActions()) {
|
final List<String> names = plugin.getActions().stream().map(Action::getName).collect(Collectors.toList());
|
||||||
text += ChatColor.AQUA + a.getName() + ChatColor.GRAY + ",";
|
for (int i = 0; i < names.size(); i++) {
|
||||||
|
if (i < (names.size() - 1)) {
|
||||||
|
text += ChatColor.AQUA + names.get(i) + ChatColor.GRAY + ", ";
|
||||||
|
} else {
|
||||||
|
text += ChatColor.AQUA + names.get(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
text = text.substring(0, text.length() - 1) + "\n";
|
text += "\n" + ChatColor.YELLOW + getQueryText(context);
|
||||||
text += ChatColor.YELLOW + getQueryText(context);
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ package me.blackvein.quests.convo.conditions.menu;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -283,11 +284,15 @@ public class ConditionMenuPrompt extends ConditionsEditorNumericPrompt {
|
|||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
||||||
for (final Condition c : plugin.getConditions()) {
|
final List<String> names = plugin.getConditions().stream().map(Condition::getName).collect(Collectors.toList());
|
||||||
text += ChatColor.AQUA + c.getName() + ChatColor.GRAY + ",";
|
for (int i = 0; i < names.size(); i++) {
|
||||||
|
if (i < (names.size() - 1)) {
|
||||||
|
text += ChatColor.AQUA + names.get(i) + ChatColor.GRAY + ", ";
|
||||||
|
} else {
|
||||||
|
text += ChatColor.AQUA + names.get(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
text = text.substring(0, text.length() - 1) + "\n";
|
text += "\n" + ChatColor.YELLOW + getQueryText(context);
|
||||||
text += ChatColor.YELLOW + getQueryText(context);
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ package me.blackvein.quests.convo.quests.menu;
|
|||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@ -264,11 +265,15 @@ public class QuestMenuPrompt extends QuestsEditorNumericPrompt {
|
|||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
String text = ChatColor.GOLD + getTitle(context) + "\n";
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
final List<String> names = plugin.getQuests().stream().map(Quest::getName).collect(Collectors.toList());
|
||||||
text += ChatColor.AQUA + quest.getName() + ChatColor.GRAY + ",";
|
for (int i = 0; i < names.size(); i++) {
|
||||||
|
if (i < (names.size() - 1)) {
|
||||||
|
text += ChatColor.AQUA + names.get(i) + ChatColor.GRAY + ", ";
|
||||||
|
} else {
|
||||||
|
text += ChatColor.AQUA + names.get(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
text = text.substring(0, text.length() - 1) + "\n";
|
text += "\n" + ChatColor.YELLOW + getQueryText(context);
|
||||||
text += ChatColor.YELLOW + getQueryText(context);
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user