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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user