mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 17:23:07 +00:00
Small Bug Fixes to Flight, Command Handling, Linked Items
This commit is contained in:
1 parent
109e31fd2d
commit
702dec9c40
4 files changed
+28
-6
No files matched your search
@@ -136,13 +136,13 @@ public class CommandKamkeel extends CommandBase {
|
||||
List<String> keys = new ArrayList<>(RequirementCheckerRegistry.getAllKeys());
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, keys.toArray(new String[keys.size()]));
|
||||
} else if (usage.equals("<effectName>")) {
|
||||
List<String> keys = getSortedEffectNames();
|
||||
List<String> keys = stripColorCodes(getSortedEffectNames());
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, keys.toArray(new String[keys.size()]));
|
||||
} else if (usage.equals("<ability>")) {
|
||||
List<String> keys = getPlayerAbilityNames();
|
||||
List<String> keys = stripColorCodes(getPlayerAbilityNames());
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, keys.toArray(new String[keys.size()]));
|
||||
} else if (usage.equals("<chain>")) {
|
||||
List<String> keys = getPlayerChainNames();
|
||||
List<String> keys = stripColorCodes(getPlayerChainNames());
|
||||
return CommandBase.getListOfStringsMatchingLastWord(args, keys.toArray(new String[keys.size()]));
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,14 @@ public class CommandKamkeel extends CommandBase {
|
||||
return command.addTabCompletionOptions(sender, Arrays.copyOfRange(args, 1, args.length));
|
||||
}
|
||||
|
||||
private static List<String> stripColorCodes(List<String> list) {
|
||||
List<String> result = new ArrayList<>(list.size());
|
||||
for (String s : list) {
|
||||
result.add(s.replaceAll("\u00A7[0-9a-fk-or]", ""));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public CommandKamkeelBase getCommand(String[] args) {
|
||||
if (args.length == 0)
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user