Small Bug Fixes to Flight, Command Handling, Linked Items

This commit is contained in:
Kam committed 2026-03-02 15:23:54 -05:00
1 parent 109e31fd2d
commit 702dec9c40
4 files changed
+28 -6

No files matched your search

@@ -308,6 +308,7 @@ public class EffectCommand extends CommandKamkeelBase {
// Helper method to find effects by name.
private List<EffectEntry> findEffectsByName(String name) {
String strippedName = stripColorCodes(name);
List<EffectEntry> matches = new ArrayList<>();
CustomEffectController controller = CustomEffectController.getInstance();
for (Map.Entry<Integer, HashMap<Integer, CustomEffect>> entry : controller.indexMapper.entrySet()) {
@@ -317,11 +318,12 @@ public class EffectCommand extends CommandKamkeelBase {
for (Map.Entry<Integer, CustomEffect> effectEntry : effects.entrySet()) {
int id = effectEntry.getKey();
CustomEffect effect = effectEntry.getValue();
if (effect.getName().equalsIgnoreCase(name)) {
String effectName = stripColorCodes(effect.getName());
if (effectName.equalsIgnoreCase(strippedName)) {
List<EffectEntry> exact = new ArrayList<>();
exact.add(new EffectEntry(idx, id, effect));
return exact;
} else if (effect.getName().toLowerCase().contains(name.toLowerCase())) {
} else if (effectName.toLowerCase().contains(strippedName.toLowerCase())) {
matches.add(new EffectEntry(idx, id, effect));
}
}
@@ -329,6 +331,10 @@ public class EffectCommand extends CommandKamkeelBase {
return matches;
}
private static String stripColorCodes(String s) {
return s.replaceAll("\u00A7[0-9a-fk-or]", "");
}
public static List<String> getSortedEffectNames() {
List<EffectEntry> entries = new ArrayList<>();
CustomEffectController controller = CustomEffectController.getInstance();