Skip to content

Commit

Permalink
mes: allow swaps from outside plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Therealnull committed Feb 5, 2021
1 parent 233a440 commit 19c912c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public class MenuEntrySwapperPlugin extends Plugin
@Getter
private boolean configuringShiftClick = false;

private final Multimap<String, Swap> swaps = LinkedHashMultimap.create();
private static final Multimap<String, Swap> swaps = LinkedHashMultimap.create();
private final ArrayListMultimap<String, Integer> optionIndexes = ArrayListMultimap.create();

@Provides
Expand Down Expand Up @@ -361,7 +361,7 @@ void setupSwaps()
swap("eat", "guzzle", config::swapRockCake);
}

private void swap(String option, String swappedOption, Supplier<Boolean> enabled)
public static void swap(String option, String swappedOption, Supplier<Boolean> enabled)
{
swap(option, alwaysTrue(), swappedOption, enabled);
}
Expand All @@ -371,7 +371,7 @@ private void swap(String option, String target, String swappedOption, Supplier<B
swap(option, equalTo(target), swappedOption, enabled);
}

private void swap(String option, Predicate<String> targetPredicate, String swappedOption, Supplier<Boolean> enabled)
private static void swap(String option, Predicate<String> targetPredicate, String swappedOption, Supplier<Boolean> enabled)
{
swaps.put(option, new Swap(alwaysTrue(), targetPredicate, swappedOption, enabled, true));
}
Expand Down

0 comments on commit 19c912c

Please sign in to comment.