menu swapper: fix built in swaps overriding custom swaps

If a swap is configured for the item, never enter into the built in swapping logic. Even if the swap was not applied for this entry, assume either it has already been applied or will be later.

Co-authored-by: sam <dasistkeinnamen@gmail.com>
This commit is contained in:
Adam
2021-12-18 11:19:07 -05:00
parent 8fa819d035
commit 0f52e3ff18

View File

@@ -711,7 +711,7 @@ public class MenuEntrySwapperPlugin extends Plugin
if (itemOp)
{
Integer swapIndex = getSwapConfig(false, eventId);
if (swapIndex != null && index < menuEntries.length - 1)
if (swapIndex != null)
{
MenuAction swapAction = swapIndex >= 0
? MenuAction.of(MenuAction.ITEM_FIRST_OPTION.getId() + swapIndex)
@@ -720,8 +720,8 @@ public class MenuEntrySwapperPlugin extends Plugin
if (menuAction == swapAction)
{
swap(optionIndexes, menuEntries, index, menuEntries.length - 1);
return;
}
return;
}
}