mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 18:45:27 +01:00
Remove color on quest tab complete, fixes #1907
This commit is contained in:
parent
0c699b2de8
commit
637ac02ee2
@ -4332,6 +4332,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
|||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final IQuest iq : quests) {
|
||||||
|
// For tab completion
|
||||||
|
final Quest q = (Quest) iq;
|
||||||
|
if (ChatColor.stripColor(q.getName()).equals(ChatColor.stripColor(ChatColor
|
||||||
|
.translateAlternateColorCodes('&', name)))) {
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4360,6 +4368,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
|||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final IQuest q : quests) {
|
||||||
|
// For tab completion
|
||||||
|
if (ChatColor.stripColor(q.getName()).equals(ChatColor.stripColor(ChatColor
|
||||||
|
.translateAlternateColorCodes('&', name)))) {
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4388,6 +4403,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final IAction a : actions) {
|
||||||
|
// For tab completion
|
||||||
|
if (ChatColor.stripColor(a.getName()).equals(ChatColor.stripColor(ChatColor.
|
||||||
|
translateAlternateColorCodes('&', name)))) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4416,6 +4438,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final ICondition c : conditions) {
|
||||||
|
// For tab completion
|
||||||
|
if (ChatColor.stripColor(c.getName()).equals(ChatColor.stripColor(ChatColor
|
||||||
|
.translateAlternateColorCodes('&', name)))) {
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class QuestadminFinishCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -135,7 +135,7 @@ public class QuestadminGiveCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -116,7 +116,7 @@ public class QuestadminNextstageCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -111,7 +111,7 @@ public class QuestadminQuitCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -108,7 +108,7 @@ public class QuestadminRemoveCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -102,7 +102,7 @@ public class QuestsQuitCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
@ -102,7 +102,7 @@ public class QuestsTakeCommand extends QuestsSubCommand {
|
|||||||
final List<String> results = new ArrayList<>();
|
final List<String> results = new ArrayList<>();
|
||||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||||
if (quest.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
|
if (quest.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
|
||||||
results.add(quest.getName());
|
results.add(ChatColor.stripColor(quest.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
Loading…
Reference in New Issue
Block a user