menuentryswapper: Fix birdhouse swap
This commit is contained in:
@@ -252,7 +252,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
||||
|
||||
swap("pick-up", "chase", config::swapChase);
|
||||
|
||||
swap("interact", "birdhouse", "empty", config::swapBirdhouseEmpty);
|
||||
swap("interact", target -> target.endsWith("birdhouse"), "empty", config::swapBirdhouseEmpty);
|
||||
|
||||
swap("enter", "the gauntlet", "enter-corrupted", config::swapGauntlet);
|
||||
|
||||
|
||||
@@ -366,4 +366,35 @@ public class MenuEntrySwapperPluginTest
|
||||
menu("Deposit-All", "Rune arrow", MenuAction.CC_OP, 8),
|
||||
}, argumentCaptor.getValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBirdhouse()
|
||||
{
|
||||
when(config.swapBirdhouseEmpty()).thenReturn(true);
|
||||
|
||||
entries = new MenuEntry[]{
|
||||
menu("Cancel", "", MenuAction.CANCEL),
|
||||
menu("Examine", "Redwood birdhouse", MenuAction.EXAMINE_OBJECT),
|
||||
menu("Walk here", "", MenuAction.WALK),
|
||||
|
||||
menu("Empty", "Redwood birdhouse", MenuAction.GAME_OBJECT_THIRD_OPTION),
|
||||
menu("Seeds", "Redwood birdhouse", MenuAction.GAME_OBJECT_SECOND_OPTION),
|
||||
menu("Interact", "Redwood birdhouse", MenuAction.GAME_OBJECT_FIRST_OPTION),
|
||||
};
|
||||
|
||||
menuEntrySwapperPlugin.onClientTick(new ClientTick());
|
||||
|
||||
ArgumentCaptor<MenuEntry[]> argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class);
|
||||
verify(client).setMenuEntries(argumentCaptor.capture());
|
||||
|
||||
assertArrayEquals(new MenuEntry[]{
|
||||
menu("Cancel", "", MenuAction.CANCEL),
|
||||
menu("Examine", "Redwood birdhouse", MenuAction.EXAMINE_OBJECT),
|
||||
menu("Walk here", "", MenuAction.WALK),
|
||||
|
||||
menu("Interact", "Redwood birdhouse", MenuAction.GAME_OBJECT_FIRST_OPTION),
|
||||
menu("Seeds", "Redwood birdhouse", MenuAction.GAME_OBJECT_SECOND_OPTION),
|
||||
menu("Empty", "Redwood birdhouse", MenuAction.GAME_OBJECT_THIRD_OPTION),
|
||||
}, argumentCaptor.getValue());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user