inventory tags: preserve 'cancel' when creating custom menu

The client will use the first menu entry for 'Cancel' and only resets the menu action and menu option as that's all it uses. Overwriting the menu entries with all custom entries caused the 'Cancel' option to have erroneous fields.
This commit is contained in:
trimbe
2019-01-04 21:16:17 -05:00
committed by Adam
parent 9c3b0e038b
commit 8953aace58

View File

@@ -212,9 +212,12 @@ public class InventoryTagsPlugin extends Plugin
return;
}
MenuEntry[] menuList = new MenuEntry[GROUPS.size()];
MenuEntry[] menuList = new MenuEntry[GROUPS.size() + 1];
int num = 0;
// preserve the 'Cancel' option as the client will reuse the first entry for Cancel and only resets option/action
menuList[num++] = event.getMenuEntries()[0];
for (final String groupName : GROUPS)
{
final String group = getTag(itemId);