mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@ -4360,6 +4368,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -4388,6 +4403,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -4416,6 +4438,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class QuestadminFinishCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
@ -135,7 +135,7 @@ public class QuestadminGiveCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
@ -116,7 +116,7 @@ public class QuestadminNextstageCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
@ -111,7 +111,7 @@ public class QuestadminQuitCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
@ -108,7 +108,7 @@ public class QuestadminRemoveCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[2].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
@ -102,7 +102,7 @@ public class QuestsQuitCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
@ -102,7 +102,7 @@ public class QuestsTakeCommand extends QuestsSubCommand {
|
||||
final List<String> results = new ArrayList<>();
|
||||
for (final IQuest quest : plugin.getLoadedQuests()) {
|
||||
if (quest.getName().toLowerCase().startsWith(args[1].toLowerCase())) {
|
||||
results.add(quest.getName());
|
||||
results.add(ChatColor.stripColor(quest.getName()));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
Loading…
Reference in New Issue
Block a user