interfaces icon indicating copy to clipboard operation
interfaces copied to clipboard

Can modify chest interfaces

Open Artuto opened this issue 3 years ago • 0 comments

I'm using interfaces to give a shop preview, but using shift-click on items in the player inventory results in the items getting placed in the chest interface.

ChestInterface.Builder builder = ChestInterface.builder()
                .rows(6)
                .clickHandler(ClickHandler.cancel())
                .addTransform(PaperTransform.chestFill(
                        ItemStackElement.of(new ItemStack(Material.BLACK_STAINED_GLASS_PANE))))
                .title(Component.text("Shop preview"))
                .addTransform((pane, view) ->
                        pane.element(ItemStackElement.of(new ItemStack(Material.STONE)), 0,0));

                builder.build().open(PlayerViewer.of(player));

JM25rv3qxY

Attempting to merge the stacks with spam clicking also works sometimes.

The listener is registered:

getServer().getPluginManager().registerEvents(new PaperInterfaceListeners(this), this);

Artuto avatar Nov 18 '21 01:11 Artuto