CustomHeads icon indicating copy to clipboard operation
CustomHeads copied to clipboard

GetMenuTitle() conflicts with other containers

Open Subie1 opened this issue 2 years ago • 1 comments

Issue Description

If another container has the name matching a HeadsTitle (for example a shulker box) they will conflict restricting some functionality including shift clicking an item in the container.

Infos

  • Plugin Version: Latest
  • Minecraft Version (ex. Paper 1.20.1):

Possible Fix:

Using custom InventoryHolders implementing them to a class and making the Menu use that holder when opening. (public abstract class CustomMenuHolder implements InventoryHolder)

this will allow to replace the

CustomHeads.getLooks().getMenuTitles().contains(event.getView().getTitle())

to

(menu.getHolder() instanceof CustomInventoryHolderHere)

Subie1 avatar Oct 02 '23 19:10 Subie1

Huh. Never heard about InventoryHolders I'll give it a look

IHasName avatar Oct 13 '23 21:10 IHasName